text stringlengths 14 6.51M |
|---|
unit XLSReadWriteII2;
{-
********************************************************************************
******* XLSReadWriteII V3.00 *******
******* *******
******* Copyright(C) 1999,2006 Lars Arvidsson, Axolot Data *******
******* *******
******* email: components@axolot.com *******
******* URL: http://www.axolot.com *******
********************************************************************************
** Users of the XLSReadWriteII component must accept the following **
** disclaimer of warranty: **
** **
** XLSReadWriteII is supplied as is. The author disclaims all warranties, **
** expressed or implied, including, without limitation, the warranties of **
** merchantability and of fitness for any purpose. The author assumes no **
** liability for damages, direct or consequential, which may result from the **
** use of XLSReadWriteII. **
********************************************************************************
}
{$B-}
{$H+}
{$R-}
{$I XLSRWII2.inc}
// {$define SHAREWARE}
// {$define SHAREWARE_DLL}
interface
uses Classes, SysUtils, BIFFRecsII2, XLSUtils2, SST2,
CellFormats2, SheetData2, XLSStream2, XLSFonts2, EncodeFormulaII2,
ExcelMaskII2, Graphics, Cell2, Printers, Forms, RecordStorage2,
{$ifdef USE_MSSTORAGE}
Windows, WinSpool, ComObj, ActiveX, Dialogs,
{$else}
CompoundStream,
{$endif}
XLSNames2,ExcelFuncII2,Escher2, FormulaHandler2, DrawingObjChart2,
XLSVBA2;
//* ~[userDoc ..\help\metadata.txt CANT_FIND METADATA]
const CurrentVersionNumber = '3.01.01';
type TWorkbookOption = (woHidden, //* The window is hidden.
woIconized, //* The window is displayed as an icon.
woHScroll, //* The horizontal scroll bar is displayed.
woVScroll, //* The vertical scroll bar is displayed.
woTabs //* The workbook tabs are displayed.
);
TWorkbookOptions = set of TWorkbookOption;
type TShowObjects = (soShowAll, //* Show all.
soPlaceholders, //* Show placeholders.
soHideAll //* Hide all.
);
//* Calculation mode.
type TCalcMode = (cmManual, //* Manual calculation.
cmAutomatic, //* Automatic calculation.
cmAutoExTables //* Automatic calculation, except for tables.
);
//* ~exclude
type TStyles = class(TList)
private
function GetItems(Index: integer): PRecSTYLE;
public
destructor Destroy; override;
procedure Clear; override;
procedure Add(Style: PRecSTYLE);
property Items[Index: integer]: PRecSTYLE read GetItems; default;
end;
//* Options for the workbook window.
type TWorkbookData = class(TPersistent)
private
FRecords: TRecordStorageGlobals;
function ReadHeight: word;
function ReadLeft: word;
function ReadOptions: TWorkbookOptions;
function ReadSelectedTab: word;
function ReadTop: word;
function ReadWidth: word;
procedure WriteHeight(const Value: word);
procedure WriteLeft(const Value: word);
procedure WriteOptions(const Value: TWorkbookOptions);
procedure WriteSelectedTab(const Value: word);
procedure WriteTop(const Value: word);
procedure WriteWidth(const Value: word);
function GetDate1904: boolean;
public
//* ~exclude
constructor Create(Records: TRecordStorageGlobals);
published
//* Left position of the window, in units if 1/20th of a point.
property Left: word read ReadLeft write WriteLeft;
//* Top position of the window, in units if 1/20th of a point.
property Top: word read ReadTop write WriteTop;
//* Width of the window, in units if 1/20th of a point.
property Width: word read ReadWidth write WriteWidth;
//* Height of the window, in units if 1/20th of a point.
property Height: word read ReadHeight write WriteHeight;
//* Index of selected workbook tab, zero based.
property SelectedTab: word read ReadSelectedTab write WriteSelectedTab;
//* Options for the window.
property Options: TWorkbookOptions read ReadOptions write WriteOptions;
//* Returns True if the 1904 date system is used.
property Date1904: boolean read GetDate1904;
end;
//* The TOptionsDialog contains options for the workbook. These options
//* are from the Options dialog in Excel, for more info regarding the
//* options, please see the Excel documentation.
type TOptionsDialog = class(TPersistent)
private
FRecords: TRecordStorageGlobals;
FCalcCount: word;
FCalcMode: TCalcMode;
FDelta: double;
FIteration: boolean;
FR1C1Mode: boolean;
FRecalcBeforeSave: boolean;
FUncalced: boolean;
FSaveRecalc: boolean;
function GetShowObjects: TShowObjects;
procedure SetShowObjects(const Value: TShowObjects);
function GetPrecisionAsDisplayed: boolean;
procedure SetPrecisionAsDisplayed(const Value: boolean);
function GetSaveExtLinkVal: boolean;
procedure SetSaveExtLinkVal(const Value: boolean);
procedure SetCalcCount(const Value: word);
published
//* ~exclude
constructor Create(Records: TRecordStorageGlobals);
//* TRue if the Save External Link Values option is turned off (Options dialog box, Calculation tab).
property SaveExtLinkVal: boolean read GetSaveExtLinkVal write SetSaveExtLinkVal;
//* Maximum Iterations option from the Options dialog box, Calculation tab.
property CalcCount: word read FCalcCount write SetCalcCount;
//* Calculation mode.
property CalcMode: TCalcMode read FCalcMode write FCalcMode;
//* Maximum Change value from the Options dialog box, Calculation tab.
property Delta: double read FDelta write FDelta;
//* Which object to show.
property ShowObjects: TShowObjects read GetShowObjects write SetShowObjects;
//* True if the iteration option is on.
property Iteration: boolean read FIteration write FIteration;
//* True if Precision As Displayed option is selected.
property PrecisionAsDisplayed: boolean read GetPrecisionAsDisplayed write SetPrecisionAsDisplayed;
//* True if RIC1 mode is on.
property R1C1Mode: boolean read FR1C1Mode write FR1C1Mode;
//* True if recalc before save is on.
property RecalcBeforeSave: boolean read FRecalcBeforeSave write FRecalcBeforeSave;
//* True if the workbook is marked as uncalced.
property Uncalced: boolean read FUncalced write FUncalced;
//* True if recalculate before saving is on.
property SaveRecalc: boolean read FSaveRecalc write FSaveRecalc;
end;
//* This is the TXLSReadWriteII2 component.
//* ~example
//* ~[sample
//* // Here are some basic examples.
//* // Write a value to cell C3.
//* XLS.Sheet[0~[].AsString[2,2~[] := 'Hello';
//* // Read a value from cell C3.
//* S := XLS.Sheet[0~[].AsString[2,2~[];
//* // Read the same cell, but the position is given as a string.
//* S := XLS.Sheet[0~[].AsStringRef['C:3'~[];
//*
//* // Add a named cell.
//* with XLS.InternalNames.Add do begin
//* Name := 'MyCell';
//* Definition := 'Sheet1!C3';
//* end;
//* // Read the value from cell C3 by using the previous defined name.
//* S := XLS.NameAsString['MyCell'~[];
//*
//* // Set the color of a cell.
//* XLS.Sheet[0~[].Cell[2,2~[].FillPatternForeColor := xcYellow;
//* // Set the color of another cell. As there is in cell at this position, add a blank cell.
//* XLS.Sheet[0~[].AsBlank[2,3~[] := True;
//* XLS.Sheet[0~[].Cell[2,3~[].FillPatternForeColor := xcYellow;
//* ]
type TXLSReadWriteII2 = class(TComponent, ICellOperations)
private
FFilename: WideString;
FVersion: TExcelVersion;
FFormats: TCellFormats;
FDefaultFormat: TCellFormat;
FSheets: TSheets;
FWorkbookData: TWorkbookData;
FOptionsDialog: TOptionsDialog;
FFonts: TXFonts;
FMaxBuffsize: integer;
FIsMac: boolean;
FWriteDefaultData: boolean;
FDefaultCountryIndex: integer;
FWinIniCountry: integer;
FShowFormulas: boolean;
FAfterLoad: TNotifyEvent;
FFormulaHandler: TFormulaHandler;
FSST: TSST2;
FProgressEvent: TIntegerEvent;
FFunctionEvent: TFunctionEvent;
FPasswordEvent: TPasswordEvent;
FDevMode: PDeviceModeW;
FStyles: TStyles;
{$ifdef SHAREWARE}
FNagMsgShown: boolean;
{$endif}
FRecords: TRecordStorageGlobals;
{$ifdef USE_MSSTORAGE}
FExtraObjects: TExtraObjects;
{$else}
FCacheFiles: TCacheFile;
{$endif}
FMSOPictures: TMSOPictures;
// FPrintPictures: TMSOPictures;
FSheetCharts: TSheetCharts;
FPreserveMacros: boolean;
FPassword: WideString;
FDefaultPaperSize: TPaperSize;
FCellCount: integer;
FProgressCount: integer;
FCurrFindSheet: integer;
FVBA: TXLSVBA;
FFILESHARING: array of byte;
FAborted: boolean;
function GetRecomendReadOnly: boolean;
procedure SetRecomendReadOnly(const Value: boolean);
procedure SetVersion(Value: TExcelVersion);
procedure SetFont(F: TXFont);
function GetFont: TXFont;
procedure SetCodepage(Value: word);
procedure FormulaHandlerSheetName(Name: WideString; var Index,Count: integer);
function FormulaHandlerSheetData(DataType: TSheetDataType; SheetIndex,Col,Row: integer): WideString;
function GetCodepage: word;
function GetUserName: string;
procedure SetUserName(const Value: string);
function GetBookProtected: boolean;
procedure SetBookProtected(const Value: boolean);
function GetBackup: boolean;
procedure SetBackup(const Value: boolean);
function GetRefreshAll: boolean;
procedure SetRefreshAll(const Value: boolean);
function GetNameAsFloat(AName: string): double;
procedure SetNameAsFloat(AName: string; const Value: double);
function GetNameAsBoolean(AName: string): boolean;
function GetNameAsBoolFormulaValue(AName: string): boolean;
function GetNameAsError(AName: string): TCellError;
function GetNameAsFmtString(AName: string): WideString;
function GetNameAsFormula(AName: string): string;
function GetNameAsNumFormulaValue(AName: string): double;
function GetNameAsStrFormulaValue(AName: string): WideString;
function GetNameAsString(AName: string): WideString;
procedure SetNameAsBoolean(AName: string; const Value: boolean);
procedure SetNameAsBoolFormulaValue(AName: string; const Value: boolean);
procedure SetNameAsError(AName: string; const Value: TCellError);
procedure SetNameAsFormula(AName: string; const Value: string);
procedure SetNameAsNumFormulaValue(AName: string; const Value: double);
procedure SetNameAsStrFormulaValue(AName: string; const Value: WideString);
procedure SetNameAsString(AName: string; const Value: WideString);
function GetNameAsCell(AName: string): TCell;
function GetVersionNumber: string;
procedure SetVerionNumber(const Value: string);
function GetInternalNames: TInternalNames;
procedure SetInternalNames(const Value: TInternalNames);
procedure SetStrFALSE(const Value: WideString);
procedure SetStrTRUE(const Value: WideString);
function GetPalette(Index: integer): TColor;
procedure SetPalette(Index: integer; const Value: TColor);
function GetSheet(Index: integer): TSheet;
procedure SetFilename(const Value: WideString);
function GetStrFALSE: WideString;
function GetStrTRUE: WideString;
protected
procedure GetCommonSheetData;
procedure SetCommonSheetData;
procedure InternalNameDeleted(Sender: TObject; Delta: integer);
public
//* ~exclude
constructor Create(AOwner: TComponent); override;
//* ~exclude
destructor Destroy; override;
//* Clears all cell values in all sheets. See also ~[link Clear]
procedure ClearCells;
//* Clears all data from the workbook.
procedure Clear;
//* Reads the file given by ~[link Filename]
procedure Read;
//* Writes the file given by ~[link Filename]. Please note that if
//* the file allready is opened by another application, such as Excel, it
//* is not possible to write to it, as Excel locks the file for exclusive
//* use.
procedure Write;
//* Writes the workbook to a stream instead of writing to a file.
//* ~param Stream The stream to write the workbook to.
procedure WriteToStream(Stream: TStream);
//* Reads the workbook from a stream instead of reading from a file.
//* ~param Stream The stream to read the workbook from.
procedure LoadFromStream(Stream: TStream);
//* Returns a password that can be used to unprotect worksheets.
//* This may not be the same password used to protect it.
//* If there is no protection, an empty string is returned.
function GetWeakPassword: string;
//* The max number of rows there can be in a worksheet. Normally 65536.
//* ~result Max number of rows.
function MaxRowCount: integer;
//* Copies the cells in area Col1,Row1 - Col2,Row2 on sheet
//* SrcSheet to DestCol and DestRow on sheet DestSheet. Which type of
//* cells and data that are copied can be set with CopyOptions. The
//* copying is carried out correctly even if the areas overlap.
//* See also ~[link XLSUtils2.TCopyCellsOptions TCopyCellsOptions]
//* ~param SrcSheet Source sheet index.
//* ~param Col1 Left column of source area.
//* ~param Row1 Top row of source area.
//* ~param Col2 Right column of source area.
//* ~param Row2 Bottom row of source area.
//* ~param DestSheet Destination sheet index.
//* ~param DestCol Destination column for the copied cells.
//* ~param DestRow Destination row for the copied cells.
//* ~param CopyOptions Cell copying options.
procedure CopyCells(SrcSheet,Col1,Row1,Col2,Row2,DestSheet,DestCol,DestRow: integer; CopyOptions: TCopyCellsOptions = [ccoAdjustCells] + CopyAllCells);
//* Moves the cells in area Col1,Row1 - Col2,Row2 on sheet SrcSheet
//* to DestCol and DestRow on sheet DestSheet. Which type of cells and
//* data that are moved can be set with CopyOptions.
//* See also ~[link XLSUtils2.TCopyCellsOptions TCopyCellsOptions]
//* ~param SrcSheet Source sheet index.
//* ~param Col1 Left column of source area.
//* ~param Row1 Top row of source area.
//* ~param Col2 Right column of source area.
//* ~param Row2 Bottom row of source area.
//* ~param DestSheet Destination sheet index.
//* ~param DestCol Destination column for the moved cells.
//* ~param DestRow Destination row for the moved cells.
//* ~param CopyOptions Cell copying options.
procedure MoveCells(SrcSheet,Col1,Row1,Col2,Row2,DestSheet,DestCol,DestRow: integer; CopyOptions: TCopyCellsOptions = [ccoAdjustCells] + CopyAllCells);
//* Deletes an area of cells.
//* ~param Sheet Sheet index.
//* ~param Col1 Left column of the area.
//* ~param Row1 Top row of the area.
//* ~param Col2 Right column of the area.
//* ~param Row2 Bottom row of the area.
procedure DeleteCells(Sheet, Col1, Row1, Col2, Row2: integer);
//* Copy columns Col1 to Col2 on sheet SrcSheet to column DestCol
//* on sheet DestSheet. Cell values are copied as well. Any existing data
//* at the destination is overwritten. For only copying column widths, see
//* ~[link Columns2.TXLSColumns].
//* ~param SrcSheet Source sheet index.
//* ~param Col1 Left column of source area.
//* ~param Col2 Right column of source area.
//* ~param DestSheet Destination sheet index.
//* ~param DestCol Destination column for the copied cells.
//* ~param DoCopyCells Copy the cells as well, and not just the column settings.
procedure CopyColumns(SrcSheet,Col1,Col2,DestSheet,DestCol: integer; DoCopyCells: boolean = True);
//* Copies columns Col1 to Col2 on sheet SrcSheet to column DestCol on
//* sheet DestSheet. Cell values are moved as well.
//* Any existing data at the destination is overwritten, and the source
//* columns are cleared.
//* For only moving column widths, see ~[link Columns2.TXLSColumns].
//* ~param SrcSheet Source sheet index.
//* ~param Col1 Left column of source area.
//* ~param Col2 Right column of source area.
//* ~param DestSheet Destination sheet index.
//* ~param DestCol Destination column for the moved cells.
//* ~param DoMoveCells Copy the cells as well, and not just the column settings.
procedure MoveColumns(SrcSheet,Col1,Col2,DestSheet,DestCol: integer; DoMoveCells: boolean = True);
//* Deletes columns Col1 to Col2 on sheet Sheet.
//* Columns to the right of Col2 are shifted left.
//* ~param Sheet Index of the sheet to delete the columns on.
//* ~param Col1 Left column of the span.
//* ~param Col2 Right column of the span.
procedure DeleteColumns(Sheet,Col1,Col2: integer);
//* Clears columns Col1 to Col2 on sheet Sheet.
//* ~param Sheet Index of the sheet to clear the columns on.
//* ~param Col1 Left column of the span.
//* ~param Col2 Right column of the span.
procedure ClearColumns(Sheet,Col1,Col2: integer);
//* Inserts ColCount empty columns at column Col in sheet Sheet.
//* ~param Sheet Index of the sheet to insert the columns on.
//* ~param Col Insertion point for the columns.
//* ~param ColCount Number of columns to insert.
procedure InsertColumns(Sheet,Col,ColCount: integer);
//* Copy rows Row1 to Row2 on sheet SrcSheet to row DestRow on
//* sheet DestSheet. Cell values are copied as well.
//* Any existing data at the destination is overwritten.
//* For only copying row heights, see ~[link Rows2.TXLSRows].
//* ~param SrcSheet Source sheet index.
//* ~param Row1 Top row of source area.
//* ~param Row2 Bottom row of source area.
//* ~param DestSheet Destination sheet index.
//* ~param DestRow Destination row for the copied cells.
//* ~param DoCopyCells Copy the cells as well, and not just the column settings.
procedure CopyRows(SrcSheet,Row1,Row2,DestSheet,DestRow: integer; DoCopyCells: boolean = True);
//* Moves rows Row1 to Row2 on sheet SrcSheet to row DestRow on
//* sheet DestSheet. Cell values are copied as well.
//* Any existing data at the destination is overwritten.
//* For only moving row heights, see ~[link Rows2.TXLSRows].
//* ~param SrcSheet Source sheet index.
//* ~param Row1 Top row of source area.
//* ~param Row2 Bottom row of source area.
//* ~param DestSheet Destination sheet index.
//* ~param DestRow Destination row for the moved cells.
//* ~param DoMoveCells Copy the cells as well, and not just the column settings.
procedure MoveRows(SrcSheet,Row1,Row2,DestSheet,DestRow: integer; DoMoveCells: boolean = True);
//* Deletes rows Row1 to Row2 on sheet Sheet.
//* Rows below Row2 are shifted uppwards.
//* ~param Sheet Index of the sheet to delete the rows on.
//* ~param Row1 Top row of the span.
//* ~param Row2 Bottom row of the span.
procedure DeleteRows(Sheet,Row1,Row2: integer);
//* Clears rows Row1 to Row2 on sheet Sheet.
//* ~param Sheet Index of the sheet to clear the rows on.
//* ~param Row1 Top row of the span.
//* ~param Row2 Bottom row of the span.
procedure ClearRows(Sheet,Row1,Row2: integer);
//* Inserts RowCount empty Rows at row Row in sheet Sheet.
//* ~param Sheet Index of the sheet to insert the rows on.
//* ~param Row Insertion point for the first row.
//* ~param RowCount Number of rows to insert.
procedure InsertRows(Sheet,Row,RowCount: integer);
//* Copies the content of SrcSheet to DestSheet.
//* ~param SrcSheet Index of the source sheet.
//* ~param DestSheet Index of the destination sheet.
procedure CopySheet(SrcSheet,DestSheet: integer);
//* ~exclude
function GetDEVMODE: PDeviceModeW;
//* ~exclude
procedure SetDEVMODE(P: Pointer; Sz: integer);
//* ~exclude
function HasDEVMODE: boolean;
//* Calculates all sheets in the workbook.
//* See also ~[link TSheet.Calculate]
procedure Calculate;
//* Use BeginUpdate when you do a lot of changes to the workbook.
//* BeginUpdate is most usefull when adding many string cells.
//* EndUpdate must be called after the changes are done.
//* See also ~[link EndUpdate]
procedure BeginUpdate;
//* Writes any pending changes since BeginUpdate was called.
//* See also ~[link BeginUpdate]
procedure EndUpdate;
//* Abort reading of a file. After the reading is aborted ~[link Aborted] is set tor True.
procedure Abort;
//* Checks ~[link Abort] was called to stop the file reading.
//* ~result True if the read operation was aborted.
function Aborted: boolean;
//* Resets the position to the first cell when searching the workbook for a text. See also ~[link FindText].
procedure BeginFindText;
//* Searches the string cells in the worksheet for Text. Each subsequent
//* call to FindText will stop at the next occurrence if the text.
//* The search text may occure more than once in a cell.
//* FindText will return True if the text was found.
//* Use GetFindData to get information about where in the worksheet
//* the text was found. Call ~[link BeginFindText] to start a new text search.
//* ~param Text The text string to search for.
//* ~param CaseInsensitive True if the text search shall be case insensitive.
//* ~result True if the text was found.
function FindText(Text: WideString; CaseInsensitive: boolean = True): boolean;
//* Returns information about where in a worksheet a text searched
//* for with ~[link FindText] was found.
//* ~param Sheet The worksheet where the text was found.
//* ~param Col The cells column.
//* ~param Row The cells row.
//* ~param TextPos The position in the cells text the search text was found.
//* ~param Text The text in the cell where the search string where found.
procedure GetFindData(var Sheet,Col,Row,TextPos: integer; var Text: WideString);
//* Access a Cell object by a name that references to a cell. See also ~[link InternalNames]
property NameAsCell [AName: string]: TCell read GetNameAsCell;
//* Access a float cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsFloat]
property NameAsFloat [AName: string]: double read GetNameAsFloat write SetNameAsFloat;
//* Access a string cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsString]
property NameAsString [AName: string]: WideString read GetNameAsString write SetNameAsString;
//* Access a formatted string cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsFmtString]
property NameAsFmtString [AName: string]: WideString read GetNameAsFmtString;
//* Access a boolean cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsBoolean]
property NameAsBoolean [AName: string]: boolean read GetNameAsBoolean write SetNameAsBoolean;
//* Access an error cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsError]
property NameAsError [AName: string]: TCellError read GetNameAsError write SetNameAsError;
//* Access a formula cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsFormula]
property NameAsFormula [AName: string]: string read GetNameAsFormula write SetNameAsFormula;
//* Access a number formula result cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsNumFormulaValue]
property NameAsNumFormulaValue [AName: string]: double read GetNameAsNumFormulaValue write SetNameAsNumFormulaValue;
//* Access a string formula result cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsStrFormulaValue]
property NameAsStrFormulaValue [AName: string]: WideString read GetNameAsStrFormulaValue write SetNameAsStrFormulaValue;
//* Access a boolean formula result cell value by a name that references to a cell. See also ~[link InternalNames] , ~[link TSheet.AsBoolFormulaValue]
property NameAsBoolFormulaValue[AName: string]: boolean read GetNameAsBoolFormulaValue write SetNameAsBoolFormulaValue;
//* Default paper size.
property DefaultPaperSize: TPaperSize read FDefaultPaperSize write FDefaultPaperSize;
{ ********************************************* }
{ ********** For internal use only. *********** }
{ ********************************************* }
// Set to False when loading an Excel file, as there is default data in the file.
property WriteDefaultData: boolean read FWriteDefaultData write FWriteDefaultData;
//* ~exclude
property MaxBuffSize: integer read FMaxBuffsize;
//* ~exclude
property Styles: TStyles read FStyles;
//* ~exclude
property OnAfterLoad: TNotifyEvent read FAfterLoad write FAfterLoad;
//* ~exclude
property Records: TRecordStorageGlobals read FRecords;
//* ~exclude
{$ifdef USE_MSSTORAGE}
property ExtraObjects: TExtraObjects read FExtraObjects;
{$else}
property CacheFiles: TCacheFile read FCacheFiles write FCacheFiles;
{$endif}
//* ~exclude
property Formats: TCellFormats read FFormats write FFormats;
//* ~exclude
property Fonts: TXFonts read FFonts write FFonts;
//* ~exclude
property DefaultFormat: TCellFormat read FDefaultFormat;
//* ~exclude
function GetNameValue(Index, Col, Row: integer): TFormulaValue;
//* ~exclude
function GetExternNameValue(NameIndex,SheetIndex: integer): TFormulaValue;
//* ~exclude
procedure AddNumberFormat(Format: string; Index: integer);
//* ~exclude
procedure WrittenNCells;
//* ~exclude
procedure SetFILESHARING(PBuf: PByteArray; Size: integer);
//* ~exclude
function GetFILESHARING(PBuf: PByteArray): integer;
// @exclude
// *********************************************
// ********** End internal use only. ***********
// *********************************************
//* User defined names for cells and areas.
property InternalNames: TInternalNames read GetInternalNames write SetInternalNames;
//* Charts that are on it's own sheet.
//* See also ~[link TSheetCharts]
property SheetCharts: TSheetCharts read FSheetCharts;
//* ~exclude
property DefaultCountryIndex: integer read FDefaultCountryIndex write FDefaultCountryIndex;
//* ~exclude
property WinIniCountry: integer read FWinIniCountry write FWinIniCountry;
//* ~exclude
property FormulaHandler: TFormulaHandler read FFormulaHandler;
//* ~exclude
property Codepage: word read GetCodepage write SetCodepage;
//* The palette for the colors used by Excel. The palette has 64 entries,
//* but the first 8 are fixed and can not be changed.
property Palette[Index: integer]: TColor read GetPalette write SetPalette;
//* THe worksheets in the workbook.
//* See ~[link TSheet]
property Sheet[Index: integer]: TSheet read GetSheet; default;
//* Object for handling Visual Basic macros.
property VBA: TXLSVBA read FVBA;
published
//* The Excel file version for the workbook.
//* See also ~[link TExcelVersion]
property Version: TExcelVersion read FVersion write SetVersion;
//* The worksheets in the workbook.
//* See ~[link TSheet]
property Sheets: TSheets read FSheets write FSheets;
//* Options for the worksheets in the workbook.
property Workbook: TWorkbookData read FWorkbookData write FWorkbookData;
//* Here you will find parameters from the Tools->Options dialog in Excel.
property OptionsDialog: TOptionsDialog read FOptionsDialog write FOptionsDialog;
//* The default font for the workbook.
property Font: TXFont read GetFont write SetFont;
//* The name of the creator of the workbook.
property UserName: string read GetUserName write SetUserName;
//* The BookProtect property stores the protection state for a sheet or workbook.
property BookProtected: boolean read GetBookProtected write SetBookProtected;
//* The Backup property specifies whether Microsoft Excel should save
//* backup versions of a file, when the file is opened with Excel.
property Backup: boolean read GetBackup write SetBackup;
//* Set the RefreshAll property to True if all external data should be
//* refreshed when the workbook is loaded by Excel.
property RefreshAll: boolean read GetRefreshAll write SetRefreshAll;
//* Change StrTRUE property to change the string representation of the
//* boolean value True. The default is 'True'.
//* See also ~[link StrFALSE]
property StrTRUE: WideString read GetStrTRUE write SetStrTRUE;
//* Change StrFALSE property to change the string representation of the
//* boolean value False. The default is 'False'.
//* See also ~[link StrTRUE]
property StrFALSE: WideString read GetStrFALSE write SetStrFALSE;
//* Set the ShowFormulas property to True if functions which reads cells
//*and return string values shall return the formula itself or de result
//* (value) of the formula.
property ShowFormulas: boolean read FShowFormulas write FShowFormulas;
//* Set the Filename property to the name of the file you want to read or
//* write.
//* See also ~[link Read], ~[link Write], ~[link LoadFromStream], ~[link WriteToStream]
property Filename: WideString read FFilename write SetFilename;
//* True if the file is created by Excel for Macintosh.
property IsMac: boolean read FIsMac write FIsMac;
//* Set PreserveMacros to True if macros (VBA script) shall be preserved
//* when a file is read. When set to False, all macros are deleted.
property PreserveMacros: boolean read FPreserveMacros write FPreserveMacros;
//* The version of the TXLSReadWriteII2 component.
property ComponentVersion: string read GetVersionNumber write SetVerionNumber;
//* Global storage for pictures used in the worksheets.
property MSOPictures: TMSOPictures read FMSOPictures write FMSOPictures;
//* ~exclude
// property PrintPictures: TMSOPictures read FPrintPictures write FPrintPictures;
//* Password when reading/writing encrypted files.
property Password: WideString read FPassword write FPassword;
//* Mark the file as recomended read only.
property RecomendReadOnly: boolean read GetRecomendReadOnly write SetRecomendReadOnly;
//* Event fired while a file is read or written. The Value parameter
//* increases from 0 to 100 while the file is read or written.
property OnProgress: TIntegerEvent read FProgressEvent write FProgressEvent;
//* Use the OnFunction event to do the calculation of formulas which not
//* are calculated by TXLSReadWriteII2.
//* See also ~[link Calculate]
property OnFunction: TFunctionEvent read FFunctionEvent write FFunctionEvent;
//* Event fired when a password protected (encrypted) file is read, and
//* the password is required.
property OnPassword: TPasswordEvent read FPasswordEvent write FPasswordEvent;
end;
implementation
uses XLSReadII2, XLSWriteII2, DecodeFormula2;
{ TOptionsDialog }
constructor TOptionsDialog.Create(Records: TRecordStorageGlobals);
begin
FRecords := Records;
FCalcMode := cmAutomatic;
end;
function TOptionsDialog.GetPrecisionAsDisplayed: boolean;
begin
Result := FRecords.PRECISION;
end;
function TOptionsDialog.GetSaveExtLinkVal: boolean;
begin
Result := FRecords.BOOKBOOL;
end;
function TOptionsDialog.GetShowObjects: TShowObjects;
begin
Result := TShowObjects(FRecords.HIDEOBJ);
end;
procedure TOptionsDialog.SetCalcCount(const Value: word);
begin
if Value <= 0 then
FCalcCount := 1
else if Value > $7FFF then
FCalcCount := $7FFF
else
FCalcCount := Value;
end;
procedure TOptionsDialog.SetPrecisionAsDisplayed(const Value: boolean);
begin
FRecords.PRECISION := Value;
end;
procedure TOptionsDialog.SetSaveExtLinkVal(const Value: boolean);
begin
FRecords.BOOKBOOL := Value;
end;
procedure TOptionsDialog.SetShowObjects(const Value: TShowObjects);
begin
FRecords.HIDEOBJ := Word(Value);
end;
{ TStyle }
procedure TStyles.Add(Style: PRecSTYLE);
var
P: PRecSTYLE;
begin
New(P);
System.Move(Style^,P^,SizeOf(TRecSTYLE));
inherited Add(P);
end;
procedure TStyles.Clear;
var
i: integer;
begin
for i := 0 to Count - 1 do
FreeMem(inherited Items[i]);
inherited Clear;
end;
destructor TStyles.Destroy;
begin
Clear;
inherited;
end;
function TStyles.GetItems(Index: integer): PRecSTYLE;
begin
Result := inherited Items[Index];
end;
{ TWorkbookData }
constructor TWorkbookData.Create(Records: TRecordStorageGlobals);
begin
FRecords := Records;
end;
function TWorkbookData.GetDate1904: boolean;
begin
Result := FRecords.DATE1904;
end;
function TWorkbookData.ReadHeight: word;
begin
Result := FRecords.WINDOW1.Height;
end;
function TWorkbookData.ReadLeft: word;
begin
Result := FRecords.WINDOW1.Left;
end;
function TWorkbookData.ReadOptions: TWorkbookOptions;
begin
Result := [];
if (FRecords.WINDOW1.Options and $01) = $01 then
Result := Result + [woHidden];
if (FRecords.WINDOW1.Options and $02) = $02 then
Result := Result + [woIconized];
if (FRecords.WINDOW1.Options and $08) = $08 then
Result := Result + [woHScroll];
if (FRecords.WINDOW1.Options and $10) = $10 then
Result := Result + [woVScroll];
if (FRecords.WINDOW1.Options and $20) = $20 then
Result := Result + [woTabs];
end;
function TWorkbookData.ReadSelectedTab: word;
begin
Result := FRecords.WINDOW1.SelectedTabIndex;
end;
function TWorkbookData.ReadTop: word;
begin
Result := FRecords.WINDOW1.Top;
end;
function TWorkbookData.ReadWidth: word;
begin
Result := FRecords.WINDOW1.Width;
end;
procedure TWorkbookData.WriteHeight(const Value: word);
begin
FRecords.WINDOW1.Height := Value;
end;
procedure TWorkbookData.WriteLeft(const Value: word);
begin
FRecords.WINDOW1.Left := Value;
end;
procedure TWorkbookData.WriteOptions(const Value: TWorkbookOptions);
begin
FRecords.WINDOW1.Options := 0;
if woHidden in Value then
FRecords.WINDOW1.Options := FRecords.WINDOW1.Options or $01;
if woIconized in Value then
FRecords.WINDOW1.Options := FRecords.WINDOW1.Options or $02;
if woHScroll in Value then
FRecords.WINDOW1.Options := FRecords.WINDOW1.Options or $08;
if woVScroll in Value then
FRecords.WINDOW1.Options := FRecords.WINDOW1.Options or $10;
if woTabs in Value then
FRecords.WINDOW1.Options := FRecords.WINDOW1.Options or $20;
end;
procedure TWorkbookData.WriteSelectedTab(const Value: word);
begin
FRecords.WINDOW1.SelectedTabIndex := Value;
end;
procedure TWorkbookData.WriteTop(const Value: word);
begin
FRecords.WINDOW1.Top := Value;
end;
procedure TWorkbookData.WriteWidth(const Value: word);
begin
FRecords.WINDOW1.Width := Value;
end;
constructor TXLSReadWriteII2.Create(AOwner: TComponent);
var
{$ifdef SHAREWARE}
A,B,C,D: boolean;
{$endif}
PB: PByteArray;
Sz: integer;
begin
inherited Create(AOwner);
{$ifdef SHAREWARE}
{$ifdef SHAREWARE_DLL}
FNagMsgShown := True;
{$endif}
if not FNagMsgShown then begin
A := (FindWindow('TApplication', nil) = 0);
// B := (FindWindow('TAlignPalette', nil) = 0);
// C := (FindWindow('TPropertyInspector', nil) = 0);
B := False;
C := False;
D := (FindWindow('TAppBuilder', nil) = 0);
if A or B or C or D then begin
MessageDlg('This application was built with a demo version of' + #13 +
'the XLSReadWriteII components.' + #13 + #13 +
'Distributing an application based upon this version' + #13 +
'of the components are against the licensing agreement.' + #13 + #13 +
'Please see http://www.axolot.com for more information' + #13 +
'on purchasing.',mtInformation,[mbOk],0);
FNagMsgShown := True;
end;
end;
{$endif}
Move(TDefaultExcelColorPalette[0],ExcelColorPalette[0],SizeOf(ExcelColorPalette));
{
FCodepage := $04B0;
}
// GetDEVMODE can cause all kind of strange errors. It's only used for
// reading the default paper size.
FDevMode := Nil; // GetDEVMODE;
FDefaultPaperSize := psA4;
PB := Nil;
Sz := GetLocaleInfo(GetUserDefaultLCID,$100A {LOCALE_IPAPERSIZE},PChar(PB),0);
GetMem(PB,Sz);
try
if GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,$100A {LOCALE_IPAPERSIZE},PChar(PB),Sz) <> 0 then begin
case Char(PB[0]) of
'1': FDefaultPaperSize := psLegal;
'5': FDefaultPaperSize := psLetter;
'8': FDefaultPaperSize := psA3;
'9': FDefaultPaperSize := psA4;
end;
end;
finally
FreeMem(PB);
end;
FRecords := TRecordStorageGlobals.Create;
FRecords.SetDefaultData;
FPreserveMacros := True;
{$ifdef USE_MSSTORAGE}
FExtraObjects := TExtraObjects.Create;
{$else}
FCacheFiles := TCacheFile.Create;
{$endif}
FIsMac := False;
FWriteDefaultData := True;
FWorkbookData := TWorkbookData.Create(FRecords);
FWorkbookData.Options := [woHScroll,woVScroll,woTabs];
FWorkbookData.Top := 100;
FWorkbookData.Left := 100;
FWorkbookData.Width := 10000;
FWorkbookData.Height := 7000;
FOptionsDialog := TOptionsDialog.Create(FRecords);
FFonts := TXFonts.Create(Self);
FFormats := TCellFormats.Create(FFonts);
FDefaultFormat := FFormats[DEFAULT_FORMAT];
FSST := TSST2.Create(FFonts);
FFormulaHandler := TFormulaHandler.Create(Self,FSST);
FFormulaHandler.OnSheetName := FormulaHandlerSheetName;
FFormulaHandler.OnSheetData := FormulaHandlerSheetData;
FFormulaHandler.InternalNames.OnNameDeleted := InternalNameDeleted;
SetStrTRUE('TRUE');
SetStrFALSE('FALSE');
FMSOPictures := TMSOPictures.Create(Self);
// FPrintPictures := TMSOPictures.Create(Self);
FStyles := TStyles.Create;
FSheets := TSheets.Create(Self,FFormulaHandler);
// Clear;
FSheets.Add;
FSheetCharts := TSheetCharts.Create(Self,MSOPictures);
FVBA := TXLSVBA.Create;
GetCommonSheetData;
SetVersion(xvExcel97);
end;
destructor TXLSReadWriteII2.Destroy;
begin
try
// Clear;
except
end;
FSST.Free;
FSheets.Free;
FFormulaHandler.Free;
FFormats.Free;
FFonts.Free;
FOptionsDialog.Free;
FWorkbookData.Free;
FStyles.Free;
FreeMem(FDevMode);
FRecords.Free;
FMSOPictures.Free;
// FPrintPictures.Free;
{$ifdef USE_MSSTORAGE}
FExtraObjects.Free;
{$else}
FCacheFiles.Free;
{$endif}
FSheetCharts.Free;
FVBA.Free;
inherited;
end;
procedure TXLSReadWriteII2.ClearCells;
begin
FSheets.Clear;
end;
procedure TXLSReadWriteII2.Clear;
begin
FFormulaHandler.Clear;
FSST.Clear;
FRecords.SetDefaultData;
FWriteDefaultData := True;
ClearCells;
FFormats.Clear;
FFormats.SetDefault;
FFonts.Clear;
FFonts.SetDefault;
FStyles.Clear;
FMSOPictures.Clear;
// FPrintPictures.Free;
{$ifdef USE_MSSTORAGE}
FExtraObjects.Clear;
{$else}
FCacheFiles.Clear;
{$endif}
FSheetCharts.Clear;
FVBA.Clear;
if FDevMode <> Nil then
FreeMem(FDevMode);
FDevMode := Nil;
SetLength(FFILESHARING,0);
FAborted := False;
end;
procedure TXLSReadWriteII2.SetVersion(Value: TExcelVersion);
begin
FVersion := Value;
if FVersion >= xvExcel97 then
FMaxBuffsize := MAXRECSZ_97
else
FMaxBuffsize := MAXRECSZ_40;
FSheets.MaxBufSize := FMaxBuffsize;
FFormulaHandler.Version := FVersion;
end;
function TXLSReadWriteII2.GetFont: TXFont;
begin
Result := Nil;
if FFonts.Count > 0 then
Result := FFonts[0]
else
ShowMessage('No Fonts');
end;
procedure TXLSReadWriteII2.SetFilename(const Value: WideString);
begin
FFilename := Value;
end;
procedure TXLSReadWriteII2.SetFILESHARING(PBuf: PByteArray; Size: integer);
begin
SetLength(FFILESHARING,Size);
Move(PBuf^,FFILESHARING[0],Size);
end;
procedure TXLSReadWriteII2.SetFont(F: TXFont);
begin
if FFonts.Count > 0 then
FFonts[0].Assign(F)
else
ShowMessage('No Fonts');
end;
procedure TXLSReadWriteII2.SetCodepage(Value: word);
begin
if Value = 0 then
FRecords.CODEPAGE := $04E4
else
FRecords.CODEPAGE := Value;
end;
function TXLSReadWriteII2.GetCodepage: word;
begin
Result := FRecords.CODEPAGE;
end;
procedure TXLSReadWriteII2.GetCommonSheetData;
begin
case FSheets[0]._Int_Records.CALCMODE of
$0000: FOptionsDialog.CalcMode := cmManual;
$0001: FOptionsDialog.CalcMode := cmAutomatic;
$FFFF: FOptionsDialog.CalcMode := cmAutoExTables;
end;
FOptionsDialog.CalcCount := FSheets[0]._Int_Records.CALCCOUNT;
FOptionsDialog.Delta := FSheets[0]._Int_Records.DELTA;
FOptionsDialog.R1C1Mode := FSheets[0]._Int_Records.REFMODE = 0;
FOptionsDialog.Iteration := FSheets[0]._Int_Records.ITERATION;
FOptionsDialog.SaveRecalc := FSheets[0]._Int_Records.SAVERECALC;
end;
procedure TXLSReadWriteII2.SetCommonSheetData;
var
i: integer;
begin
for i := 0 to FSheets.Count - 1 do begin
case FOptionsDialog.CalcMode of
cmManual : FSheets[i]._Int_Records.CALCMODE := $0000;
cmAutomatic : FSheets[i]._Int_Records.CALCMODE := $0001;
cmAutoExTables : FSheets[i]._Int_Records.CALCMODE := $FFFF;
end;
FSheets[i]._Int_Records.CALCCOUNT := FOptionsDialog.CalcCount;
FSheets[i]._Int_Records.REFMODE := Word(not FOptionsDialog.R1C1Mode);
FSheets[i]._Int_Records.ITERATION := FOptionsDialog.Iteration;
FSheets[i]._Int_Records.SAVERECALC := FOptionsDialog.SaveRecalc;
end;
end;
procedure TXLSReadWriteII2.SetDEVMODE(P: Pointer; Sz: integer);
begin
GetMem(FDevmode,Sz);
Move(P^,FDevmode^,Sz);
end;
procedure TXLSReadWriteII2.Read;
begin
LoadFromStream(Nil);
end;
procedure TXLSReadWriteII2.LoadFromStream(Stream: TStream);
var
i: integer;
List: TList;
XLSRead: TXLSReadII;
begin
Clear;
FSheets.ClearAll;
FFonts.Clear;
FFormats.Clear;
FFormats.NumberFormats.SetDefault;
BeginUpdate;
XLSRead := TXLSReadII.Create(Self);
try
XLSRead.LoadFromStream(Stream);
// FixupPictureData;
FFormulaHandler.ExternalNames.FilePath := ExtractFilePath(FFilename);
if Assigned(FAfterLoad) then
FAfterLoad(Self);
finally
XLSRead.Free;
EndUpdate;
if FSheets.Count < 1 then begin
Clear;
FSheets.Clear;
end;
end;
FFormats.UpdateDeleteIndex;
FFonts.UpdateDeleteIndex;
if FFormats.Count > DEFAULT_FORMAT then
FDefaultFormat := FFormats[DEFAULT_FORMAT]
else
FDefaultFormat := FFormats[0];
GetCommonSheetData;
FRecords.PostCheck;
List := TList.Create;
try
FMSOPictures.GetBlipIds(List);
for i := 0 to FSheets.Count - 1 do begin
FSheets[i]._Int_EscherDrawing.AssignBlipIds(List);
FSheets[i].AfterFileRead;
end;
for i := 0 to FSheetCharts.Count - 1 do begin
if FSheetCharts[i].Drawing <> Nil then
FSheetCharts[i].Drawing.AssignBlipIds(List);
end;
finally
List.Free;
end;
{$ifdef SHAREWARE}
for i := 0 to FSheets.Count - 1 do
FSheets[i].AsString[0,0] := 'XLSReadWriteII Copyright(c) 2006 Axolot Data';
{$endif}
end;
procedure TXLSReadWriteII2.Write;
begin
WriteToStream(Nil);
end;
procedure TXLSReadWriteII2.WriteToStream(Stream: TStream);
var
i: integer;
XLSWrite: TXLSWriteII;
begin
if FVersion in [xvExcel21,xvExcel30] then
ShowMessage('Can not write Excel 2.1/3.0 files');
{$ifdef SHAREWARE}
for i := 0 to Sheets.Count - 1 do
FSheets[i].AsString[0,0] := 'XLSReadWriteII Copyright(c) 2006 Axolot Data';
{$endif}
FAborted := False;
if Assigned(FProgressEvent) then begin
FProgressEvent(Self,0);
FCellCount := 0;
FProgressCount := 0;
for i := 0 to FSheets.Count - 1 do
Inc(FCellCount,FSheets[i]._Int_Records.Count);
end;
SetCommonSheetData;
FFormulaHandler.ExternalNames.UpdateIntSupbooks(FSheets.Count);
// FMSOPictures.ResetBlipRefCount;
for i := 0 to FSheets.Count - 1 do
FSheets[i]._Int_EscherDrawing.SetBlipRefCount;
XLSWrite := TXLSWriteII.Create(Self);
try
if FVersion > xvExcel40 then
XLSWrite.WriteToStream(Stream)
else
XLSWrite.WriteToStream40(Stream);
finally
XLSWrite.Free;
end;
if Assigned(FProgressEvent) then
FProgressEvent(Self,100);
end;
procedure TXLSReadWriteII2.Abort;
begin
Clear;
FAborted := True;
end;
function TXLSReadWriteII2.Aborted: boolean;
begin
Result := FAborted;
end;
procedure TXLSReadWriteII2.AddNumberFormat(Format: string; Index: integer);
begin
FFormats.NumberFormats.AddSorted(Format,Index,1);
end;
function TXLSReadWriteII2.MaxRowCount: integer;
begin
Result := MAXROW;
end;
function TXLSReadWriteII2.GetNameValue(Index,Col,Row: integer): TFormulaValue;
var
i: integer;
begin
i := FFormulaHandler.ExternalNames.IsSelf(Index);
if i = $FFFF then
FVSetError(Result,errNA)
else if i > FSheets.Count then
raise Exception.Create('Sheet index out of range')
else if i >= 0 then
Result := FSheets[i].AsFormulaValue[Col,Row]
else
Result := FFormulaHandler.ExternalNames.GetValue(Index,Col,Row);
end;
function TXLSReadWriteII2.GetExternNameValue(NameIndex, SheetIndex: integer): TFormulaValue;
begin
Result := FFormulaHandler.ExternalNames.GetNameValue(NameIndex,SheetIndex);
end;
procedure TXLSReadWriteII2.CopyCells(SrcSheet, Col1, Row1, Col2, Row2, DestSheet, DestCol, DestRow: integer; CopyOptions: TCopyCellsOptions);
var
i,C,R: integer;
RCSrc,RCDst: longword;
Cell: TCell;
Cells: TList;
begin
if (SrcSheet = DestSheet) and (Col1 = DestCol) and (Row1 = DestRow) then
Exit;
NormalizeArea(Col1, Row1, Col2, Row2);
Cells := TList.Create;
try
if ccoCopyValues in CopyOptions then begin
if (Col1 = 0) and (Col2 = MAXCOL) and (Row1 = 0) and (Row2 = MAXROW) then begin
FSheets[SrcSheet]._Int_Cells.BeginIterate;
repeat
Cell := FSheets[SrcSheet]._Int_Cells.GetNext;
if Cell <> Nil then
Cells.Add(Cell.MakeCopy);
until (Cell = Nil);
end
else begin
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do begin
if FSheets[SrcSheet]._Int_Cells[ColRowToRC(C,R)] <> Nil then
Cells.Add(FSheets[SrcSheet]._Int_Cells[ColRowToRC(C,R)].MakeCopy);
end;
end;
end;
RCSrc := ColRowToRC(Col1,Row1);
RCDst := ColRowToRC(DestCol,DestRow);
for i := 0 to Cells.Count - 1 do begin
TCell(Cells[i]).RowCol := (TCell(Cells[i]).RowCol - RCSrc) + RCDst;
FSheets[DestSheet]._Int_Cells.CellsNotChangeFmt[TCell(Cells[i]).RowCol] := Cells[i];
if (ccoAdjustCells in CopyOptions) and (FSheets[DestSheet]._Int_Cells[TCell(Cells[i]).RowCol] is TFormulaCell) then
AdjustCell(FVersion = xvExcel97,TFormulaCell(Cells[i]).PTGS,TFormulaCell(Cells[i]).FormulaSize,DestCol - Col1,DestRow - Row1,ccoLockStartRow in CopyOptions,ccoForceAdjust in CopyOptions);
end;
end;
if DestSheet = SrcSheet then begin
if ccoCopyShapes in CopyOptions then
FSheets[DestSheet]._Int_EscherDrawing.Copy(Col1, Row1, Col2, Row2, DestCol, DestRow);
if ccoCopyCondFmt in CopyOptions then
FSheets[DestSheet].ConditionalFormats.CopyLocal(Col1, Row1, Col2, Row2, DestCol, DestRow);
if ccoCopyValidations in CopyOptions then
FSheets[DestSheet].Validations.CopyLocal(Col1, Row1, Col2, Row2, DestCol, DestRow);
if ccoCopyMerged in CopyOptions then
FSheets[DestSheet].MergedCells.Copy(Col1, Row1, Col2, Row2,DestCol - Col1,DestRow - Row1);
end
else begin
if ccoCopyShapes in CopyOptions then begin
Cells.Clear;
FSheets[SrcSheet]._Int_EscherDrawing.CopyList(Cells,Col1, Row1, Col2, Row2);
FSheets[DestSheet]._Int_EscherDrawing.InsertList(Cells,DestCol,DestRow);
end;
if ccoCopyCondFmt in CopyOptions then begin
Cells.Clear;
FSheets[SrcSheet].ConditionalFormats.CopyList(Cells,Col1, Row1, Col2, Row2);
FSheets[DestSheet].ConditionalFormats.InsertList(Cells,Col1, Row1, Col2, Row2,DestCol,DestRow);
end;
if ccoCopyValidations in CopyOptions then begin
Cells.Clear;
FSheets[SrcSheet].Validations.CopyList(Cells,Col1, Row1, Col2, Row2);
FSheets[DestSheet].Validations.InsertList(Cells,Col1, Row1, Col2, Row2,DestCol,DestRow);
end;
if ccoCopyMerged in CopyOptions then begin
Cells.Clear;
FSheets[SrcSheet].MergedCells.CopyList(Cells,Col1, Row1, Col2, Row2);
FSheets[DestSheet].MergedCells.InsertList(Cells,Col1, Row1, Col2, Row2,DestCol,DestRow);
end;
end;
finally
Cells.Free;
end;
end;
procedure TXLSReadWriteII2.MoveCells(SrcSheet, Col1, Row1, Col2, Row2, DestSheet, DestCol, DestRow: integer; CopyOptions: TCopyCellsOptions);
var
i,C,R: integer;
RCSrc,RCDst: longword;
Cell: TCell;
Cells: TList;
begin
if (SrcSheet = DestSheet) and (Col1 = DestCol) and (Row1 = DestRow) then
Exit;
NormalizeArea(Col1, Row1, Col2, Row2);
Cells := TList.Create;
try
if ccoCopyValues in CopyOptions then begin
if (Col1 = 0) and (Col2 = MAXCOL) and (Row1 = 0) and (Row2 = MAXROW) then begin
FSheets[SrcSheet]._Int_Cells.BeginIterate;
repeat
Cell := FSheets[SrcSheet]._Int_Cells.GetNext;
if Cell <> Nil then begin
Cells.Add(Cell.MakeCopy);
FSheets[SrcSheet]._Int_Cells[ColRowToRC(C,R)].Free;
FSheets[SrcSheet]._Int_Cells.SetNil(Cell.RowCol);
end;
until (Cell = Nil);
end
else begin
FSheets[SrcSheet]._Int_Cells.BeginIterate;
Cell := FSheets[SrcSheet]._Int_Cells.GetNext;
while Cell <> Nil do begin
SplitRC(Cell.RowCol,C,R);
if (C >= Col1) and (R >= Row1) and (C <= Col2) and (R <= Row2) then begin
Cells.Add(FSheets[SrcSheet]._Int_Cells[ColRowToRC(C,R)].MakeCopy);
FSheets[SrcSheet]._Int_Cells[ColRowToRC(C,R)].Free;
FSheets[SrcSheet]._Int_Cells.SetNil(ColRowToRC(C,R));
end;
Cell := FSheets[SrcSheet]._Int_Cells.GetNext;
end;
{
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do begin
if FSheets[SrcSheet].StorageCells[ColRowToRC(C,R)] <> Nil then begin
Cells.Add(FSheets[SrcSheet].StorageCells[ColRowToRC(C,R)].MakeCopy);
FSheets[SrcSheet].StorageCells.SetNil(ColRowToRC(C,R));
end;
end;
end;
}
end;
RCSrc := ColRowToRC(Col1,Row1);
RCDst := ColRowToRC(DestCol,DestRow);
for i := 0 to Cells.Count - 1 do begin
TCell(Cells[i]).RowCol := (TCell(Cells[i]).RowCol - RCSrc) + RCDst;
FSheets[DestSheet]._Int_Cells.CellsNotChangeFmt[TCell(Cells[i]).RowCol] := Cells[i];
if (ccoAdjustCells in CopyOptions) and (FSheets[DestSheet]._Int_Cells[TCell(Cells[i]).RowCol] is TFormulaCell) then
AdjustCell(FVersion = xvExcel97,TFormulaCell(Cells[i]).PTGS,TFormulaCell(Cells[i]).FormulaSize,DestCol - Col1,DestRow - Row1,ccoLockStartRow in CopyOptions,ccoForceAdjust in CopyOptions);
end;
end;
// TODO: Can only move shapes on same sheet.
if DestSheet = SrcSheet then begin
if ccoCopyShapes in CopyOptions then
FSheets[DestSheet]._Int_EscherDrawing.Move(Col1, Row1, Col2, Row2, DestCol, DestRow);
if ccoCopyCondFmt in CopyOptions then
FSheets[DestSheet].ConditionalFormats.MoveLocal(Col1, Row1, Col2, Row2, DestCol, DestRow);
if ccoCopyValidations in CopyOptions then
FSheets[DestSheet].Validations.MoveLocal(Col1, Row1, Col2, Row2, DestCol, DestRow);
if ccoCopyMerged in CopyOptions then
FSheets[DestSheet].MergedCells.Move(Col1, Row1, Col2, Row2,DestCol - Col1,DestRow - Row1);
end
else begin
if ccoCopyShapes in CopyOptions then begin
Cells.Clear;
FSheets[SrcSheet]._Int_EscherDrawing.CopyList(Cells,Col1, Row1, Col2, Row2);
FSheets[DestSheet]._Int_EscherDrawing.InsertList(Cells,DestCol,DestRow);
FSheets[SrcSheet]._Int_EscherDrawing.DeleteList(Cells);
end;
if ccoCopyCondFmt in CopyOptions then begin
Cells.Clear;
FSheets[SrcSheet].ConditionalFormats.CopyList(Cells,Col1, Row1, Col2, Row2);
FSheets[DestSheet].ConditionalFormats.InsertList(Cells,Col1, Row1, Col2, Row2,DestCol,DestRow);
FSheets[SrcSheet].ConditionalFormats.DeleteList(Cells,Col1, Row1, Col2, Row2);
end;
if ccoCopyValidations in CopyOptions then begin
Cells.Clear;
FSheets[SrcSheet].Validations.CopyList(Cells,Col1, Row1, Col2, Row2);
FSheets[DestSheet].Validations.InsertList(Cells,Col1, Row1, Col2, Row2,DestCol,DestRow);
FSheets[SrcSheet].Validations.DeleteList(Cells,Col1, Row1, Col2, Row2);
end;
if ccoCopyMerged in CopyOptions then begin
Cells.Clear;
FSheets[SrcSheet].MergedCells.CopyList(Cells,Col1, Row1, Col2, Row2);
FSheets[DestSheet].MergedCells.InsertList(Cells,Col1, Row1, Col2, Row2,DestCol,DestRow);
FSheets[SrcSheet].MergedCells.DeleteList(Cells,Col1, Row1, Col2, Row2);
end;
end;
finally
Cells.Free;
end;
end;
procedure TXLSReadWriteII2.DeleteCells(Sheet, Col1, Row1, Col2, Row2: integer);
begin
FSheets[Sheet].DeleteCells(Col1, Row1, Col2, Row2);
end;
function TXLSReadWriteII2.GetDEVMODE: PDeviceModeW;
var
hDevMode,FPrinterHandle: THandle;
P: PDeviceModeW;
ADevice: PWideChar;
StubDevMode: TDeviceModeW;
sPrinter: string;
begin
if (Printer = Nil) or (Printer.Printers = Nil) or (Printer.Printers.Count <= 0) or (Printer.PrinterIndex < 0) then
FDevMode := Nil
else if FDevMode = Nil then begin
sPrinter := Printer.Printers[Printer.PrinterIndex];
if (sPrinter <> '') and OpenPrinter(PChar(sPrinter),FPrinterHandle, nil) then begin
GetMem(ADevice,64);
StringToWideChar(sPrinter,ADevice,64);
hDevMode := GlobalAlloc(GHND,DocumentPropertiesW(0, FPrinterHandle, ADevice, StubDevMode, StubDevMode, 0));
if hDevMode <> 0 then begin
P := GlobalLock(hDevMode);
if DocumentPropertiesW(0, FPrinterHandle, ADevice, P^, P^, DM_OUT_BUFFER) < 0 then
FDevMode := Nil
else begin
GetMem(FDevMode,P.dmSize + P.dmDriverExtra);
Move(P^,FDevMode^,P.dmSize + P.dmDriverExtra);
end;
GlobalUnlock(hDevMode);
GlobalFree(hDevMode);
end;
end;
end;
Result := FDevMode;
end;
function TXLSReadWriteII2.HasDEVMODE: boolean;
begin
Result := FDevMode <> Nil;
end;
function TXLSReadWriteII2.GetUserName: string;
begin
Result := FRecords.WRITEACCESS;
end;
procedure TXLSReadWriteII2.SetUserName(const Value: string);
begin
FRecords.WRITEACCESS := Value;
end;
function TXLSReadWriteII2.GetBookProtected: boolean;
begin
Result := FRecords.WINDOWPROTECT;
end;
procedure TXLSReadWriteII2.SetBookProtected(const Value: boolean);
begin
FRecords.WINDOWPROTECT := Value;
end;
function TXLSReadWriteII2.GetBackup: boolean;
begin
Result := FRecords.BACKUP;
end;
procedure TXLSReadWriteII2.SetBackup(const Value: boolean);
begin
FRecords.BACKUP := Value;
end;
function TXLSReadWriteII2.GetRecomendReadOnly: boolean;
begin
if Length(FFILESHARING) < 2 then
Result := False
else
Result := PWordArray(FFILESHARING)[0] = 1;
end;
function TXLSReadWriteII2.GetRefreshAll: boolean;
begin
Result := FRecords.REFRESHALL;
end;
procedure TXLSReadWriteII2.SetRecomendReadOnly(const Value: boolean);
var
Z: boolean;
i: integer;
begin
if Value then begin
if Length(FFILESHARING) < 2 then begin
SetLength(FFILESHARING,6);
FillChar(FFILESHARING[0],Length(FFILESHARING),#0);
end;
PWordArray(FFILESHARING)[0] := 1;
end
else begin
if Length(FFILESHARING) < 2 then
SetLength(FFILESHARING,0)
else begin
PWordArray(FFILESHARING)[0] := 0;
Z := True;
for i := 0 to High(FFILESHARING) do begin
if FFILESHARING[i] <> 0 then begin
Z := False;
Break;
end;
end;
if Z then
SetLength(FFILESHARING,0);
end;
end;
end;
procedure TXLSReadWriteII2.SetRefreshAll(const Value: boolean);
begin
FRecords.REFRESHALL := Value;
end;
function TXLSReadWriteII2.GetNameAsFloat(AName: string): double;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].AsFloat[Col1,Row1];
end;
procedure TXLSReadWriteII2.SetNameAsFloat(AName: string; const Value: double);
var
SheetIndex,Col1,Row1,Col2,Row2,C,R: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do
FSheets[SheetIndex].AsFloat[C,R] := Value;
end;
end;
function TXLSReadWriteII2.GetNameAsCell(AName: string): TCell;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].Cell[Col1,Row1];
end;
function TXLSReadWriteII2.GetNameAsBoolean(AName: string): boolean;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
Result := FSheets[SheetIndex].AsBoolean[Col1,Row1];
end;
function TXLSReadWriteII2.GetNameAsBoolFormulaValue(AName: string): boolean;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].AsBoolFormulaValue[Col1,Row1];
end;
function TXLSReadWriteII2.GetNameAsError(AName: string): TCellError;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].AsError[Col1,Row1];
end;
function TXLSReadWriteII2.GetNameAsFmtString(AName: string): WideString;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].AsFmtString[Col1,Row1];
end;
function TXLSReadWriteII2.GetNameAsFormula(AName: string): string;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].AsFormula[Col1,Row1];
end;
function TXLSReadWriteII2.GetNameAsNumFormulaValue(AName: string): double;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].AsNumFormulaValue[Col1,Row1];
end;
function TXLSReadWriteII2.GetNameAsStrFormulaValue(AName: string): WideString;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].AsStrFormulaValue[Col1,Row1];
end;
function TXLSReadWriteII2.GetNameAsString(AName: string): WideString;
var
SheetIndex,Col1,Row1,Col2,Row2: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2);
Result := FSheets[SheetIndex].AsString[Col1,Row1];
end;
procedure TXLSReadWriteII2.SetNameAsBoolean(AName: string; const Value: boolean);
var
SheetIndex,Col1,Row1,Col2,Row2,C,R: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do
FSheets[SheetIndex].AsBoolean[C,R] := Value;
end;
end;
procedure TXLSReadWriteII2.SetNameAsBoolFormulaValue(AName: string; const Value: boolean);
var
SheetIndex,Col1,Row1,Col2,Row2,C,R: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do
FSheets[SheetIndex].AsBoolFormulaValue[C,R] := Value;
end;
end;
procedure TXLSReadWriteII2.SetNameAsError(AName: string; const Value: TCellError);
var
SheetIndex,Col1,Row1,Col2,Row2,C,R: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do
FSheets[SheetIndex].AsError[C,R] := Value;
end;
end;
procedure TXLSReadWriteII2.SetNameAsFormula(AName: string; const Value: string);
var
SheetIndex,Col1,Row1,Col2,Row2,C,R: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do
FSheets[SheetIndex].AsFormula[C,R] := Value;
end;
end;
procedure TXLSReadWriteII2.SetNameAsNumFormulaValue(AName: string; const Value: double);
var
SheetIndex,Col1,Row1,Col2,Row2,C,R: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do
FSheets[SheetIndex].AsNumFormulaValue[C,R] := Value;
end;
end;
procedure TXLSReadWriteII2.SetNameAsStrFormulaValue(AName: string; const Value: WideString);
var
SheetIndex,Col1,Row1,Col2,Row2,C,R: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do
FSheets[SheetIndex].AsStrFormulaValue[C,R] := Value;
end;
end;
procedure TXLSReadWriteII2.SetNameAsString(AName: string; const Value: WideString);
var
SheetIndex,Col1,Row1,Col2,Row2,C,R: integer;
begin
FFormulaHandler.GetNameRef(AName,SheetIndex,Col1,Row1,Col2,Row2,True);
for R := Row1 to Row2 do begin
for C := Col1 to Col2 do
FSheets[SheetIndex].AsString[C,R] := Value;
end;
end;
function TXLSReadWriteII2.GetVersionNumber: string;
begin
Result := CurrentVersionNumber;
{$ifdef SHAREWARE}
Result := Result + 'a';
{$endif}
end;
function TXLSReadWriteII2.GetWeakPassword: string;
var
P: word;
Chars,S: string;
i,j,k: integer;
function MakeWeakPassword(S: string): word;
var
C,T: word;
i: integer;
begin
Result := 0;
S := Copy(S,1,15);
for i := 1 to Length(S) do begin
T := Byte(S[i]);
C := ((T shl i) + (T shr (15 - i))) and $7FFF;
Result := Result xor C;
end;
Result := Result xor Length(S) xor $CE4B;
end;
begin
Result := '';
P := FRecords.PASSWORD;
if P = 0 then
Exit;
Chars := 'abcdefghijklmnopqrstuwvxyzABCDEFGHIJKLMNOPQRSTUWVXYZ0123456789_';
Randomize;
for k := 1 to 1000000 do begin
i := Random(15) + 1;
SetLength(S,i);
for j := 1 to i do
S[j] := Chars[Random(Length(Chars)) + 1];
if P = MakeWeakPassword(S) then begin
Result := S;
Exit;
end;
end;
end;
procedure TXLSReadWriteII2.SetVerionNumber(const Value: string);
begin
//
end;
procedure TXLSReadWriteII2.FormulaHandlerSheetName(Name: WideString; var Index,Count: integer);
var
Sheet: TSheet;
begin
Sheet := FSheets.SheetByName(Name);
if Sheet = Nil then begin
Index := -1;
Count := 0;
end
else begin
Index := Sheet.Index;
Count := FSheets.Count;
end;
end;
function TXLSReadWriteII2.FormulaHandlerSheetData(DataType: TSheetDataType; SheetIndex, Col, Row: integer): WideString;
begin
case DataType of
sdtName:
Result := FSheets[SheetIndex].Name;
sdtCell:
Result := FSheets[SheetIndex].AsString[Col,Row];
end;
end;
function TXLSReadWriteII2.GetInternalNames: TInternalNames;
begin
Result := FFormulaHandler.InternalNames;
end;
procedure TXLSReadWriteII2.SetInternalNames(const Value: TInternalNames);
begin
end;
procedure TXLSReadWriteII2.Calculate;
var
i: integer;
begin
for i := 0 to FSheets.Count - 1 do
FSheets[i].CalculateSheet;
end;
procedure TXLSReadWriteII2.BeginUpdate;
begin
FSST.BeginUpdate;
end;
procedure TXLSReadWriteII2.EndUpdate;
begin
FSST.EndUpdate;
end;
procedure TXLSReadWriteII2.CopyColumns(SrcSheet, Col1, Col2, DestSheet, DestCol: integer; DoCopyCells: boolean = True);
var
List: TList;
begin
if SrcSheet = DestSheet then
FSheets[SrcSheet].Columns.CopyColumns(Col1,Col2,DestCol)
else begin
List := TList.Create;
try
FSheets[SrcSheet].Columns.CopyList(List,Col1,Col2);
FSheets[DestSheet].Columns.InsertList(List,DestCol - Col1,DestCol,Col2 - Col2 + 1);
finally
List.Free;
end;
end;
if DoCopyCells then
CopyCells(SrcSheet,Col1,0,Col2,MAXROW,DestSheet,DestCol,0);
end;
procedure TXLSReadWriteII2.CopyRows(SrcSheet, Row1, Row2, DestSheet, DestRow: integer; DoCopyCells: boolean = True);
var
List: TList;
begin
if SrcSheet = DestSheet then
FSheets[SrcSheet].Rows.CopyRows(Row1,Row2,DestRow)
else begin
List := TList.Create;
try
FSheets[SrcSheet].Rows.CopyList(List,Row1,Row2);
FSheets[DestSheet].Rows.InsertList(List,DestRow - Row1,DestRow,Row2 - Row1 + 1);
finally
List.Free;
end;
end;
if DoCopyCells then
CopyCells(SrcSheet,0,Row1,MAXCOL,Row2,DestSheet,0,DestRow);
end;
procedure TXLSReadWriteII2.DeleteColumns(Sheet, Col1, Col2: integer);
begin
FSheets[Sheet].DeleteColumns(Col1,Col2);
FFormulaHandler.DeleteColumns(Sheet,Col1,Col2);
// FSheets[Sheet].Columns.DeleteColumns(Col1,Col2);
end;
procedure TXLSReadWriteII2.DeleteRows(Sheet, Row1, Row2: integer);
begin
FSheets[Sheet].DeleteRows(Row1,Row2);
FFormulaHandler.DeleteRows(Sheet,Row1,Row2);
// FSheets[Sheet].Rows.DeleteRows(Row1,Row2);
end;
procedure TXLSReadWriteII2.MoveColumns(SrcSheet, Col1, Col2, DestSheet, DestCol: integer; DoMoveCells: boolean = True);
var
List: TList;
begin
if SrcSheet = DestSheet then
FSheets[SrcSheet].Columns.MoveColumns(Col1,Col2,DestCol)
else begin
List := TList.Create;
try
FSheets[SrcSheet].Columns.CopyList(List,Col1,Col2);
FSheets[DestSheet].Columns.InsertList(List,DestCol - Col1,DestCol,Col2 - Col1 + 1);
FSheets[SrcSheet].Columns.DeleteColumns(Col1,Col2);
finally
List.Free;
end;
end;
if DoMoveCells then
MoveCells(SrcSheet,Col1,0,Col2,MAXROW,DestSheet,DestCol,0);
end;
procedure TXLSReadWriteII2.MoveRows(SrcSheet, Row1, Row2, DestSheet, DestRow: integer; DoMoveCells: boolean = True);
var
List: TList;
begin
if SrcSheet = DestSheet then
FSheets[SrcSheet].Rows.MoveRows(Row1,Row2,DestRow)
else begin
List := TList.Create;
try
FSheets[SrcSheet].Rows.CopyList(List,Row1,Row2);
FSheets[DestSheet].Rows.InsertList(List,DestRow - Row1,DestRow,Row2 - Row1 + 1);
FSheets[SrcSheet].Rows.DeleteRows(Row1,Row2);
finally
List.Free;
end;
end;
if DoMoveCells then
MoveCells(SrcSheet,0,Row1,MAXCOL,Row2,DestSheet,0,DestRow);
end;
procedure TXLSReadWriteII2.ClearColumns(Sheet, Col1, Col2: integer);
begin
FSheets[Sheet].Columns.ClearColumns(Col1,Col2);
FSheets[Sheet].DeleteCells(Col1,0,Col2,MAXROW);
end;
procedure TXLSReadWriteII2.ClearRows(Sheet, Row1, Row2: integer);
begin
FSheets[Sheet].Rows.ClearRows(Row1,Row2);
end;
procedure TXLSReadWriteII2.InsertColumns(Sheet, Col, ColCount: integer);
begin
FSheets[Sheet].InsertColumns(Col,ColCount);
FFormulaHandler.InsertColumns(Sheet,Col,ColCount);
// FSheets[Sheet].Columns.InsertColumns(Col,ColCount);
// If MoveCells is executed, cells are move twice.
// But I don't remember why it ever was included. Check this carefully
// if there are any problems.
// MoveCells(Sheet,Col,0,MAXCOL,MAXROW,Sheet,Col + ColCount,0);
end;
procedure TXLSReadWriteII2.InsertRows(Sheet, Row, RowCount: integer);
begin
FSheets[Sheet].InsertRows(Row,RowCount);
FFormulaHandler.InsertRows(Sheet,Row,RowCount);
// FSheets[Sheet].Rows.InsertRows(Row,RowCount);
// If MoveCells is executed, cells are move twice.
// But I don't remember why it ever was included. Check this carefully
// if there are any problems.
// MoveCells(Sheet,0,Row,MAXCOL,MAXROW,Sheet,0,Row + RowCount);
end;
procedure TXLSReadWriteII2.CopySheet(SrcSheet, DestSheet: integer);
begin
if SrcSheet <> DestSheet then begin
Sheets[DestSheet].ClearWorksheet;
Sheets[DestSheet].Assign(Sheets[SrcSheet]);
CopyColumns(SrcSheet,0,MAXCOL,DestSheet,0,False);
CopyRows(SrcSheet,0,MAXROW,DestSheet,0,False);
CopyCells(SrcSheet,0,0,MAXCOL,MAXROW,DestSheet,0,0);
end;
end;
procedure TXLSReadWriteII2.WrittenNCells;
var
V: double;
Last: integer;
begin
if FCellCount > 0 then begin
V := 100 / FCellCount;
Last := Round(FProgressCount * V);
Inc(FProgressCount,100);
if Round(FProgressCount * V) <> Last then
FProgressEvent(Self,Round(FProgressCount * V));
end;
Application.ProcessMessages;
end;
procedure TXLSReadWriteII2.SetStrFALSE(const Value: WideString);
begin
G_StrFALSE := Value;
end;
procedure TXLSReadWriteII2.SetStrTRUE(const Value: WideString);
begin
G_StrTRUE := Value;
end;
procedure TXLSReadWriteII2.BeginFindText;
var
i: integer;
begin
for i := 0 to FSheets.Count - 1 do
FSheets[i].BeginFindText;
FCurrFindSheet := 0;
end;
function TXLSReadWriteII2.FindText(Text: WideString; CaseInsensitive: boolean): boolean;
begin
while FCurrFindSheet < FSheets.Count do begin
Result := FSheets[FCurrFindSheet].FindText(Text,CaseInsensitive);
if Result then
Exit;
Inc(FCurrFindSheet);
end;
Result := False;
end;
function TXLSReadWriteII2.GetFILESHARING(PBuf: PByteArray): integer;
begin
Move(FFILESHARING[0],PBuf^,Length(FFILESHARING));
Result := Length(FFILESHARING);
end;
procedure TXLSReadWriteII2.GetFindData(var Sheet,Col, Row, TextPos: integer; var Text: WideString);
begin
FSheets[FCurrFindSheet].GetFindData(Col, Row, TextPos,Text);
Sheet := FCurrFindSheet;
end;
function TXLSReadWriteII2.GetPalette(Index: integer): TColor;
begin
if (Index < 0) or (Index > High(ExcelColorPalette)) then
raise Exception.Create('Palette index out of range');
Result := ExcelColorPalette[Index];
end;
procedure TXLSReadWriteII2.SetPalette(Index: integer; const Value: TColor);
begin
if (Index < 8) or (Index > High(ExcelColorPalette)) then
raise Exception.Create('Palette index out of range');
ExcelColorPalette[Index] := Value;
end;
function TXLSReadWriteII2.GetSheet(Index: integer): TSheet;
begin
Result := FSheets[Index];
end;
function TXLSReadWriteII2.GetStrFALSE: WideString;
begin
Result := G_StrFALSE;
end;
function TXLSReadWriteII2.GetStrTRUE: WideString;
begin
Result := G_StrTRUE;
end;
procedure TXLSReadWriteII2.InternalNameDeleted(Sender: TObject; Delta: integer);
var
i: integer;
begin
for i := 0 to FSheets.Count - 1 do
FSheets[i].NameIndexChanged(Delta);
end;
end.
|
unit U_StoredProceduresInterface;
interface
uses Data.Win.ADODB, Data.DB, classes, U_User, graphics, SysUtils ;
type
TMessageList = TList;
TMessageInfo = class
private
FID: Integer;
FLine: String;
FSender: Integer;
FReciver: Integer;
Fdate: TDate;
Fstate: Boolean;
procedure SetID (value:integer);
procedure SetLine (value: String);
Procedure SetSender (value: Integer);
procedure SetReciver (value: Integer);
procedure Setdate (value: TDate);
procedure SetState (value: boolean);
public
constructor create;
procedure SetValues (_id: integer; _line: String; _sender:integer;
_reciver: Integer; _date: TDate; _state:boolean);
published
property ID: Integer read FID write SetID;
property Line: String read FLine write SetLine;
property Sender: Integer read FSender write SetSender;
property Reciver: Integer read FReciver write SetReciver;
property Date: TDate read FDate write Setdate;
property State: Boolean read FState write SetState;
end;
///DB StoredProcedure Interfaces
function UserExist(ActualConnection:TADOConnection;_user: String; _pass: String): integer;
function MessageReading (ActualConnection:TADOConnection;_User: integer; _User2: integer): TMessageList;
function MessageUnReading (ActualConnection:TADOConnection;_User: integer; _User2: integer): TMessageList;
function GetAllMessage (ActualConnection:TADOConnection;_User: integer; _User2: integer): TMessageList;
function GetMessageInfo (ActualConnection:TADOConnection;_MessageID: Integer): TMessageInfo;
function GetUserInfo (ActualConnection:TADOConnection;_User: integer): TUser;
function AddUser (ActualConnection:TADOConnection;_nick: String; _pass: String; _Avatar: TBitmap; _email:string) : integer;
function GetContactList (ActualConnection: TADOConnection; _UserID:integer): TContactList;
function InsertMessage (ActualConnection: TADOConnection; _Sender: integer; _Reciver:Integer; Msg: String): Integer;
function GetAllMessageEx (ActualConnection: TADOConnection; _Sender: Integer; _Reciver:Integer): TMessageList;
implementation
////////////////////////////////////////////////////////////////////////////////
/////////// TMASSAGEINFO IMPLEMENTATIONS
////////////////////////////////////////////////////////////////////////////////
procedure TMessageInfo.SetID (value:integer);
begin
self.FID:= value;
end;
procedure TMessageInfo.SetLine (value: String);
begin
self.FLine:= Value;
end;
Procedure TMessageInfo.SetSender (value: Integer);
Begin
Self.FSender:= value;
End;
procedure TMessageInfo.SetReciver (value: Integer);
Begin
Self.FReciver:= value;
End;
procedure TMessageInfo.Setdate (value: TDate);
Begin
Self.Fdate:= value;
End;
procedure TMessageInfo.SetState (value: boolean);
Begin
Self.FState:= value;
End;
procedure TMessageInfo.SetValues (_id: integer; _line: String; _sender:integer;
_reciver: Integer; _date: TDate; _state:boolean);
begin
self.FID:= _id;
self.FLine:= _line;
self.FSender:= _sender;
self.FReciver:= _reciver;
self.Fdate:= _date;
self.Fstate:= _state;
end;
constructor TMessageInfo.create;
begin
SetValues(0,'',0,0,0,false);
end;
////////////////////////////////////////////////////////////////////////////////
/////////// DATA_BASE STORE_PROCEDURES IMPLEMENTATIOS
////////////////////////////////////////////////////////////////////////////////
function UserExist(ActualConnection:TADOConnection; _user: String; _pass: String): integer;
var
SP: TADOStoredProc;
_ID: integer;
begin
SP:=TADOStoredProc.Create(nil);
with SP do begin
//conecto
Connection:=ActualConnection;
//defino el sp a utilizar
ProcedureName:='UserExist';
//Limpio y refresco
Parameters.refresh;
//Asigno valores de entrada
Parameters.ParamByName('@_USER').Value:=_user;
Parameters.ParamByName('@_PASS').Value:=_pass;
Parameters.ParamByName('@_ID').Value:=_ID;
//Ejecuto el SP
ExecProc;
//Evaluo resultado
_ID:=Integer(Parameters.ParamByName('@_ID').Value);
result:= _ID;
end;
end;
function MessageReading (ActualConnection:TADOConnection;_User: integer; _User2: integer): TMessageList;
var
SP: TADOStoredProc;
list: TMessageList;
i: Integer;
begin
i:=0;
list:= TMessageList.Create;
SP:=TADOStoredProc.Create(nil);
with SP do begin
Connection:= ActualConnection;
ProcedureName:= 'Message_Readed';
Parameters.Refresh;
Parameters.ParamByName('@User').Value:= _User;
Parameters.ParamByName('@_User2').Value:=_User2;
ExecProc;
SP.Open;
while not eof do begin
List.Add(TMessageInfo.create);
TMessageInfo(List.Items[i]).ID:=FieldByName('Message_ID').Value;
TMessageInfo(List.Items[i]).Line:=FieldByName('Message').Value;
TMessageInfo(List.Items[i]).Sender:=FieldByName('Sender_ID').Value;
TMessageInfo(List.Items[i]).Reciver:=FieldByName('Reciver_ID').Value;
TMessageInfo(List.Items[i]).date:=TDate(FieldByName('Date').Value);
if (FieldByName('isSend').Value=0) then
TMessageInfo(List.Items[i]).state:= False
else
TMessageInfo(List.Items[i]).state:= true;
inc(i);
Next;
end;
result:=list;
end;
end;
function MessageUnReading (ActualConnection:TADOConnection;_User: integer; _User2: integer): TMessageList;
var
SP: TADOStoredProc;
list: TMessageList;
i: integer;
begin
list:= TMessageList.Create;
SP:=TADOStoredProc.Create(nil);
with SP do begin
i:=0;
Connection:= ActualConnection;
ProcedureName:= 'Message_Unreaded';
Parameters.Refresh;
Parameters.ParamByName('@User').Value:= _User;
Parameters.ParamByName('@_User2').Value:=_User2;
ExecProc;
SP.Open;
while not sp.eof do begin
List.Add(TMessageInfo.create);
TMessageInfo(List.Items[i]).ID:=FieldByName('Message_ID').Value;
TMessageInfo(List.Items[i]).Line:=FieldByName('Message').Value;
TMessageInfo(List.Items[i]).Sender:=FieldByName('Sender_ID').Value;
TMessageInfo(List.Items[i]).Reciver:=FieldByName('Reciver_ID').Value;
TMessageInfo(List.Items[i]).date:=TDate(FieldByName('Date').Value);
if (FieldByName('isSend').Value=0) then
TMessageInfo(List.Items[i]).state:= False
else
TMessageInfo(List.Items[i]).state:= true;
inc(i);
Next;
end;
end;
result:=list;
end;
function GetAllMessage (ActualConnection:TADOConnection;_User: integer; _User2: integer): TMessageList;
var
SP: TADOStoredProc;
list: TMessageList;
i: integer;
begin
list:= TMessageList.Create;
SP:=TADOStoredProc.Create(nil);
with SP do begin
i:=0;
Connection:= ActualConnection;
ProcedureName:= 'All_Message';
Parameters.Refresh;
Parameters.ParamByName('@User').Value:= _User;
Parameters.ParamByName('@_User2').Value:=_User2;
ExecProc;
SP.Open;
while not sp.eof do begin
List.Add(TMessageInfo.create);
TMessageInfo(List.Items[i]).ID:=FieldByName('Message_ID').Value;
TMessageInfo(List.Items[i]).Line:=FieldByName('Message').Value;
TMessageInfo(List.Items[i]).Sender:=FieldByName('Sender_ID').Value;
TMessageInfo(List.Items[i]).Reciver:=FieldByName('Reciver_ID').Value;
TMessageInfo(List.Items[i]).date:=TDate(FieldByName('Date').Value);
if (FieldByName('isSend').Value=0) then
TMessageInfo(List.Items[i]).state:= False
else
TMessageInfo(List.Items[i]).state:= true;
inc(i);
Next;
end;
end;
result:=list;
end;
function GetContactList (ActualConnection: TADOConnection; _UserID:integer): TContactList;
var
SP: TADOStoredProc;
list: TContactList;
aux: TUser;
i: integer;
begin
list:= TContactList.Create;
aux:= TUser.Create;
SP:= TADOStoredProc.Create(nil);
i:=0;
SP.Connection:= ActualConnection;
SP.ProcedureName:= 'Get_Contact_User';
SP.Parameters.Refresh;
SP.Parameters.ParamByName('@_UserID').Value:=_UserID;
SP.ExecProc;
SP.Open;
while not SP.Eof do begin
list.Add(TContact.Create(i));
Aux:= GetUserInfo(ActualConnection, SP.FieldByName('User_ID2').Value);
TContact(list.Items[i]).Nick:= StringReplace(aux.Nick, ' ','', [rfReplaceAll]);
TContact(list.Items[i]).Mail:= StringReplace (aux.Mail, ' ','', [rfReplaceAll]);
TContact(list.Items[i]).ConnectState:=aux.ConnectState;
// TContact(list.Items[i]).Avatar:=aux.Avatar;
TContact(list.Items[i]).UserId:=aux.UserId;
inc(i);
SP.Next;
end;
result:=list;
end;
function GetMessageInfo (ActualConnection:TADOConnection;_MessageID: Integer): TMessageInfo;
var
infoMsj: TMessageInfo;
SP: TADOStoredProc;
begin
SP:=TADOStoredProc.Create(nil);
SP.Connection:= ActualConnection;
SP.ProcedureName:= 'Get_Message_Info';
SP.Parameters.Refresh;
SP.Parameters.ParamByName('messageID').Value:= _MessageID;
SP.ExecProc;
SP.Open;
infoMsj:=TMessageInfo.create;
infoMsj.ID:=SP.FieldByName('Message_ID').Value;
infoMsj.Line:=SP.FieldByName('Message').Value;
infoMsj.Sender:=SP.FieldByName('Sender_ID').Value;
infoMsj.Reciver:=SP.FieldByName('Reciver_ID').Value;
infoMsj.date:=SP.FieldByName('Date').Value;
if (SP.FieldByName('isSend').Value=0) then
infoMsj.state:= False
else
infoMsj.state:= true;
result:=infoMsj;
end;
function GetUserInfo (ActualConnection:TADOConnection;_User: integer): TUser;
var
SP: TADOStoredProc;
usrInfo: TUser;
begin
usrInfo:= TUser.Create;
SP:=TADOStoredProc.Create(nil);
SP.Connection:= ActualConnection;
SP.ProcedureName:='Get_User_Info';
SP.Parameters.Refresh;
SP.Parameters.ParamByName('@user').Value:=_User;
SP.ExecProc;
SP.Open;
usrInfo.UserId := SP.FieldByName('User_ID').Value;
usrInfo.Nick := SP.FieldByName('Nick').Value;
//usrInfo.Avatar := SP.FieldByName('Avatar').Value;
usrInfo.Mail := SP.FieldByName('Email').Value;
case SP.FieldByName('Estado').Value of
0: usrInfo.ConnectState := CS_CONNECT;
1: usrInfo.ConnectState := CS_DISCONNECT;
2: usrInfo.ConnectState := CS_HIDDEN;
end;
result:= usrInfo;
end;
function AddUser (ActualConnection:TADOConnection;_nick: String; _pass: String; _Avatar: TBitmap; _email:string) : integer;
var
SP: TADOStoredProc;
_ra: integer;
begin
SP:=TADOStoredProc.Create(nil);
SP.Connection:= ActualConnection;
SP.ProcedureName:='Add_User';
SP.Parameters.Refresh;
SP.Parameters.ParamByName('@Nick').Value:= _nick;
SP.Parameters.ParamByName('@Pass').Value:= _pass;
// SP.Parameters.ParamByName('@Avatar').Value:= nil;
SP.Parameters.ParamByName('@email').Value:= _email;
SP.Parameters.ParamByName('@Row_Affected').Value:=_ra;
SP.ExecProc;
{ SP.Open;
_ra:= SP.FieldByName('@Row_Affected').Value;
result:=_ra;}
end;
function InsertMessage (ActualConnection: TADOConnection; _Sender: integer; _Reciver:Integer; Msg: String): Integer;
var
SP: TADOStoredProc;
begin
SP:= TADOStoredProc.Create(nil);
SP.Connection:= ActualConnection;
SP.ProcedureName:= 'Insert_Message';
SP.Parameters.Refresh;
SP.Parameters.ParamByName('@_Sender').Value:= _Sender;
SP.Parameters.ParamByName('@_Reciver').Value:= _Reciver;
SP.Parameters.ParamByName('@_Msj').Value:= Msg;
SP.ExecProc;
end;
function GetAllMessageEx (ActualConnection: TADOConnection; _Sender: Integer; _Reciver:Integer): TMessageList;
var
SP: TADOStoredProc;
list: TMessageList;
i: integer;
begin
SP:= TADOStoredProc.Create(nil);
SP.Connection:= ActualConnection;
SP.ProcedureName:= 'Get_All_MessageEx';
SP.Parameters.Refresh;
SP.Parameters.ParamByName('@_Sender').Value:= _Sender;
SP.Parameters.ParamByName('@_Reciver').Value:= _Reciver;
Sp.ExecProc;
Sp.Open;
list:= TMessageList.Create;
While not SP.eof do begin
List.Add(TMessageInfo.create);
TMessageInfo(List.Items[i]).ID:=SP.FieldByName('Message_ID').Value;
TMessageInfo(List.Items[i]).Line:=SP.FieldByName('Message').Value;
TMessageInfo(List.Items[i]).Sender:=SP.FieldByName('Sender_ID').Value;
TMessageInfo(List.Items[i]).Reciver:=SP.FieldByName('Reciver_ID').Value;
TMessageInfo(List.Items[i]).date:=TDate(SP.FieldByName('Date').Value);
if (SP.FieldByName('isSend').Value=0) then
TMessageInfo(List.Items[i]).state:= False
else
TMessageInfo(List.Items[i]).state:= true;
inc(i);
SP.Next;
end;
result:= list;
end;
end.
|
unit Unit1;
interface
uses
Winapi.Windows,
Winapi.Messages,
System.IniFiles,
System.Math,
System.SysUtils,
System.Variants,
System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.Imaging.Jpeg,
Vcl.StdCtrls,
Vcl.ExtCtrls,
Vcl.ComCtrls,
OpenGL1x,
GLWin32Viewer,
GLScene,
GLObjects,
GLMesh,
GLTexture,
GLVectorTypes,
GLVectorGeometry,
GLVectorFileObjects,
GLVectorLists,
GLMeshUtils,
GLCadencer,
GLCrossPlatform,
GLContext,
GLUtils,
GLGraph,
GLFile3DS,
GLFileTGA,
GLPolyhedron,
GLCoordinates,
GLBaseClasses;
type
TForm1 = class(TForm)
Scene: TGLScene;
Viewer: TGLSceneViewer;
GLCadencer: TGLCadencer;
CamH: TGLDummyCube;
CamV: TGLDummyCube;
Camera: TGLCamera;
AmbientLight: TGLLightSource;
GLIcosahedron1: TGLIcosahedron;
GLXYZGrid1: TGLXYZGrid;
procedure GLCadencerProgress(Sender: TObject;
const deltaTime, newTime: Double);
procedure ViewerMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ViewerMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
mx, my: Integer;
MousePos: TPoint;
NZ: Integer; // number of steps along Z axes
OffSet: Single;
IsLeftMouseDown, IsRightMouseDown: Boolean;
GLXYZGridArray: array of TGLXYZGrid;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
I: Integer;
begin
// SetLength(GLXYZGridArray, 100);
NZ := 10;
OffSet := (NZ div 2) * GLXYZGrid1.ZSamplingScale.Step;
for I := 0 to NZ - 1 do
begin
GLXYZGrid1.ZSamplingScale.Origin := I * 10 - OffSet;
// GLXYZGridArray[I].ZSamplingScale.Origin := I * 10 - OffSet;
end;
end;
procedure TForm1.GLCadencerProgress(Sender: TObject;
const deltaTime, newTime: Double);
var
deltax, deltay: Single;
pt: TPoint;
begin
if (IsLeftMouseDown or IsRightMouseDown) then
begin
GetCursorPos(pt);
deltax := (MousePos.X - pt.X) / 5;
deltay := (MousePos.Y - pt.Y) / 5;
if (pt.X <> MousePos.X) or (pt.Y <> MousePos.Y) then
SetCursorPos(MousePos.X, MousePos.Y);
end;
// rotate camera
if IsLeftMouseDown then
begin
CamH.TurnAngle := CamH.TurnAngle + deltax;
if CamH.TurnAngle >= 360 then
CamH.TurnAngle := CamH.TurnAngle - 360;
if CamH.TurnAngle < 0 then
CamH.TurnAngle := CamH.TurnAngle + 360;
// limit camera movement with upper hemisphere
if (CamV.PitchAngle - deltay < 89) and (CamV.PitchAngle - deltay > 0) then
CamV.PitchAngle := CamV.PitchAngle - deltay;
end
else
begin
// pan camera
if IsRightMouseDown then
begin
CamH.Move(-200 * deltay * deltaTime);
CamH.Slide(200 * deltax * deltaTime);
end;
end;
Viewer.Invalidate;
end;
procedure TForm1.ViewerMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (ssRight in Shift) then
IsRightMouseDown := True;
if (ssLeft in Shift) then
begin
mx := X;
my := Y;
IsLeftMouseDown := True;
end;
Screen.Cursor := crNone;
GetCursorPos(MousePos);
end;
procedure TForm1.ViewerMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = TMouseButton(mbLeft) then
IsLeftMouseDown := False;
if Button = TMouseButton(mbRight) then
IsRightMouseDown := False;
if not((ssLeft in Shift) or (ssRight in Shift)) then
Screen.Cursor := crDefault;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
SetLength(GLXYZGridArray, 0);
end;
procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
var
DistDelta: Single;
begin
with Camera do
begin
DistDelta := Power(1.1, WheelDelta / 240);
if (DistanceToTarget > 10) or (WheelDelta > 0) then
AdjustDistanceToTarget(DistDelta);
end;
end;
end.
|
PROGRAM Chess;
(* char 9 to int 9 => ord(char) - 49 == int *)
(* ist aber eingebaut *)
FUNCTION Length(s:STRING): BYTE;
BEGIN
Length := Ord(s[0]);
END;
TYPE
ChessFigureColor = (Black, White);
(* = 2bytes *)
ChessFigure = (None, Pawn, Bishop, Knight, Rook, Queen, King);
ChessBoardField = RECORD
figure: Chessfigure;
color: ChessFigureColor;
END;
ChessBoard = ARRAY['A'..'H', 1..8] OF ChessBoardField;
// ChessBoard = ARRAY['A'..'H'] OF ARRAY[1..8] OF ChessBoardField;
(* = 8 * 8 * 4 = 256 byte*)
VAR
board: ChessBoard;
(* erst hier wird das datensegment befüllt (reserviert) *)
i: 'A'..'H';
j: 1..8;
BEGIN
(* gesammtes Board löschen *)
FOR i:= Low(i) TO High(i) DO
FOR j:= Low(j) TO High(j) DO
board[i][j].figure := None;
(* Bauern aufstellen *)
FOR i:= Low(i) TO High(i) DO
BEGIN
board[i][2].figure := Pawn;
board[i][2].color := White;
board[i,7].figure := Pawn;
board[i,7].color := Black;
END;
board['A'][1].figure := Rook;
board['A',1].color := White;
END.
(* Synt. Sugar *)
(* 1. ][ ==> , *)
(* 2. ] OF ARRAY OF [ ==> , *) |
unit CatBase64;
{
Catarinka - Base64 encode/decode functions
Copyright (c) 2003-2017 Felipe Daragon
License: 3-clause BSD
See https://github.com/felipedaragon/catarinka/ for details
Base64 encode and decode functions by Lukas Gebauer (BSD license, included below)
}
interface
{$I Catarinka.inc}
uses
{$IFDEF DXE2_OR_UP}
{$IFDEF USECROSSVCL}
WinAPI.Windows,
{$ENDIF}
System.Classes, System.SysUtils;
{$ELSE}
Classes, SysUtils;
{$ENDIF}
function Base64Encode(const s: string): string;
function Base64Decode(const s: string): string;
function MemStreamToB64(m: TMemoryStream): String;
implementation
uses
CatStrings;
function MemStreamToB64(m: TMemoryStream): String;
begin
Result := Base64Encode(MemStreamToStr(m));
end;
// CONTRIBUTED ------------------------------------------------------------//
// Base64 encoder and decoder taken from Ararat Synapse's synacode.pas
{
| Copyright (c)1999-2007, Lukas Gebauer |
| All rights reserved. |
| |
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions are met: |
| |
| Redistributions of source code must retain the above copyright notice, this |
| list of conditions and the following disclaimer. |
| |
| Redistributions in binary form must reproduce the above copyright notice, |
| this list of conditions and the following disclaimer in the documentation |
| and/or other materials provided with the distribution. |
| |
| Neither the name of Lukas Gebauer nor the names of its contributors may |
| be used to endorse or promote products derived from this software without |
| specific prior written permission. |
| |
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR |
| ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
| DAMAGE. |
}
function Encode3to4(const Value, Table: AnsiString): AnsiString;
var
c: Byte;
n, l: integer;
count: integer;
DOut: array [0 .. 3] of Byte;
begin
SetLength(result, ((length(Value) + 2) div 3) * 4);
l := 1;
count := 1;
while count <= length(Value) do
begin
c := ord(Value[count]);
inc(count);
DOut[0] := (c and $FC) shr 2;
DOut[1] := (c and $03) shl 4;
if count <= length(Value) then
begin
c := ord(Value[count]);
inc(count);
DOut[1] := DOut[1] + (c and $F0) shr 4;
DOut[2] := (c and $0F) shl 2;
if count <= length(Value) then
begin
c := ord(Value[count]);
inc(count);
DOut[2] := DOut[2] + (c and $C0) shr 6;
DOut[3] := (c and $3F);
end
else
begin
DOut[3] := $40;
end;
end
else
begin
DOut[2] := $40;
DOut[3] := $40;
end;
for n := 0 to 3 do
begin
if (DOut[n] + 1) <= length(Table) then
begin
result[l] := Table[DOut[n] + 1];
inc(l);
end;
end;
end;
SetLength(result, l - 1);
end;
function Decode4to3Ex(const Value, Table: AnsiString): AnsiString;
var
x, y, lv: integer;
d: integer;
dl: integer;
c: Byte;
P: integer;
begin
lv := length(Value);
SetLength(result, lv);
x := 1;
dl := 4;
d := 0;
P := 1;
while x <= lv do
begin
y := ord(Value[x]);
if y in [33 .. 127] then
c := ord(Table[y - 32])
else
c := 64;
inc(x);
if c > 63 then
continue;
d := (d shl 6) or c;
Dec(dl);
if dl <> 0 then
continue;
result[P] := AnsiChar((d shr 16) and $FF);
inc(P);
result[P] := AnsiChar((d shr 8) and $FF);
inc(P);
result[P] := AnsiChar(d and $FF);
inc(P);
d := 0;
dl := 4;
end;
case dl of
1:
begin
d := d shr 2;
result[P] := AnsiChar((d shr 8) and $FF);
inc(P);
result[P] := AnsiChar(d and $FF);
inc(P);
end;
2:
begin
d := d shr 4;
result[P] := AnsiChar(d and $FF);
inc(P);
end;
end;
SetLength(result, P - 1);
end;
function Base64Encode(const s: string): string;
const
TableBase64 =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
begin
result := string(Encode3to4(AnsiString(s), TableBase64));
end;
function Base64Decode(const s: string): string;
const
ReTablebase64 = #$40 + #$40 + #$40 + #$40 + #$40 + #$40 + #$40 + #$40 + #$40 +
#$40 + #$3E + #$40 + #$40 + #$40 + #$3F + #$34 + #$35 + #$36 + #$37 + #$38 +
#$39 + #$3A + #$3B + #$3C + #$3D + #$40 + #$40 + #$40 + #$40 + #$40 + #$40 +
#$40 + #$00 + #$01 + #$02 + #$03 + #$04 + #$05 + #$06 + #$07 + #$08 + #$09 +
#$0A + #$0B + #$0C + #$0D + #$0E + #$0F + #$10 + #$11 + #$12 + #$13 + #$14 +
#$15 + #$16 + #$17 + #$18 + #$19 + #$40 + #$40 + #$40 + #$40 + #$40 + #$40 +
#$1A + #$1B + #$1C + #$1D + #$1E + #$1F + #$20 + #$21 + #$22 + #$23 + #$24 +
#$25 + #$26 + #$27 + #$28 + #$29 + #$2A + #$2B + #$2C + #$2D + #$2E + #$2F +
#$30 + #$31 + #$32 + #$33 + #$40 + #$40 + #$40 + #$40 + #$40 + #$40;
begin
result := string(Decode4to3Ex(AnsiString(s), ReTablebase64));
end;
// ------------------------------------------------------------------------//
end.
|
(*
-----------------------------------------------------------
Name: $File: //depot/Reporting/Mainline/sdk/VCL/Delphi/UCrpeClasses.pas $
Version: $Revision: #16 $
Last Modified Date: $Date: 2004/01/27 $
Copyright (c) 1995-2003 Crystal Decisions, Inc.
895 Emerson St., Palo Alto, California, USA 94301.
All rights reserved.
This file contains confidential, proprietary information, trade secrets and copyrighted expressions
that are the property of Crystal Decisions, Inc., 895 Emerson St., Palo Alto, California, USA 94301.
Any disclosure, reproduction, sale or license of all or any part of the information or expression
contained in this file is prohibited by California law and the United States copyright law, and may
be subject to criminal penalties.
If you are not an employee of Crystal Decisions or otherwise authorized in writing by Crystal Decisions
to possess this file, please contact Crystal Decisions immediately at the address listed above.
-----------------------------------------------------------
Crystal Reports VCL Component - Base Classes Unit
=================================================
Version : 10
Purpose : This is the base classes unit file of the Crystal Reports
Delphi VCL Component. It was split from the main UCrpe32
unit to avoid a problem with Delphi's debugger not being
able to trace into code units that were too large.
Supports : Delphi 7
*)
unit UCrpeClasses;
{$I UCRPEDEF.INC}
interface
uses Windows, Classes, Graphics, CRDynamic;
type
TComponentX = class(TComponent);
TCrFieldValueType = (fvUnknown, fvInt8s, fvInt8u, fvInt16s,
fvInt16u, fvInt32s, fvInt32u, fvNumber, fvCurrency, fvBoolean,
fvDate, fvTime, fvString, fvTransientMemo, fvPersistentMemo,
fvBlob, fvDateTime, fvBitmap, fvIcon, fvPicture, fvOle, fvGraph);
{Object Types}
TCrObjectType = (otUnknown, otField, otText, otLine, otBox, otSubreport,
otOle, otGraph, otCrossTab, otBlob, otMap, otOLAPCube);
TCrFieldObjectType = (oftNone, oftDatabase, oftFormula, oftSummary,
oftSpecialVar, oftGroupName, oftParameter, oftExpression, oftRunningTotal);
{Objects}
TCrLineStyle = (lsNone, lsSingle, lsDouble, lsDash, lsDot);
{HiliteCondition}
TCrHiliteRangeCondition = (hrcEqualTo, hrcNotEqualTo, hrcLessThan,
hrcLessThanOrEqualTo, hrcGreaterThan, hrcGreaterThanOrEqualTo,
hrcBetween, hrcNotBetween);
TCrHiliteBorderStyle = (hbsDefault, hbsNone, hbsSingleBox, hbsDoubleBox,
hbsSingleUnderline, hbsDoubleUnderline, hbsSingleOverline, hbsDoubleOverline,
hbsSingleBoxWithDoubleUnderline);
TCrHiliteFontStyle = (hfsDefault, hfsRegular, hfsItalic, hfsBold, hfsBoldItalic);
{Lookup Property Types}
TCrLookupString = string;
TCrLookupNumber = integer;
{Field Alignment}
TCrHorizontalAlignment = (haDefault, haLeft, haCenter, haRight,
haJustified, haDecimal);
{Format Enumerated Types for the FieldFormat properties}
{Number/Currency}
{Signed/Unsigned}
TCrNegativeFormat = (nfNone, nfLeading, nfTrailing, nfBracketed);
{Rounding}
TCrRoundingFormat = (rfTenBillionth, rfBillionth, rfHundredMillionth,
rfTenMillionth, rfMillionth, rfHundredThousandth, rfTenThousandth,
rfThousandth, rfHundredth, rfTenth, rfUnit, rfTen, rfHundred,
rfThousand, rfTenThousand, rfHundredThousand, rfMillion);
{Currency Symbol}
TCrCurrencySymbolFormat = (csfNone, csfFixed, csfFloating);
{Currency Symbol Placement}
TCrCurrencySymbolPosition = (cspLeadingInside, cspLeadingOutside,
cspTrailingInside, cspTrailingOutside);
{Boolean}
{Boolean Type}
TCrBooleanType = (TrueFalse, TF, YesNo, YN, OneZero);
{Date}
{Date Type}
TCrDateType = (dfWindowsLong, dfWindowsShort, dfUserDefined);
{Calendar Type}
TCrCalendarType = (ctGregorian, ctGregorianus, ctJapanese,
ctTaiwanese, ctKorean, ctHijri, ctThai, ctHebrew, ctGregorianMEFrench,
ctGregorianArabic, ctGregorianTransEnglish, ctGregorianTransFrench);
{Date Order}
TCrDateOrder = (doYMD, doDMY, doMDY);
{Year Format}
TCrYearFormat = (yfShort, yfLong, yfNone);
{Month Format}
TCrMonthFormat = (mfNumeric, mfLeadingZeroNumeric, mfShort,
mfLong, mfNone);
{Day Format}
TCrDayFormat = (dfNumeric, dfLeadingZeroNumeric, dfNone);
{Day of Week Typee}
TCrDayOfWeekType = (dwfShort, dwfLong, dwfNone);
{Day of Week Position}
TCrDayOfWeekPosition = (dwpLeading, dwpTrailing);
{Day of Week Enclosure}
TCrDayOfWeekEnclosure = (dweNone, dweParentheses, dweFWParentheses,
dweSquareBrackets, dweFWSquareBrackets);
{Date Era}
TCrDateEra = (deShort, deLong, deNone);
{Time}
{Time Base}
TCrTimeBase = (tf12Hour, tf24Hour);
{AM/PM Placement}
TCrAmPmPosition = (ampmBefore, ampmAfter);
{HourType, MinuteType, SecondType}
TCrTimeFormat = (tfNumeric, tfNoLeadingZero, tfNone);
{DateTime}
{DateTime Order}
TCrDateTimeOrder = (dtoDateTime, dtoTimeDate, dtoDate, dtoTime);
{Text}
{Text Interpretation}
TCrTextInterpretation = (tiNone, tiRTF, tiHTML);
{Line Spacing}
TCrLineSpacingType = (lsMultiple, lsExact);
{Text Rotation - in degrees}
TCrTextRotation = (trZero, tr90, tr270);
{FormatFormula Names}
TCrFormatFormulaName = (
{Number/Currency}
ffnSuppressIfZero, ffnNegativeFormat, ffnUseThousandsSeparators,
ffnUseLeadingZero, ffnDecimalPlaces, ffnRoundingFormat,
ffnCurrencySymbolFormat, ffnOneCurrencySymbolPerPage,
ffnCurrencySymbolPosition, ffnThousandSymbol, ffnDecimalSymbol,
ffnCurrencySymbol, ffnReverseSignForDisplay,
{FieldClipping}
ffnAllowFieldClipping,
{Boolean}
ffnBooleanType,
{Date}
ffnDateType, ffnDateOrder, ffnYearFormat, ffnMonthFormat,
ffnDayFormat, ffnFirstDateSeparator, ffnSecondDateSeparator, ffnDayOfWeekType,
ffnDayOfWeekSeparator, ffnDayOfWeekPosition, ffnDateEraFormat, ffnCalendarType,
ffnPrefixSeparator, ffnSuffixSeparator, ffnDayOfWeekEnclosure,
{Time}
ffnTimeBase, ffnAmPmPosition, ffnHourType, ffnMinuteType, ffnSecondType,
ffnHourMinSeparator, ffnMinSecSeparator, ffnAMString, ffnPMString,
{DateTime}
ffnDateTimeOrder, ffnDateTimeSeparator,
{Text - first 3 not used in 5.x}
ffnFirstLineIndent, ffnLeftIndent, ffnRightIndent, ffnMaxNLines,
ffnTextInterpretation {Text interpretation of string & memo database fields},
{Font}
ffnFontColor);
TCrpeBorder = class;
TCrpeFormatA = class;
TCrpeFormatC = class;
TCrpeFieldFormat = class;
TCrpeFieldObjectFormat = class;
TCrpeParagraphFormat = class;
TCrpeFormatFormulasA = class;
TCrpeFormatFormulasB = class;
TCrpeFont = class;
TCrpeHiliteConditions = class;
{------------------------------------------------------------------------------}
{ Class TCrpePersistent }
{ - same as TPersistent but with reference to TCrpe object }
{------------------------------------------------------------------------------}
TCrpePersistent = class(TPersistent)
private
protected
FSubClassList : TList;
published
public
Cx : TComponent; {Reference pointer: for internal use}
FIndex : integer;
Handle : DWord;
Parent : TCrpePersistent;
procedure PropagateCrpe (const Crpe: TComponent; const Par: TCrpePersistent);
procedure PropagateHandle (const NewHandle: DWord);
procedure PropagateIndex (const NewIndex: integer);
constructor Create;
destructor Destroy; override;
end; { Class TCrpePersistent }
{------------------------------------------------------------------------------}
{ Class TCrpeItem }
{ - same as TPersistent but defines an item class that belongs to a container }
{------------------------------------------------------------------------------}
TCrpeItem = class(TCrpePersistent)
private
protected
published
public
end; { Class TCrpeItem }
{------------------------------------------------------------------------------}
{ Class TCrpeObjectItem }
{ - base class for ObjectItemA, ObjectItemB, FieldObjectItem }
{------------------------------------------------------------------------------}
TCrpeObjectItem = class(TCrpeItem)
private
protected
FTop : LongInt;
FLeft : LongInt;
FWidth : LongInt;
FHeight : LongInt;
FSection : string;
FBorder : TCrpeBorder;
{Object specific}
procedure SetTop (const Value: LongInt);
procedure SetLeft (const Value: LongInt);
procedure SetWidth (const Value: LongInt);
procedure SetHeight (const Value: LongInt);
procedure SetSection (const Value: string);
{Border}
function GetBorder : TCrpeBorder;
{Internal}
function StatusIsGo (nIndex: integer): Boolean;
published
property Top : LongInt
read FTop
write SetTop;
property Left : LongInt
read FLeft
write SetLeft;
property Width : LongInt
read FWidth
write SetWidth;
property Height : LongInt
read FHeight
write SetHeight;
property Section : string
read FSection
write SetSection;
{Border}
property Border : TCrpeBorder
read GetBorder
write FBorder;
public
procedure Clear;
procedure Assign(Source: TPersistent); override;
constructor Create;
destructor Destroy; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeObjectItemA }
{ - base Item class for OleObjects, Graphs, CrossTabs, Pictures, }
{ Maps, OLAPCubes, Subreports }
{------------------------------------------------------------------------------}
TCrpeObjectItemA = class(TCrpeObjectItem)
private
protected
FFormat : TCrpeFormatA;
published
property Format : TCrpeFormatA
read FFormat
write FFormat;
public
procedure Clear;
procedure Assign(Source: TPersistent); override;
constructor Create;
destructor Destroy; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeObjectItemB }
{ - base Item class for TextObjects }
{------------------------------------------------------------------------------}
TCrpeObjectItemB = class(TCrpeObjectItem)
private
protected
FFormat : TCrpeFormatC;
FFont : TCrpeFont;
function GetFont : TCrpeFont;
procedure OnChangeFont (Sender: TObject);
published
property Format : TCrpeFormatC
read FFormat
write FFormat;
property Font : TCrpeFont
read GetFont
write FFont;
public
procedure Clear;
procedure Assign(Source: TPersistent); override;
constructor Create;
destructor Destroy; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFieldObjectItem }
{ - derived from ObjectItem class for all Field objects }
{------------------------------------------------------------------------------}
TCrpeFieldObjectItem = class(TCrpeObjectItem)
private
protected
{Read only}
FFieldName : string;
FFieldType : TCrFieldValueType;
FFieldLength : Word;
{Format & Font}
FFormat : TCrpeFieldObjectFormat;
FFont : TCrpeFont;
{Hilite Conditions}
FHiliteConditions : TCrpeHiliteConditions;
function GetFont : TCrpeFont;
procedure OnChangeFont (Sender: TObject);
{Dummy procedures so the property appears on the Object Inspector}
procedure SetFName (const Value: string);
procedure SetFType (const Value: TCrFieldValueType);
procedure SetFLength (const Value: Word);
published
property FieldName : string
read FFieldName
write SetFName;
property FieldType : TCrFieldValueType
read FFieldType
write SetFType
default fvUnknown;
property FieldLength : Word
read FFieldLength
write SetFLength
default 0;
property Format : TCrpeFieldObjectFormat
read FFormat
write FFormat;
property Font : TCrpeFont
read GetFont
write FFont;
property HiliteConditions : TCrpeHiliteConditions
read FHiliteConditions
write FHiliteConditions;
public
procedure SetFieldType(const FType: TCrFieldValueType);
procedure Clear;
procedure Assign(Source: TPersistent); override;
constructor Create;
destructor Destroy; override;
end; {TCrpeFieldObjectItem}
{------------------------------------------------------------------------------}
{ Class TCrpeContainer }
{ - Used as a base for container classes }
{------------------------------------------------------------------------------}
TCrpeContainer = class(TCrpePersistent)
private
protected
published
public
function Count: integer; virtual; abstract;
end; { Class TCrpeContainer }
{------------------------------------------------------------------------------}
{ Class TCrpeObjectContainer }
{ - Used as a base for Object container classes }
{------------------------------------------------------------------------------}
TCrpeObjectContainer = class(TCrpeContainer)
private
protected
FObjectType : TCrObjectType;
FFieldObjectType : TCrFieldObjectType;
published
public
end; { Class TCrpeObjectContainer }
{------------------------------------------------------------------------------}
{ Class TCrpeObjectContainerA }
{ - base Container class for OleObjects, Graphs, CrossTabs, Pictures, }
{ Maps, OLAPCubes, Subreports }
{------------------------------------------------------------------------------}
TCrpeObjectContainerA = class(TCrpeObjectContainer)
private
protected
FItem : TCrpeObjectItemA;
procedure SetIndex (nIndex: integer);
published
public
function Count: integer; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeObjectContainerB }
{ - base Container class for TextObjects }
{------------------------------------------------------------------------------}
TCrpeObjectContainerB = class(TCrpeObjectContainer)
private
protected
FItem : TCrpeObjectItemB;
procedure SetIndex (nIndex: integer);
published
public
function Count: integer; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFieldObjectContainer }
{ - base class for Field Objects that contain multiple items }
{------------------------------------------------------------------------------}
TCrpeFieldObjectContainer = class(TCrpeObjectContainer)
private
protected
FItem : TCrpeFieldObjectItem;
procedure SetIndex (nIndex: integer);
published
public
function Count: integer; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFormat }
{------------------------------------------------------------------------------}
TCrpeFormat = class(TCrpePersistent)
private
protected
{All Objects except Lines & Boxes}
FSuppress : Boolean;
FKeepTogether : Boolean;
FCloseBorder : Boolean;
FToolTip : string;
function StatusIsGo : Boolean;
published
function GetSuppress : Boolean; virtual; abstract;
procedure SetSuppress (const Value: Boolean); virtual; abstract;
function GetKeepTogether : Boolean; virtual; abstract;
procedure SetKeepTogether (const Value: Boolean); virtual; abstract;
function GetCloseBorder : Boolean; virtual; abstract;
procedure SetCloseBorder (const Value: Boolean); virtual; abstract;
function GetToolTip : string; virtual; abstract;
procedure SetToolTip (const Value: string); virtual; abstract;
property Suppress : Boolean
read GetSuppress
write SetSuppress
default False;
property KeepTogether : Boolean
read GetKeepTogether
write SetKeepTogether
default True;
property CloseBorder : Boolean
read GetCloseBorder
write SetCloseBorder
default True;
property ToolTip : string
read GetToolTip
write SetToolTip;
public
procedure Assign(Source: TPersistent); override;
procedure Clear; virtual;
constructor Create;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFormatA }
{ - used by OleObjects, Graphs, CrossTabs, Pictures }
{------------------------------------------------------------------------------}
TCrpeFormatA = class(TCrpeFormat)
private
protected
FFormulas : TCrpeFormatFormulasA;
published
function GetSuppress : Boolean; override;
procedure SetSuppress (const Value: Boolean); override;
function GetKeepTogether : Boolean; override;
procedure SetKeepTogether (const Value: Boolean); override;
function GetCloseBorder : Boolean; override;
procedure SetCloseBorder (const Value: Boolean); override;
function GetToolTip : string; override;
procedure SetToolTip (const Value: string); override;
property Formulas : TCrpeFormatFormulasA
read FFormulas
write FFormulas;
public
procedure Assign(Source: TPersistent); override;
procedure GetFormat;
procedure Clear; override;
constructor Create;
destructor Destroy; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFormatB }
{ - inherited by FormatC and FieldObjectFormat }
{------------------------------------------------------------------------------}
TCrpeFormatB = class(TCrpeFormat)
private
protected
{Internal}
FFieldType : TCrFieldValueType;
FFieldN : Smallint;
{Fields, Text Objects, Subreports}
FAlignment : TCrHorizontalAlignment;
FCanGrow : Boolean; {only applies to string/text fields}
FMaxNLines : integer;
FTextRotation : TCrTextRotation;
FSuppressIfDuplicated : Boolean;
{Format Formulas}
FFormulas : TCrpeFormatFormulasB;
published
function GetSuppress : Boolean; override;
procedure SetSuppress (const Value: Boolean); override;
function GetKeepTogether : Boolean; override;
procedure SetKeepTogether (const Value: Boolean); override;
function GetCloseBorder : Boolean; override;
procedure SetCloseBorder (const Value: Boolean); override;
function GetToolTip : string; override;
procedure SetToolTip (const Value: string); override;
function GetAlignment : TCrHorizontalAlignment;
procedure SetAlignment (const Value: TCrHorizontalAlignment);
function GetCanGrow : Boolean;
procedure SetCanGrow (const Value: Boolean);
function GetMaxNLines : integer;
procedure SetMaxNLines (const Value: integer);
function GetTextRotation : TCrTextRotation;
procedure SetTextRotation (const Value: TCrTextRotation);
function GetSuppressIfDuplicated : Boolean;
procedure SetSuppressIfDuplicated (const Value: Boolean);
property Alignment : TCrHorizontalAlignment
read GetAlignment
write SetAlignment;
property SuppressIfDuplicated : Boolean
read GetSuppressIfDuplicated
write SetSuppressIfDuplicated;
property CanGrow : Boolean
read GetCanGrow
write SetCanGrow;
property MaxNLines : integer
read GetMaxNLines
write SetMaxNLines
default 1;
property TextRotation : TCrTextRotation
read GetTextRotation
write SetTextRotation
default trZero;
property Formulas : TCrpeFormatFormulasB
read FFormulas
write FFormulas;
public
procedure SetFieldType(FType: TCrFieldValueType);
procedure Assign(Source: TPersistent); override;
procedure GetFormat;
procedure Clear; override;
constructor Create;
destructor Destroy; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFormatC }
{ - used by TextObjects }
{------------------------------------------------------------------------------}
TCrpeFormatC = class(TCrpeFormatB)
private
protected
FParagraph : TCrpeParagraphFormat;
published
property Paragraph : TCrpeParagraphFormat
read FParagraph
write FParagraph;
public
procedure Assign(Source: TPersistent); override;
procedure Clear; override;
constructor Create;
destructor Destroy; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFormatFormulas }
{------------------------------------------------------------------------------}
TCrpeFormatFormulas = class(TCrpePersistent)
private
FSuppress : TStrings;
FKeepTogether : TStrings;
FCloseBorder : TStrings;
FHyperLink : TStrings;
xFormula : TStrings;
protected
function StatusIsGo : Boolean;
function GetSuppress : TStrings; virtual; abstract;
procedure SetSuppress (const Value: TStrings); virtual; abstract;
function GetKeepTogether : TStrings; virtual; abstract;
procedure SetKeepTogether (const Value: TStrings); virtual; abstract;
function GetCloseBorder : TStrings; virtual; abstract;
procedure SetCloseBorder (const Value: TStrings); virtual; abstract;
function GetHyperLink : TStrings; virtual; abstract;
procedure SetHyperLink (const Value: TStrings); virtual; abstract;
published
property Suppress : TStrings
read GetSuppress
write SetSuppress;
property KeepTogether : TStrings
read GetKeepTogether
write SetKeepTogether;
property CloseBorder : TStrings
read GetCloseBorder
write SetCloseBorder;
property HyperLink : TStrings
read GetHyperLink
write SetHyperLink;
public
procedure Assign(Source: TPersistent); override;
procedure Clear; virtual;
constructor Create;
destructor Destroy; override;
end; {TCrpeFormatFormulas}
{------------------------------------------------------------------------------}
{ Class TCrpeFormatFormulasA }
{------------------------------------------------------------------------------}
TCrpeFormatFormulasA = class(TCrpeFormatFormulas)
private
protected
function GetSuppress : TStrings; override;
procedure SetSuppress (const Value: TStrings); override;
function GetKeepTogether : TStrings; override;
procedure SetKeepTogether (const Value: TStrings); override;
function GetCloseBorder : TStrings; override;
procedure SetCloseBorder (const Value: TStrings); override;
function GetHyperLink : TStrings; override;
procedure SetHyperLink (const Value: TStrings); override;
{OnChange StringList methods}
procedure OnChangeSuppress (Sender: TObject);
procedure OnChangeKeepTogether (Sender: TObject);
procedure OnChangeCloseBorder (Sender: TObject);
procedure OnChangeHyperLink (Sender: TObject);
published
public
constructor Create;
destructor Destroy; override;
end; {TCrpeFormatFormulasA}
{------------------------------------------------------------------------------}
{ Class TCrpeFormatFormulasB }
{------------------------------------------------------------------------------}
TCrpeFormatFormulasB = class(TCrpeFormatFormulas)
private
protected
FFieldN : Smallint;
FAlignment : TStrings;
FCanGrow : TStrings;
FSuppressIfDuplicated : TStrings;
function GetSuppress : TStrings; override;
procedure SetSuppress (const Value: TStrings); override;
function GetKeepTogether : TStrings; override;
procedure SetKeepTogether (const Value: TStrings); override;
function GetCloseBorder : TStrings; override;
procedure SetCloseBorder (const Value: TStrings); override;
function GetHyperLink : TStrings; override;
procedure SetHyperLink (const Value: TStrings); override;
function GetAlignment : TStrings;
procedure SetAlignment (const Value: TStrings);
function GetCanGrow : TStrings;
procedure SetCanGrow (const Value: TStrings);
function GetSuppressIfDuplicated : TStrings;
procedure SetSuppressIfDuplicated (const Value: TStrings);
{OnChange StringList methods}
procedure OnChangeSuppress (Sender: TObject);
procedure OnChangeKeepTogether (Sender: TObject);
procedure OnChangeCloseBorder (Sender: TObject);
procedure OnChangeHyperLink (Sender: TObject);
procedure OnChangeAlignment (Sender: TObject);
procedure OnChangeCanGrow (Sender: TObject);
procedure OnChangeSuppressIfDuplicated (Sender: TObject);
published
property Alignment : TStrings
read GetAlignment
write SetAlignment;
property SuppressIfDuplicated : TStrings
read GetSuppressIfDuplicated
write SetSuppressIfDuplicated;
property CanGrow : TStrings
read GetCanGrow
write SetCanGrow;
public
procedure Assign(Source: TPersistent); override;
procedure Clear; override;
constructor Create;
destructor Destroy; override;
end; {TCrpeFormatFormulasB}
{------------------------------------------------------------------------------}
{ Class TCrpeFieldObjectFormat }
{ - used by all Field Objects...adds Field Formatting }
{------------------------------------------------------------------------------}
TCrpeFieldObjectFormat = class(TCrpeFormatB)
private
protected
FField : TCrpeFieldFormat;
published
property Field : TCrpeFieldFormat
read FField
write FField;
public
procedure SetFieldType(FType: TCrFieldValueType);
procedure SetFNum(nField: Smallint);
procedure Assign(Source: TPersistent); override;
procedure Clear; override;
constructor Create;
destructor Destroy; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeNumberFormat }
{ - holds properties for formatting number fields }
{------------------------------------------------------------------------------}
TCrpeNumberFormat = class(TCrpePersistent)
private
protected
FFieldType : TCrFieldValueType;
FFieldN : Smallint;
FSuppressIfZero : Boolean;
FNegativeFormat : TCrNegativeFormat;
FUseThousandsSeparators : Boolean;
FUseLeadingZero : Boolean;
FDecimalPlaces : integer;
FRoundingFormat : TCrRoundingFormat;
FReverseSignForDisplay : Boolean;
FUseAccountingFormat : Boolean;
FCurrencySymbol : string;
FCurrencySymbolFormat : TCrCurrencySymbolFormat;
FOneCurrencySymbolPerPage : Boolean;
FCurrencySymbolPosition : TCrCurrencySymbolPosition;
FThousandSymbol : string;
FDecimalSymbol : string;
FShowZeroValueAs : string;
FAllowFieldClipping : Boolean;
function GetSuppressIfZero : Boolean;
function GetNegativeFormat : TCrNegativeFormat;
function GetUseThousandsSeparators : Boolean;
function GetUseLeadingZero : Boolean;
function GetDecimalPlaces : integer;
function GetRoundingFormat : TCrRoundingFormat;
function GetReverseSignForDisplay : Boolean;
function GetUseAccountingFormat : Boolean;
function GetCurrencySymbol : string;
function GetCurrencySymbolFormat : TCrCurrencySymbolFormat;
function GetOneCurrencySymbolPerPage : Boolean;
function GetCurrencySymbolPosition : TCrCurrencySymbolPosition;
function GetThousandSymbol : string;
function GetDecimalSymbol : string;
function GetShowZeroValueAs : string;
function GetAllowFieldClipping : boolean;
procedure SetSuppressIfZero (const Value: Boolean);
procedure SetNegativeFormat (const Value: TCrNegativeFormat);
procedure SetUseThousandsSeparators (const Value: Boolean);
procedure SetUseLeadingZero (const Value: Boolean);
procedure SetDecimalPlaces (const Value: integer);
procedure SetRoundingFormat (const Value: TCrRoundingFormat);
procedure SetReverseSignForDisplay (const Value: Boolean);
procedure SetUseAccountingFormat (const Value: Boolean);
procedure SetCurrencySymbol (const Value: string);
procedure SetCurrencySymbolFormat (const Value: TCrCurrencySymbolFormat);
procedure SetOneCurrencySymbolPerPage (const Value: Boolean);
procedure SetCurrencySymbolPosition (const Value: TCrCurrencySymbolPosition);
procedure SetThousandSymbol (const Value: string);
procedure SetDecimalSymbol (const Value: string);
procedure SetShowZeroValueAs (const Value: string);
procedure SetAllowFieldClipping (const Value: boolean);
{Internal}
function StatusIsGo : Boolean;
published
property SuppressIfZero : Boolean
read GetSuppressIfZero
write SetSuppressIfZero
default False;
property NegativeFormat : TCrNegativeFormat
read GetNegativeFormat
write SetNegativeFormat
default nfLeading;
property UseThousandsSeparators : Boolean
read GetUseThousandsSeparators
write SetUseThousandsSeparators
default True;
property UseLeadingZero : Boolean
read GetUseLeadingZero
write SetUseLeadingZero
default True;
property DecimalPlaces : integer
read GetDecimalPlaces
write SetDecimalPlaces
default 0;
property RoundingFormat : TCrRoundingFormat
read GetRoundingFormat
write SetRoundingFormat
default rfUnit;
property ReverseSignForDisplay : Boolean {SCR8}
read GetReverseSignForDisplay
write SetReverseSignForDisplay
default False; {??}
property UseAccountingFormat : Boolean {SCR8}
read GetUseAccountingFormat
write SetUseAccountingFormat
default False; {??}
property CurrencySymbol : string
read GetCurrencySymbol
write SetCurrencySymbol; {default is '$'}
property CurrencySymbolFormat : TCrCurrencySymbolFormat
read GetCurrencySymbolFormat
write SetCurrencySymbolFormat
default csfFloating;
property OneCurrencySymbolPerPage : Boolean
read GetOneCurrencySymbolPerPage
write SetOneCurrencySymbolPerPage
default False;
property CurrencySymbolPosition : TCrCurrencySymbolPosition
read GetCurrencySymbolPosition
write SetCurrencySymbolPosition
default cspLeadingInside;
property ThousandSymbol : string
read GetThousandSymbol
write SetThousandSymbol; {default is ','}
property DecimalSymbol : string
read GetDecimalSymbol
write SetDecimalSymbol; {default is '.'}
property ShowZeroValueAs : string {SCR8}
read GetShowZeroValueAs
write SetShowZeroValueAs; {default is '0'?}
property AllowFieldClipping : boolean
read GetAllowFieldClipping
write SetAllowFieldClipping
default True;
public
procedure GetFormat;
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeDateFormat }
{ - holds properties for formatting date fields }
{------------------------------------------------------------------------------}
TCrpeDateFormat = class(TCrpePersistent)
private
protected
FFieldType : TCrFieldValueType;
FFieldN : Smallint;
FDateType : TCrDateType;
FDateOrder : TCrDateOrder;
FYearFormat : TCrYearFormat;
FMonthFormat : TCrMonthFormat;
FDayFormat : TCrDayFormat;
FDayOfWeekType : TCrDayOfWeekType;
FFirstSeparator : string;
FSecondSeparator : string;
FDayOfWeekSeparator : string;
FDayOfWeekPosition : TCrDayOfWeekPosition;
FDayOfWeekEnclosure : TCrDayOfWeekEnclosure;
FDateEra : TCrDateEra;
FCalendarType : TCrCalendarType;
FPrefixSeparator : string;
FSuffixSeparator : string;
function GetDateType : TCrDateType;
function GetDateOrder : TCrDateOrder;
function GetYearFormat : TCrYearFormat;
function GetMonthFormat : TCrMonthFormat;
function GetDayFormat : TCrDayFormat;
function GetDayOfWeekType : TCrDayOfWeekType;
function GetFirstSeparator : string;
function GetSecondSeparator : string;
function GetDayOfWeekSeparator : string;
function GetDayOfWeekPosition : TCrDayOfWeekPosition;
function GetDayOfWeekEnclosure : TCrDayOfWeekEnclosure;
function GetDateEra : TCrDateEra;
function GetCalendarType : TCrCalendarType;
function GetPrefixSeparator : string;
function GetSuffixSeparator : string;
procedure SetDateType (const Value: TCrDateType);
procedure SetDateOrder (const Value: TCrDateOrder);
procedure SetYearFormat (const Value: TCrYearFormat);
procedure SetMonthFormat (const Value: TCrMonthFormat);
procedure SetDayFormat (const Value: TCrDayFormat);
procedure SetDayOfWeekType (const Value: TCrDayOfWeekType);
procedure SetFirstSeparator (const Value: string);
procedure SetSecondSeparator (const Value: string);
procedure SetDayOfWeekSeparator (const Value: string);
procedure SetDayOfWeekPosition (const Value: TCrDayOfWeekPosition);
procedure SetDayOfWeekEnclosure (const Value: TCrDayOfWeekEnclosure);
procedure SetDateEra (const Value: TCrDateEra);
procedure SetCalendarType (const Value: TCrCalendarType);
procedure SetPrefixSeparator (const Value: string);
procedure SetSuffixSeparator (const Value: string);
{Internal}
function StatusIsGo : Boolean;
published
property DateType : TCrDateType
read GetDateType
write SetDateType
default dfWindowsShort;
property DateOrder : TCrDateOrder
read GetDateOrder
write SetDateOrder
default doMDY;
property YearFormat : TCrYearFormat
read GetYearFormat
write SetYearFormat
default yfLong;
property MonthFormat : TCrMonthFormat
read GetMonthFormat
write SetMonthFormat
default mfLeadingZeroNumeric;
property DayFormat : TCrDayFormat
read GetDayFormat
write SetDayFormat
default dfLeadingZeroNumeric;
property DayOfWeekType : TCrDayOfWeekType
read GetDayOfWeekType
write SetDayOfWeekType
default dwfNone;
property FirstSeparator : string
read GetFirstSeparator
write SetFirstSeparator; {default is '/'}
property SecondSeparator : string
read GetSecondSeparator
write SetSecondSeparator; {default is '/'}
property DayOfWeekSeparator : string
read GetDayOfWeekSeparator
write SetDayOfWeekSeparator; {default is ''}
property DayOfWeekPosition : TCrDayOfWeekPosition
read GetDayOfWeekPosition
write SetDayOfWeekPosition
default dwpLeading;
property DayOfWeekEnclosure : TCrDayOfWeekEnclosure {SCR8}
read GetDayOfWeekEnclosure
write SetDayOfWeekEnclosure
default dweNone; {??}
property DateEra : TCrDateEra
read GetDateEra
write SetDateEra
default deNone;
property CalendarType : TCrCalendarType
read GetCalendarType
write SetCalendarType
default ctGregorian;
property PrefixSeparator : string
read GetPrefixSeparator
write SetPrefixSeparator; {default is ''}
property SuffixSeparator : string
read GetSuffixSeparator
write SetSuffixSeparator; {default is ''}
public
procedure GetFormat;
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeTimeFormat }
{ - holds properties for formatting time fields }
{------------------------------------------------------------------------------}
TCrpeTimeFormat = class(TCrpePersistent)
private
protected
FFieldType : TCrFieldValueType;
FFieldN : Smallint;
FTimeBase : TCrTimeBase;
FAmPmPosition : TCrAmPmPosition;
FHourType : TCrTimeFormat;
FMinuteType : TCrTimeFormat;
FSecondType : TCrTimeFormat;
FAMString : string;
FPMString : string;
FHourMinSeparator : string;
FMinSecSeparator : string;
function GetTimeBase : TCrTimeBase;
function GetAmPmPosition : TCrAmPmPosition;
function GetHourType : TCrTimeFormat;
function GetMinuteType : TCrTimeFormat;
function GetSecondType : TCrTimeFormat;
function GetAMString : string;
function GetPMString : string;
function GetHourMinSeparator : string;
function GetMinSecSeparator : string;
procedure SetTimeBase (const Value: TCrTimeBase);
procedure SetAmPmPosition (const Value: TCrAmPmPosition);
procedure SetHourType (const Value: TCrTimeFormat);
procedure SetMinuteType (const Value: TCrTimeFormat);
procedure SetSecondType (const Value: TCrTimeFormat);
procedure SetAMString (const Value: string);
procedure SetPMString (const Value: string);
procedure SetHourMinSeparator (const Value: string);
procedure SetMinSecSeparator (const Value: string);
{Internal}
function StatusIsGo : Boolean;
published
property TimeBase : TCrTimeBase
read GetTimeBase
write SetTimeBase
default tf12Hour;
property AmPmPosition : TCrAmPmPosition
read GetAmPmPosition
write SetAmPmPosition
default ampmAfter;
property HourType : TCrTimeFormat
read GetHourType
write SetHourType
default tfNoLeadingZero;
property MinuteType : TCrTimeFormat
read GetMinuteType
write SetMinuteType
default tfNumeric;
property SecondType : TCrTimeFormat
read GetSecondType
write SetSecondType
default tfNumeric;
property AMString : string
read GetAMString
write SetAMString; {default 'AM'}
property PMString : string
read GetPMString
write SetPMString; {default 'PM'}
property HourMinSeparator : string
read GetHourMinSeparator
write SetHourMinSeparator; {default is ':'}
property MinSecSeparator : string
read GetMinSecSeparator
write SetMinSecSeparator; {default is ':'}
public
procedure GetFormat;
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeDateTimeFormat }
{ - holds properties for formatting datetime fields }
{------------------------------------------------------------------------------}
TCrpeDateTimeFormat = class(TCrpePersistent)
private
protected
FFieldType : TCrFieldValueType;
FFieldN : Smallint;
FOrder : TCrDateTimeOrder;
FSeparator : string;
function GetOrder : TCrDateTimeOrder;
function GetSeparator : string;
procedure SetOrder (const Value: TCrDateTimeOrder);
procedure SetSeparator (const Value: string);
{Internal}
function StatusIsGo : Boolean;
published
property Order : TCrDateTimeOrder
read GetOrder
write SetOrder
default dtoDateTime;
property Separator : string
read GetSeparator
write SetSeparator; {default is ''}
public
procedure GetFormat;
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeParagraphFormat }
{ - holds properties for formatting string fields }
{------------------------------------------------------------------------------}
TCrpeParagraphFormat = class(TCrpePersistent)
private
protected
FFieldType : TCrFieldValueType;
FFieldN : Smallint;
FIndentFirstLine : integer; {twips}
FIndentLeft : integer;
FIndentRight : integer;
FTextInterpretation : TCrTextInterpretation;
FLineSpacingType : TCrLineSpacingType;
FLineSpacing : double; {N lines, can be fraction - 1.5, etc.}
FCharacterSpacing : double; {in points}
{Internal}
function StatusIsGo : Boolean;
published
function GetIndentFirstLine : integer;
function GetIndentLeft : integer;
function GetIndentRight : integer;
function GetTextInterpretation : TCrTextInterpretation;
function GetLineSpacingType : TCrLineSpacingType;
function GetLineSpacing : double;
function GetCharacterSpacing : double;
procedure SetIndentFirstLine (const Value: integer);
procedure SetIndentLeft (const Value: integer);
procedure SetIndentRight (const Value: integer);
procedure SetTextInterpretation (const Value: TCrTextInterpretation);
procedure SetLineSpacingType (const Value: TCrLineSpacingType);
procedure SetLineSpacing (const Value: double);
procedure SetCharacterSpacing (const Value: double);
property IndentFirstLine : integer
read GetIndentFirstLine
write SetIndentFirstLine
default 0;
property IndentLeft : integer
read GetIndentLeft
write SetIndentLeft
default 0;
property IndentRight : integer
read GetIndentRight
write SetIndentRight
default 0;
property TextInterpretation : TCrTextInterpretation
read GetTextInterpretation
write SetTextInterpretation
default tiNone;
property LineSpacingType : TCrLineSpacingType
read GetLineSpacingType
write SetLineSpacingType
default lsMultiple;
property LineSpacing : double
read GetLineSpacing
write SetLineSpacing; {default = 1}
property CharacterSpacing : double {in points}
read GetCharacterSpacing
write SetCharacterSpacing;
public
FForEmbeddedField : Boolean;
FForTextObject : Boolean;
procedure GetFormat;
procedure SetFieldType(FType: TCrFieldValueType);
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFieldFormatFormulas }
{ - Formulas for the FieldFormat options }
{------------------------------------------------------------------------------}
TCrpeFieldFormatFormulas = class(TCrpePersistent)
private
protected
FFieldType : TCrFieldValueType;
FFieldN : Smallint;
FName : TCrFormatFormulaName;
FFormula : TStrings;
xFormula : TStrings;
function StatusIsGo : Boolean;
function GetFormula : TStrings;
procedure SetFormula (const Value: TStrings);
procedure SetName (const Value: TCrFormatFormulaName);
procedure OnChangeStrings (Sender: TObject);
published
property Name : TCrFormatFormulaName
read FName
write SetName
default ffnFontColor;
property Formula : TStrings
read GetFormula
write SetFormula;
public
property FieldType : TCrFieldValueType
read FFieldType;
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
destructor Destroy; override;
end; {TCrpeFieldFormatFormulas}
{------------------------------------------------------------------------------}
{ Class TCrpeFieldFormat }
{ - holds properties and sub-classes for formatting fields }
{------------------------------------------------------------------------------}
TCrpeFieldFormat = class(TCrpePersistent)
private
protected
FFieldType : TCrFieldValueType;
FFieldN : Smallint;
FUseSystemDefaultFormatting : Boolean;
FBooleanType : TCrBooleanType;
FNumber : TCrpeNumberFormat;
FDate : TCrpeDateFormat;
FTime : TCrpeTimeFormat;
FDateTime : TCrpeDateTimeFormat;
FParagraph : TCrpeParagraphFormat;
FFormulas : TCrpeFieldFormatFormulas;
function GetUseSystemDefaultFormatting : Boolean;
function GetBooleanType : TCrBooleanType;
procedure SetUseSystemDefaultFormatting (const Value: Boolean);
procedure SetBooleanType (const Value: TCrBooleanType);
{Internal}
function StatusIsGo : Boolean;
published
property UseSystemDefaultFormatting : Boolean
read GetUseSystemDefaultFormatting
write SetUseSystemDefaultFormatting
default True;
property BooleanType : TCrBooleanType
read GetBooleanType
write SetBooleanType
default TrueFalse;
property Number : TCrpeNumberFormat
read FNumber
write FNumber;
property Date : TCrpeDateFormat
read FDate
write FDate;
property Time : TCrpeTimeFormat
read FTime
write FTime;
property DateTime : TCrpeDateTimeFormat
read FDateTime
write FDateTime;
property Paragraph : TCrpeParagraphFormat
read FParagraph
write FParagraph;
property Formulas : TCrpeFieldFormatFormulas
read FFormulas
write FFormulas;
public
property FieldType : TCrFieldValueType
read FFieldType;
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
destructor Destroy; override;
end; {TCrpeFieldFormat}
{------------------------------------------------------------------------------}
{ Class TCrpeBorderFormulas }
{------------------------------------------------------------------------------}
TCrpeBorderFormulas = class(TCrpePersistent)
private
protected
FFieldN : Smallint;
{Border properties}
FLeft : TStrings;
FRight : TStrings;
FTop : TStrings;
FBottom : TStrings;
FTightHorizontal : TStrings;
FDropShadow : TStrings;
FForeColor : TStrings;
FBackgroundColor : TStrings;
xFormula : TStrings;
function StatusIsGo : Boolean;
function GetLeft : TStrings;
procedure SetLeft (const Value: TStrings);
function GetRight : TStrings;
procedure SetRight (const Value: TStrings);
function GetTop : TStrings;
procedure SetTop (const Value: TStrings);
function GetBottom : TStrings;
procedure SetBottom (const Value: TStrings);
function GetTightHorizontal : TStrings;
procedure SetTightHorizontal (const Value: TStrings);
function GetDropShadow : TStrings;
procedure SetDropShadow (const Value: TStrings);
function GetForeColor : TStrings;
procedure SetForeColor (const Value: TStrings);
function GetBackgroundColor : TStrings;
procedure SetBackgroundColor (const Value: TStrings);
{OnChange StringList methods}
procedure OnChangeLeft (Sender: TObject);
procedure OnChangeRight (Sender: TObject);
procedure OnChangeTop (Sender: TObject);
procedure OnChangeBottom (Sender: TObject);
procedure OnChangeTightHorizontal (Sender: TObject);
procedure OnChangeDropShadow (Sender: TObject);
procedure OnChangeForeColor (Sender: TObject);
procedure OnChangeBackgroundColor (Sender: TObject);
published
property Left : TStrings
read GetLeft
write SetLeft;
property Right : TStrings
read GetRight
write SetRight;
property Top : TStrings
read GetTop
write SetTop;
property Bottom : TStrings
read GetBottom
write SetBottom;
property TightHorizontal : TStrings
read GetTightHorizontal
write SetTightHorizontal;
property DropShadow : TStrings
read GetDropShadow
write SetDropShadow;
property ForeColor : TStrings
read GetForeColor
write SetForeColor;
property BackgroundColor : TStrings
read GetBackgroundColor
write SetBackgroundColor;
public
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
destructor Destroy; override;
end; { Class TCrpeBorderFormulas }
{------------------------------------------------------------------------------}
{ Class TCrpeBorder }
{------------------------------------------------------------------------------}
TCrpeBorder = class(TCrpePersistent)
private
protected
FFieldN : Smallint;
{Border properties}
FLeft : TCrLineStyle;
FRight : TCrLineStyle;
FTop : TCrLineStyle;
FBottom : TCrLineStyle;
FTightHorizontal : Boolean;
FDropShadow : Boolean;
FForeColor : TColor;
FBackgroundColor : TColor;
FFormulas : TCrpeBorderFormulas;
function StatusIsGo : Boolean;
published
function GetLeft : TCrLineStyle;
procedure SetLeft (const Value: TCrLineStyle);
function GetRight : TCrLineStyle;
procedure SetRight (const Value: TCrLineStyle);
function GetTop : TCrLineStyle;
procedure SetTop (const Value: TCrLineStyle);
function GetBottom : TCrLineStyle;
procedure SetBottom (const Value: TCrLineStyle);
function GetTightHorizontal : Boolean;
procedure SetTightHorizontal (const Value: Boolean);
function GetDropShadow : Boolean;
procedure SetDropShadow (const Value: Boolean);
function GetForeColor : TColor;
procedure SetForeColor (const Value: TColor);
function GetBackgroundColor : TColor;
procedure SetBackgroundColor (const Value: TColor);
property Left : TCrLineStyle
read GetLeft
write SetLeft;
property Right : TCrLineStyle
read GetRight
write SetRight;
property Top : TCrLineStyle
read GetTop
write SetTop;
property Bottom : TCrLineStyle
read GetBottom
write SetBottom;
property TightHorizontal : Boolean
read GetTightHorizontal
write SetTightHorizontal;
property DropShadow : Boolean
read GetDropShadow
write SetDropShadow;
property ForeColor : TColor
read GetForeColor
write SetForeColor;
property BackgroundColor : TColor
read GetBackgroundColor
write SetBackgroundColor;
property Formulas : TCrpeBorderFormulas
read FFormulas
write FFormulas;
public
procedure SetFNum(nField: Smallint);
procedure Assign(Source: TPersistent); override;
procedure GetBorder;
procedure Clear;
constructor Create;
destructor Destroy; override;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeFont }
{------------------------------------------------------------------------------}
TCrpeFont = class(TFont)
private
protected
FIndex : integer;
FActualSize : double; {points, but supports fractions}
function GetActualSize: double;
procedure SetActualSize (const Value: double);
function HasChanged(RptFontInfo: PEFontColorInfo): Boolean;
procedure CopyFontInfo(var FontInfo: PEFontColorInfo; VCLFont: TCrpeFont);
published
property ActualSize : double
read GetActualSize
write SetActualSize;
public
Cx : TComponent;
Parent : TCrpePersistent;
Handle : DWord;
procedure Assign(Source: TPersistent); override;
procedure Clear;
procedure GetFont;
procedure SetFont;
constructor Create;
end;
{------------------------------------------------------------------------------}
{ Class TCrpeHiliteConditionsItem }
{------------------------------------------------------------------------------}
TCrpeHiliteConditionsItem = class(TCrpeItem)
private
protected
FRangeCondition : TCrHiliteRangeCondition;
FStartValue : Double;
FEndValue : Double;
FFontColor : TColor;
FBackground : TColor;
FBorderStyle : TCrHiliteBorderStyle;
FFontStyle : TCrHiliteFontStyle;
function StatusIsGo : Boolean;
procedure SetRangeCondition (const Value: TCrHiliteRangeCondition);
procedure SetStartValue (const Value: Double);
procedure SetEndValue (const Value: Double);
procedure SetFontColor (const Value: TColor);
procedure SetBackground (const Value: TColor);
procedure SetBorderStyle (const Value: TCrHiliteBorderStyle);
procedure SetFontStyle (const Value: TCrHiliteFontStyle);
published
property RangeCondition : TCrHiliteRangeCondition
read FRangeCondition
write SetRangeCondition
default hrcEqualTo;
property StartValue : Double
read FStartValue
write SetStartValue;
property EndValue : Double
read FEndValue
write SetEndValue;
property FontColor : TColor
read FFontColor
write SetFontColor
default clBlack;
property Background : TColor
read FBackground
write SetBackground
default clWhite;
property BorderStyle : TCrHiliteBorderStyle
read FBorderStyle
write SetBorderStyle
default hbsDefault;
property FontStyle : TCrHiliteFontStyle
read FFontStyle
write SetFontStyle
default hfsDefault;
public
procedure SetPriority (nIndex: Smallint);
procedure Assign(Source: TPersistent); override;
procedure Clear;
constructor Create;
end; { Class TCrpeHiliteConditionsItem }
{------------------------------------------------------------------------------}
{ Class TCrpeHiliteConditions }
{ - Hiliting only applies to numeric fields }
{------------------------------------------------------------------------------}
TCrpeHiliteConditions = class(TCrpeContainer)
private
protected
FFieldType : TCrFieldValueType; {holds parent fieldtype}
FItem : TCrpeHiliteConditionsItem;
function StatusIsGo : Boolean;
function GetItem (nIndex: integer) : TCrpeHiliteConditionsItem;
published
procedure SetIndex (nIndex: integer);
property Number : TCrLookupNumber
read FIndex
write SetIndex
default -1;
property Item : TCrpeHiliteConditionsItem
read FItem
write FItem;
public
property ItemIndex : integer
read FIndex
write SetIndex;
property Items[nIndex: integer]: TCrpeHiliteConditionsItem
read GetItem; default;
function Count : integer; override;
procedure Assign(Source: TPersistent); override;
procedure Clear;
function Add : integer;
procedure Delete (nIndex: integer);
constructor Create;
destructor Destroy; override;
end; { Class TCrpeHiliteConditions }
implementation
uses SysUtils, TypInfo, UCrpe32, UCrpeUtl;
{******************************************************************************}
{ TCrpePersistent Class Definition }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpePersistent.Create;
begin
inherited Create;
FIndex := -1;
Cx := nil;
Handle := 0;
Parent := nil;
FSubClassList := TList.Create;
end;
{------------------------------------------------------------------------------}
{ Destructor Destroy }
{------------------------------------------------------------------------------}
destructor TCrpePersistent.Destroy;
begin
FSubClassList.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ PropagateCrpe }
{------------------------------------------------------------------------------}
procedure TCrpePersistent.PropagateCrpe (const Crpe: TComponent;
const Par: TCrpePersistent);
var
i : integer;
begin
Cx := Crpe;
Parent := Par;
{Set the Cr member of any subclasses}
for i := 0 to (FSubClassList.Count - 1) do
begin
if TObject(FSubClassList[i]) is TCrpePersistent then
TCrpePersistent(FSubClassList[i]).PropagateCrpe(Crpe, Self);
if TObject(FSubClassList[i]) is TCrpeFont then
begin
TCrpeFont(FSubClassList[i]).Cx := Crpe;
TCrpeFont(FSubClassList[i]).Parent := Self;
end;
end;
end;
{------------------------------------------------------------------------------}
{ PropagateHandle }
{------------------------------------------------------------------------------}
procedure TCrpePersistent.PropagateHandle (const NewHandle: DWord);
var
i : integer;
begin
Handle := NewHandle;
{Set the Cr member of any subclasses}
for i := 0 to (FSubClassList.Count - 1) do
begin
if TObject(FSubClassList[i]) is TCrpePersistent then
TCrpePersistent(FSubClassList[i]).PropagateHandle(NewHandle);
if TObject(FSubClassList[i]) is TCrpeFont then
TCrpeFont(FSubClassList[i]).Handle := NewHandle;
end;
end;
{------------------------------------------------------------------------------}
{ SetIndex }
{------------------------------------------------------------------------------}
procedure TCrpePersistent.PropagateIndex (const NewIndex: integer);
var
i : integer;
begin
FIndex := NewIndex;
{Set the FIndex member of any subclasses that are not containers}
for i := 0 to (FSubClassList.Count - 1) do
begin
if TObject(FSubClassList[i]) is TCrpeContainer then
Continue; {skip}
if TObject(FSubClassList[i]) is TCrpePersistent then
TCrpePersistent(FSubClassList[i]).PropagateIndex(NewIndex);
if TObject(FSubClassList[i]) is TCrpeFont then
TCrpeFont(FSubClassList[i]).FIndex := NewIndex;
end;
end;
{******************************************************************************}
{******************************************************************************}
{ Common Object Classes }
{******************************************************************************}
{******************************************************************************}
{******************************************************************************}
{ Class TCrpeObjectContainerA }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Count }
{------------------------------------------------------------------------------}
function TCrpeObjectContainerA.Count : integer;
begin
Result := 0;
if not Assigned(Cx) then Exit;
if not TCrpe(Cx).StatusIsGo(0) then Exit;
Result := TCrpe(Cx).GetNObjects(FObjectType, FFieldObjectType);
end;
{------------------------------------------------------------------------------}
{ SetIndex }
{------------------------------------------------------------------------------}
procedure TCrpeObjectContainerA.SetIndex (nIndex: integer);
var
objectInfo : PEObjectInfo;
begin
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) or IsStrEmpty(TCrpe(Cx).ReportName) then
Exit;
if nIndex < 0 then
begin
PropagateIndex(-1);
PropagateHandle(0);
Exit;
end;
if not TCrpe(Cx).OpenJob then Exit;
Handle := TCrpe(Cx).GetObjectHandle(nIndex, FObjectType, FFieldObjectType);
if Handle = 0 then
begin
case TCrpe(Cx).GetErrorMsg(0,errNoOption,errVCL,ECRPE_SUBSCRIPT,
TCrpe(Cx).BuildErrorString(Self) + 'SetIndex(' + IntToStr(nIndex) + ')') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
PropagateHandle(Handle);
if not TCrpe(Cx).CrpeEngine.PEGetObjectInfo(TCrpe(Cx).JobNumber, Handle, objectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetIndex(' + IntToStr(nIndex) + ') <PEGetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
PropagateIndex(nIndex);
FItem.FLeft := objectInfo.xOffset;
FItem.FTop := objectInfo.yOffset;
FItem.FWidth := objectInfo.width;
FItem.FHeight := objectInfo.height;
FItem.FSection := TCrpe(Cx).SectionCodeToStringEx(objectInfo.sectionCode, False);
if csDesigning in TCrpe(Cx).ComponentState then
FItem.FBorder.GetBorder;
end;
{******************************************************************************}
{ Class TCrpeObjectContainerB }
{ - used for TextObjects }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Count }
{------------------------------------------------------------------------------}
function TCrpeObjectContainerB.Count : integer;
begin
Result := 0;
if not Assigned(Cx) then Exit;
if not TCrpe(Cx).StatusIsGo(0) then Exit;
Result := TCrpe(Cx).GetNObjects(FObjectType, FFieldObjectType);
end;
{------------------------------------------------------------------------------}
{ SetIndex }
{------------------------------------------------------------------------------}
procedure TCrpeObjectContainerB.SetIndex (nIndex: integer);
var
objectInfo : PEObjectInfo;
begin
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) or IsStrEmpty(TCrpe(Cx).ReportName) then
Exit;
if nIndex < 0 then
begin
PropagateIndex(-1);
PropagateHandle(0);
Exit;
end;
if not TCrpe(Cx).OpenJob then Exit;
Handle := TCrpe(Cx).GetObjectHandle(nIndex, FObjectType, FFieldObjectType);
if Handle = 0 then
begin
case TCrpe(Cx).GetErrorMsg(0,errNoOption,errVCL,ECRPE_SUBSCRIPT,
TCrpe(Cx).BuildErrorString(Self) + 'SetIndex(' + IntToStr(nIndex) + ')') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
PropagateHandle(Handle);
if not TCrpe(Cx).CrpeEngine.PEGetObjectInfo(TCrpe(Cx).JobNumber, Handle, objectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetIndex(' + IntToStr(nIndex) + ') <PEGetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
PropagateIndex(nIndex);
FItem.FLeft := objectInfo.xOffset;
FItem.FTop := objectInfo.yOffset;
FItem.FWidth := objectInfo.width;
FItem.FHeight := objectInfo.height;
FItem.FSection := TCrpe(Cx).SectionCodeToStringEx(objectInfo.sectionCode, False);
if csDesigning in TCrpe(Cx).ComponentState then
begin
FItem.FBorder.GetBorder;
FItem.FFormat.GetFormat;
end;
end;
{******************************************************************************}
{ Class TCrpeObjectItem }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeObjectItem.Create;
begin
inherited Create;
FTop := -1;
FLeft := -1;
FWidth := -1;
FHeight := -1;
FSection := '';
{Sub Classes}
FBorder := TCrpeBorder.Create;
FSubClassList.Add(FBorder);
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeObjectItem.Destroy;
begin
FBorder.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItem.Assign (Source: TPersistent);
begin
if Source is TCrpeObjectItem then
begin
Top := TCrpeObjectItem(Source).Top;
Left := TCrpeObjectItem(Source).Left;
Width := TCrpeObjectItem(Source).Width;
Height := TCrpeObjectItem(Source).Height;
Section := TCrpeObjectItem(Source).Section;
Border.Assign(TCrpeObjectItem(Source).Border);
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItem.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) then
begin
FIndex := -1;
Handle := 0;
FTop := -1;
FLeft := -1;
FWidth := -1;
FHeight := -1;
FSection := '';
end;
FBorder.Clear;
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeObjectItem.StatusIsGo (nIndex: integer): Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) then Exit;
if nIndex < 0 then
begin
PropagateIndex(-1);
PropagateHandle(0);
Exit;
end;
if not TCrpe(Cx).OpenJob then Exit;
{Check Handle}
if Handle = 0 then
Handle := TCrpe(Cx).GetObjectHandle(nIndex, TCrpeObjectContainer(Parent).FObjectType,
TCrpeObjectContainer(Parent).FFieldObjectType);
if Handle = 0 then
begin
PropagateHandle(0);
Exit;
end;
Result := True;
end;
{------------------------------------------------------------------------------}
{ GetBorder }
{------------------------------------------------------------------------------}
function TCrpeObjectItem.GetBorder : TCrpeBorder;
begin
FBorder.GetLeft;
FBorder.GetRight;
FBorder.GetTop;
FBorder.GetBottom;
FBorder.GetTightHorizontal;
FBorder.GetDropShadow;
FBorder.GetForeColor;
FBorder.GetBackgroundColor;
Result := FBorder;
end;
{------------------------------------------------------------------------------}
{ SetTop }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItem.SetTop (const Value: LongInt);
var
objectInfo : PEObjectInfo;
JobNum : Smallint;
begin
FTop := Value;
if not StatusIsGo(FIndex) then Exit;
if Parent is TCrpeSubreports then
JobNum := TCrpe(Cx).PrintJobs(0)
else
JobNum := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectInfo(JobNum, Handle, objectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PEGetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
if objectInfo.yOffset <> FTop then
begin
objectInfo.yOffset := FTop;
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectInfo(JobNum, Handle, objectInfo) then
begin case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PESetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetLeft }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItem.SetLeft (const Value: LongInt);
var
objectInfo : PEObjectInfo;
JobNum : Smallint;
begin
FLeft := Value;
if not StatusIsGo(FIndex) then Exit;
if Parent is TCrpeSubreports then
JobNum := TCrpe(Cx).PrintJobs(0)
else
JobNum := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectInfo(JobNum, Handle, objectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PEGetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
if objectInfo.xOffset <> FLeft then
begin
objectInfo.xOffset := FLeft;
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectInfo(JobNum, Handle, objectInfo) then
begin case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PESetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetWidth }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItem.SetWidth (const Value: LongInt);
var
objectInfo : PEObjectInfo;
JobNum : Smallint;
begin
FWidth := Value;
if not StatusIsGo(FIndex) then Exit;
if Parent is TCrpeSubreports then
JobNum := TCrpe(Cx).PrintJobs(0)
else
JobNum := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectInfo(JobNum, Handle, objectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetWidth <PEGetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
if objectInfo.width <> FWidth then
begin
objectInfo.width := FWidth;
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectInfo(JobNum, Handle, objectInfo) then
begin case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetWidth <PESetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetHeight }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItem.SetHeight (const Value: LongInt);
var
objectInfo : PEObjectInfo;
JobNum : Smallint;
begin
FHeight := Value;
if not StatusIsGo(FIndex) then Exit;
if Parent is TCrpeSubreports then
JobNum := TCrpe(Cx).PrintJobs(0)
else
JobNum := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectInfo(JobNum, Handle, objectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHeight <PEGetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
if objectInfo.height <> FHeight then
begin
objectInfo.height := FHeight;
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectInfo(JobNum, Handle, objectInfo) then
begin case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHeight <PESetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetSection }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItem.SetSection (const Value: string);
var
objectInfo : PEObjectInfo;
SectionCode : Smallint;
JobNum : Smallint;
begin
FSection := Value;
if not StatusIsGo(FIndex) then Exit;
if Parent is TCrpeSubreports then
JobNum := TCrpe(Cx).PrintJobs(0)
else
JobNum := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectInfo(JobNum, Handle, objectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSection <PEGetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Convert Section name to code}
if not StrToSectionCode(FSection, SectionCode) then
Exit;
if objectInfo.sectionCode <> SectionCode then
begin
objectInfo.sectionCode := SectionCode;
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectInfo(JobNum, Handle, objectInfo) then
begin case TCrpe(Cx).GetErrorMsg(JobNum,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSection <PESetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeObjectItemA }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeObjectItemA.Create;
begin
inherited Create;
FFormat := TCrpeFormatA.Create;
FSubClassList.Add(FFormat);
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeObjectItemA.Destroy;
begin
FFormat.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItemA.Assign(Source: TPersistent);
begin
if Source is TCrpeObjectItemA then
begin
Format.Assign(TCrpeObjectItemA(Source).Format);
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItemA.Clear;
begin
inherited Clear;
FFormat.Clear;
end;
{******************************************************************************}
{ Class TCrpeObjectItemB }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeObjectItemB.Create;
begin
inherited Create;
{Format}
FFormat := TCrpeFormatC.Create;
FSubClassList.Add(FFormat);
{Font}
FFont := TCrpeFont.Create;
FSubClassList.Add(FFont);
FFont.OnChange := OnChangeFont;
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeObjectItemB.Destroy;
begin
FFormat.Free;
FFont.OnChange := nil;
FFont.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItemB.Assign(Source: TPersistent);
begin
if Source is TCrpeObjectItemB then
begin
Format.Assign(TCrpeObjectItemB(Source).Format);
Font.Assign(TCrpeObjectItemB(Source).Font);
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItemB.Clear;
begin
inherited Clear;
FFormat.Clear;
FFont.Clear;
end;
{------------------------------------------------------------------------------}
{ GetFont }
{------------------------------------------------------------------------------}
function TCrpeObjectItemB.GetFont : TCrpeFont;
begin
FFont.GetFont;
Result := FFont;
end;
{------------------------------------------------------------------------------}
{ OnChangeFont }
{------------------------------------------------------------------------------}
procedure TCrpeObjectItemB.OnChangeFont (Sender: TObject);
begin
if StatusIsGo(FIndex) then
FFont.SetFont;
end;
{******************************************************************************}
{ Class TCrpeNumberFormat }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeNumberFormat.Create;
begin
inherited Create;
FSuppressIfZero := False;
FNegativeFormat := nfLeading;
FUseThousandsSeparators := True;
FUseLeadingZero := True;
FDecimalPlaces := 0;
FRoundingFormat := rfUnit;
FReverseSignForDisplay := False;
FUseAccountingFormat := False;
FCurrencySymbol := '$';
FCurrencySymbolFormat := csfFloating;
FOneCurrencySymbolPerPage := False;
FCurrencySymbolPosition := cspLeadingInside;
FThousandSymbol := ',';
FDecimalSymbol := '.';
FShowZeroValueAs := '0';
FAllowFieldClipping := True;
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
FSuppressIfZero := False;
FNegativeFormat := nfLeading;
FUseThousandsSeparators := True;
FUseLeadingZero := True;
FDecimalPlaces := 0;
FRoundingFormat := rfUnit;
FReverseSignForDisplay := False;
FUseAccountingFormat := False;
FCurrencySymbol := '$';
FCurrencySymbolFormat := csfFloating;
FOneCurrencySymbolPerPage := False;
FCurrencySymbolPosition := cspLeadingInside;
FThousandSymbol := ',';
FDecimalSymbol := '.';
FShowZeroValueAs := '0';
FAllowFieldClipping := True;
end;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.Assign(Source: TPersistent);
begin
if Source is TCrpeNumberFormat then
begin
SuppressIfZero := TCrpeNumberFormat(Source).SuppressIfZero;
NegativeFormat := TCrpeNumberFormat(Source).NegativeFormat;
UseThousandsSeparators := TCrpeNumberFormat(Source).UseThousandsSeparators;
UseLeadingZero := TCrpeNumberFormat(Source).UseLeadingZero;
DecimalPlaces := TCrpeNumberFormat(Source).DecimalPlaces;
RoundingFormat := TCrpeNumberFormat(Source).RoundingFormat;
ReverseSignForDisplay := TCrpeNumberFormat(Source).ReverseSignForDisplay;
UseAccountingFormat := TCrpeNumberFormat(Source).UseAccountingFormat;
CurrencySymbol := TCrpeNumberFormat(Source).CurrencySymbol;
CurrencySymbolFormat := TCrpeNumberFormat(Source).CurrencySymbolFormat;
OneCurrencySymbolPerPage := TCrpeNumberFormat(Source).OneCurrencySymbolPerPage;
CurrencySymbolPosition := TCrpeNumberFormat(Source).CurrencySymbolPosition;
ThousandSymbol := TCrpeNumberFormat(Source).ThousandSymbol;
DecimalSymbol := TCrpeNumberFormat(Source).DecimalSymbol;
ShowZeroValueAs := TCrpeNumberFormat(Source).ShowZeroValueAs;
AllowFieldClipping := TCrpeNumberFormat(Source).AllowFieldClipping;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then Exit;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ GetFormat }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.GetFormat;
begin
GetSuppressIfZero;
GetNegativeFormat;
GetUseThousandsSeparators;
GetUseLeadingZero;
GetDecimalPlaces;
GetRoundingFormat;
GetReverseSignForDisplay;
GetUseAccountingFormat;
GetCurrencySymbol;
GetCurrencySymbolFormat;
GetOneCurrencySymbolPerPage;
GetCurrencySymbolPosition;
GetThousandSymbol;
GetDecimalSymbol;
GetShowZeroValueAs;
GetAllowFieldClipping;
end;
{------------------------------------------------------------------------------}
{ GetSuppressIfZero }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetSuppressIfZero : Boolean;
var
ValueInfo : PEValueInfo;
begin
Result := FSuppressIfZero;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SUPPRESS_IF_ZERO, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppressIfZero <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SUPPRESS_IF_ZERO,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppressIfZero <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FSuppressIfZero := ValueInfo.viBoolean;
Result := FSuppressIfZero;
end;
{------------------------------------------------------------------------------}
{ SetSuppressIfZero }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetSuppressIfZero (const Value: Boolean);
var
ValueInfo : PEValueInfo;
begin
FSuppressIfZero := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SUPPRESS_IF_ZERO, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfZero <PEGetNthEmbeddedFieldFormat>') of
errIgnore : ValueInfo.viBoolean := not FSuppressIfZero;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SUPPRESS_IF_ZERO,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfZero <PEGetObjectFormat>') of
errIgnore : ValueInfo.viBoolean := not FSuppressIfZero;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viBoolean <> Bool(FSuppressIfZero) then
begin
ValueInfo.viBoolean := Bool(FSuppressIfZero);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SUPPRESS_IF_ZERO, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfZero <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SUPPRESS_IF_ZERO,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfZero <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetNegativeFormat }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetNegativeFormat : TCrNegativeFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FNegativeFormat;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_NEGATIVE_TYPE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetNegativeFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_NEGATIVE_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetNegativeFormat <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_NNT_NOT_NEGATIVE : FNegativeFormat := nfNone;
PE_NNT_LEADING_MINUS : FNegativeFormat := nfLeading;
PE_NNT_TRAILING_MINUS : FNegativeFormat := nfTrailing;
PE_NNT_BRACKETED : FNegativeFormat := nfBracketed;
else
FNegativeFormat := nfLeading;
end;
Result := FNegativeFormat;
end;
{------------------------------------------------------------------------------}
{ SetNegativeFormat }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetNegativeFormat (const Value: TCrNegativeFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FNegativeFormat := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_NEGATIVE_TYPE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetNegativeFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_NEGATIVE_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetNegativeFormat <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FNegativeFormat) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FNegativeFormat);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_NEGATIVE_TYPE, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetNegativeFormat <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_NEGATIVE_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetNegativeFormat <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetUseThousandsSeparators }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetUseThousandsSeparators : Boolean;
var
ValueInfo : PEValueInfo;
begin
Result := FUseThousandsSeparators;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_THOUSANDSSEPARATORS, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetUseThousandsSeparators <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_THOUSANDSSEPARATORS,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetUseThousandsSeparators <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FUseThousandsSeparators := ValueInfo.viBoolean;
Result := FUseThousandsSeparators;
end;
{------------------------------------------------------------------------------}
{ SetUseThousandsSeparators }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetUseThousandsSeparators (const Value: Boolean);
var
ValueInfo : PEValueInfo;
begin
FUseThousandsSeparators := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_THOUSANDSSEPARATORS, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseThousandsSeparators <PEGetNthEmbeddedFieldFormat>') of
errIgnore : ValueInfo.viBoolean := not FUseThousandsSeparators;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_THOUSANDSSEPARATORS,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseThousandsSeparators <PEGetObjectFormat>') of
errIgnore : ValueInfo.viBoolean := not FUseThousandsSeparators;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viBoolean <> Bool(FUseThousandsSeparators) then
begin
ValueInfo.viBoolean := Bool(FUseThousandsSeparators);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_THOUSANDSSEPARATORS, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseThousandsSeparators <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_THOUSANDSSEPARATORS,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseThousandsSeparators <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetUseLeadingZero }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetUseLeadingZero : Boolean;
var
ValueInfo : PEValueInfo;
begin
Result := FUseLeadingZero;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_LEAD_ZERO, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetUseLeadingZero <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_LEAD_ZERO,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetUseLeadingZero <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FUseLeadingZero := ValueInfo.viBoolean;
Result := FUseLeadingZero;
end;
{------------------------------------------------------------------------------}
{ SetUseLeadingZero }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetUseLeadingZero (const Value: Boolean);
var
ValueInfo : PEValueInfo;
begin
FUseLeadingZero := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_LEAD_ZERO, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseLeadingZero <PEGetNthEmbeddedFieldFormat>') of
errIgnore : ValueInfo.viBoolean := not FUseLeadingZero;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_LEAD_ZERO,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseLeadingZero <PEGetObjectFormat>') of
errIgnore : ValueInfo.viBoolean := not FUseLeadingZero;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viBoolean <> Bool(FUseLeadingZero) then
begin
ValueInfo.viBoolean := Bool(FUseLeadingZero);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_LEAD_ZERO, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseLeadingZero <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_LEAD_ZERO,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseLeadingZero <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetDecimalPlaces }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetDecimalPlaces : integer;
var
ValueInfo : PEValueInfo;
begin
Result := FDecimalPlaces;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_N_DECIMAL_PLACES, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDecimalPlaces <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_N_DECIMAL_PLACES,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDecimalPlaces <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FDecimalPlaces := ValueInfo.viInteger;
Result := FDecimalPlaces;
end;
{------------------------------------------------------------------------------}
{ SetDecimalPlaces }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetDecimalPlaces (const Value: integer);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FDecimalPlaces := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_N_DECIMAL_PLACES, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDecimalPlaces <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_N_DECIMAL_PLACES,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDecimalPlaces <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> FDecimalPlaces then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := FDecimalPlaces;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_N_DECIMAL_PLACES, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDecimalPlaces <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_N_DECIMAL_PLACES,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDecimalPlaces <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetRoundingFormat }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetRoundingFormat : TCrRoundingFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FRoundingFormat;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_ROUNDING_TYPE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetRoundingFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_ROUNDING_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetRoundingFormat <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_NRT_ROUND_TO_TEN_BILLIONTH : FRoundingFormat := rfTenBillionth;
PE_NRT_ROUND_TO_BILLIONTH : FRoundingFormat := rfBillionth;
PE_NRT_ROUND_TO_HUNDRED_MILLIONTH : FRoundingFormat := rfHundredMillionth;
PE_NRT_ROUND_TO_TEN_MILLIONTH : FRoundingFormat := rfTenMillionth;
PE_NRT_ROUND_TO_MILLIONTH : FRoundingFormat := rfMillionth;
PE_NRT_ROUND_TO_HUNDRED_THOUSANDTH : FRoundingFormat := rfHundredThousandth;
PE_NRT_ROUND_TO_TEN_THOUSANDTH : FRoundingFormat := rfTenThousandth;
PE_NRT_ROUND_TO_THOUSANDTH : FRoundingFormat := rfThousandth;
PE_NRT_ROUND_TO_HUNDREDTH : FRoundingFormat := rfHundredth;
PE_NRT_ROUND_TO_TENTH : FRoundingFormat := rfTenth;
PE_NRT_ROUND_TO_UNIT : FRoundingFormat := rfUnit;
PE_NRT_ROUND_TO_TEN : FRoundingFormat := rfTen;
PE_NRT_ROUND_TO_HUNDRED : FRoundingFormat := rfHundred;
PE_NRT_ROUND_TO_THOUSAND : FRoundingFormat := rfThousand;
PE_NRT_ROUND_TO_TENTHOUSAND : FRoundingFormat := rfTenThousand;
PE_NRT_ROUND_TO_HUNDREDTHOUSAND : FRoundingFormat := rfHundredThousand;
PE_NRT_ROUND_TO_MILLION : FRoundingFormat := rfMillion;
else
FRoundingFormat := rfUnit;
end;
Result := FRoundingFormat;
end;
{------------------------------------------------------------------------------}
{ SetRoundingFormat }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetRoundingFormat (const Value: TCrRoundingFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FRoundingFormat := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_ROUNDING_TYPE, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRoundingFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_ROUNDING_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRoundingFormat <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> (Ord(FRoundingFormat) + 1) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := (Ord(FRoundingFormat) + 1);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_ROUNDING_TYPE, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRoundingFormat <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_ROUNDING_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRoundingFormat <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetReverseSignForDisplay }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetReverseSignForDisplay : Boolean;
var
ValueInfo : PEValueInfo;
begin
Result := FReverseSignForDisplay;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_REVERSE_SIGN_FOR_DISPLAY, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetReverseSignForDisplay <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_REVERSE_SIGN_FOR_DISPLAY,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetReverseSignForDisplay <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FReverseSignForDisplay := ValueInfo.viBoolean;
Result := FReverseSignForDisplay;
end;
{------------------------------------------------------------------------------}
{ SetReverseSignForDisplay }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetReverseSignForDisplay (const Value: Boolean);
var
ValueInfo : PEValueInfo;
begin
FReverseSignForDisplay := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_REVERSE_SIGN_FOR_DISPLAY, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetReverseSignForDisplay <PEGetNthEmbeddedFieldFormat>') of
errIgnore : ValueInfo.viBoolean := not FReverseSignForDisplay;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_REVERSE_SIGN_FOR_DISPLAY,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetReverseSignForDisplay <PEGetObjectFormat>') of
errIgnore : ValueInfo.viBoolean := not FReverseSignForDisplay;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viBoolean <> Bool(FReverseSignForDisplay) then
begin
ValueInfo.viBoolean := Bool(FReverseSignForDisplay);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_REVERSE_SIGN_FOR_DISPLAY, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetReverseSignForDisplay <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_REVERSE_SIGN_FOR_DISPLAY,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetReverseSignForDisplay <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetUseAccountingFormat }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetUseAccountingFormat : Boolean;
var
ValueInfo : PEValueInfo;
begin
Result := FUseAccountingFormat;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_ACCOUNTING_FORMAT, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetUseAccountingFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_ACCOUNTING_FORMAT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetUseAccountingFormat <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FUseAccountingFormat := ValueInfo.viBoolean;
Result := FUseAccountingFormat;
end;
{------------------------------------------------------------------------------}
{ SetUseAccountingFormat }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetUseAccountingFormat (const Value: Boolean);
var
ValueInfo : PEValueInfo;
begin
FUseAccountingFormat := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_ACCOUNTING_FORMAT, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseAccountingFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : ValueInfo.viBoolean := not FUseAccountingFormat;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_ACCOUNTING_FORMAT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseAccountingFormat <PEGetObjectFormat>') of
errIgnore : ValueInfo.viBoolean := not FUseAccountingFormat;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viBoolean <> Bool(FUseAccountingFormat) then
begin
ValueInfo.viBoolean := Bool(FUseAccountingFormat);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_ACCOUNTING_FORMAT, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseAccountingFormat <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_ACCOUNTING_FORMAT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseAccountingFormat <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetCurrencySymbol }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetCurrencySymbol : string;
var
ValueInfo : PEValueInfo;
begin
Result := FCurrencySymbol;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_SYMBOL, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCurrencySymbol <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_SYMBOL,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCurrencySymbol <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end
end;
FCurrencySymbol := String(ValueInfo.viString);
Result := FCurrencySymbol;
end;
{------------------------------------------------------------------------------}
{ SetCurrencySymbol }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetCurrencySymbol (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FCurrencySymbol := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_SYMBOL, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbol <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_SYMBOL,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbol <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FCurrencySymbol) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FCurrencySymbol));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_SYMBOL, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbol <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_SYMBOL,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbol <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetCurrencySymbolFormat }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetCurrencySymbolFormat : TCrCurrencySymbolFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FCurrencySymbolFormat;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_SYMBOL_TYPE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCurrencySymbolFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_SYMBOL_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCurrencySymbolFormat <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_CST_NO_SYMBOL : FCurrencySymbolFormat := csfNone;
PE_CST_FIXED_SYMBOL : FCurrencySymbolFormat := csfFixed;
PE_CST_FLOATING_SYMBOL : FCurrencySymbolFormat := csfFloating;
else
FCurrencySymbolFormat := csfFloating;
end;
Result := FCurrencySymbolFormat;
end;
{------------------------------------------------------------------------------}
{ SetCurrencySymbolFormat }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetCurrencySymbolFormat (const Value: TCrCurrencySymbolFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FCurrencySymbolFormat := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_SYMBOL_TYPE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbolFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_SYMBOL_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbolFormat <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FCurrencySymbolFormat) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FCurrencySymbolFormat);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_SYMBOL_TYPE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbolFormat <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_SYMBOL_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbolFormat <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetOneCurrencySymbolPerPage }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetOneCurrencySymbolPerPage : Boolean;
var
ValueInfo : PEValueInfo;
begin
Result := FOneCurrencySymbolPerPage;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_ONE_CURRENCY_SYMBOL_PER_PAGE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetOneCurrencySymbolPerPage <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_ONE_CURRENCY_SYMBOL_PER_PAGE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetOneCurrencySymbolPerPage <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FOneCurrencySymbolPerPage := ValueInfo.viBoolean;
Result := FOneCurrencySymbolPerPage;
end;
{------------------------------------------------------------------------------}
{ SetOneCurrencySymbolPerPage }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetOneCurrencySymbolPerPage (const Value: Boolean);
var
ValueInfo : PEValueInfo;
begin
FOneCurrencySymbolPerPage := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_ONE_CURRENCY_SYMBOL_PER_PAGE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetOneCurrencySymbolPerPage <PEGetNthEmbeddedFieldFormat>') of
errIgnore : ValueInfo.viBoolean := not FOneCurrencySymbolPerPage;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_ONE_CURRENCY_SYMBOL_PER_PAGE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetOneCurrencySymbolPerPage <PEGetObjectFormat>') of
errIgnore : ValueInfo.viBoolean := not FOneCurrencySymbolPerPage;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viBoolean <> Bool(FOneCurrencySymbolPerPage) then
begin
ValueInfo.viBoolean := Bool(FOneCurrencySymbolPerPage);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_ONE_CURRENCY_SYMBOL_PER_PAGE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetOneCurrencySymbolPerPage <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_ONE_CURRENCY_SYMBOL_PER_PAGE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetOneCurrencySymbolPerPage <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetCurrencySymbolPosition }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetCurrencySymbolPosition : TCrCurrencySymbolPosition;
var
ValueInfo : PEValueInfo;
begin
Result := FCurrencySymbolPosition;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_POSITION_TYPE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCurrencySymbolPosition <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_POSITION_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCurrencySymbolPosition <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_CPT_LEADING_CURRENCY_INSIDE_NEGATIVE : FCurrencySymbolPosition := cspLeadingInside;
PE_CPT_LEADING_CURRENCY_OUTSIDE_NEGATIVE : FCurrencySymbolPosition := cspLeadingOutside;
PE_CPT_TRAILING_CURRENCY_INSIDE_NEGATIVE : FCurrencySymbolPosition := cspTrailingInside;
PE_CPT_TRAILING_CURRENCY_OUTSIDE_NEGATIVE : FCurrencySymbolPosition := cspTrailingOutside;
else
FCurrencySymbolPosition := cspLeadingInside;
end;
Result := FCurrencySymbolPosition;
end;
{------------------------------------------------------------------------------}
{ SetCurrencySymbolPosition }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetCurrencySymbolPosition (const Value: TCrCurrencySymbolPosition);
var
ValueInfo : PEValueInfo;
iPosition : Smallint;
Changed : Boolean;
begin
FCurrencySymbolPosition := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_POSITION_TYPE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbolPosition <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_POSITION_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbolPosition <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
iPosition := PE_CPT_LEADING_CURRENCY_INSIDE_NEGATIVE;
case FCurrencySymbolPosition of
cspLeadingInside : iPosition := PE_CPT_LEADING_CURRENCY_INSIDE_NEGATIVE;
cspLeadingOutside : iPosition := PE_CPT_LEADING_CURRENCY_OUTSIDE_NEGATIVE;
cspTrailingInside : iPosition := PE_CPT_TRAILING_CURRENCY_INSIDE_NEGATIVE;
cspTrailingOutside : iPosition := PE_CPT_TRAILING_CURRENCY_OUTSIDE_NEGATIVE;
end;
if ValueInfo.viInteger <> iPosition then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := iPosition;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CURRENCY_POSITION_TYPE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbolPosition <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CURRENCY_POSITION_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCurrencySymbolPosition <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetThousandSymbol }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetThousandSymbol : string;
var
ValueInfo : PEValueInfo;
begin
Result := FThousandSymbol;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_THOUSAND_SYMBOL, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetThousandSymbol <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_THOUSAND_SYMBOL,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetThousandSymbol <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FThousandSymbol := String(ValueInfo.viString);
Result := FThousandSymbol;
end;
{------------------------------------------------------------------------------}
{ SetThousandSymbol }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetThousandSymbol (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FThousandSymbol := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_THOUSAND_SYMBOL, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetThousandSymbol <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_THOUSAND_SYMBOL,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetThousandSymbol <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FThousandSymbol) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FThousandSymbol));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_THOUSAND_SYMBOL, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetThousandSymbol <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_THOUSAND_SYMBOL,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetThousandSymbol <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetDecimalSymbol }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetDecimalSymbol : string;
var
ValueInfo : PEValueInfo;
begin
Result := FDecimalSymbol;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DECIMAL_SYMBOL, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDecimalSymbol <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DECIMAL_SYMBOL,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDecimalSymbol <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FDecimalSymbol := String(ValueInfo.viString);
Result := FDecimalSymbol;
end;
{------------------------------------------------------------------------------}
{ SetDecimalSymbol }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetDecimalSymbol (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FDecimalSymbol := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DECIMAL_SYMBOL, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDecimalSymbol <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DECIMAL_SYMBOL,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDecimalSymbol <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FDecimalSymbol) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FDecimalSymbol));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DECIMAL_SYMBOL, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDecimalSymbol <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DECIMAL_SYMBOL,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDecimalSymbol <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetShowZeroValueAs }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetShowZeroValueAs : string;
var
ValueInfo : PEValueInfo;
begin
Result := FShowZeroValueAs;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SHOW_ZERO_VALUE_AS, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetShowZeroValueAs <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SHOW_ZERO_VALUE_AS,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetShowZeroValueAs <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FShowZeroValueAs := String(ValueInfo.viString);
Result := FShowZeroValueAs;
end;
{------------------------------------------------------------------------------}
{ SetShowZeroValueAs }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetShowZeroValueAs (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FShowZeroValueAs := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SHOW_ZERO_VALUE_AS, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetShowZeroValueAs <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SHOW_ZERO_VALUE_AS,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetShowZeroValueAs <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FShowZeroValueAs) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FShowZeroValueAs));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SHOW_ZERO_VALUE_AS, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetShowZeroValueAs <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SHOW_ZERO_VALUE_AS,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetShowZeroValueAs <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetAllowFieldClipping }
{------------------------------------------------------------------------------}
function TCrpeNumberFormat.GetAllowFieldClipping : boolean;
var
ValueInfo : PEValueInfo;
begin
Result := FAllowFieldClipping;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_ALLOW_FIELD_CLIPPING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAllowFieldClipping <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_ALLOW_FIELD_CLIPPING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAllowFieldClipping <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FAllowFieldClipping := ValueInfo.viBoolean;
Result := FAllowFieldClipping;
end;
{------------------------------------------------------------------------------}
{ SetAllowFieldClipping }
{------------------------------------------------------------------------------}
procedure TCrpeNumberFormat.SetAllowFieldClipping (const Value: boolean);
var
ValueInfo : PEValueInfo;
begin
FAllowFieldClipping := Value;
if not (FFieldType in [fvInt8s..fvCurrency]) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_ALLOW_FIELD_CLIPPING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAllowFieldClipping <PEGetNthEmbeddedFieldFormat>') of
errIgnore : ValueInfo.viBoolean := not FAllowFieldClipping;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_ALLOW_FIELD_CLIPPING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAllowFieldClipping <PEGetObjectFormat>') of
errIgnore : ValueInfo.viBoolean := not FAllowFieldClipping;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viBoolean <> Bool(FAllowFieldClipping) then
begin
ValueInfo.viBoolean := Bool(FAllowFieldClipping);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_ALLOW_FIELD_CLIPPING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAllowFieldClipping <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_ALLOW_FIELD_CLIPPING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAllowFieldClipping <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeDateFormat }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeDateFormat.Create;
begin
inherited Create;
FDateType := dfWindowsShort;
FDateOrder := doMDY;
FYearFormat := yfLong;
FMonthFormat := mfLeadingZeroNumeric;
FDayFormat := dfLeadingZeroNumeric;
FDayOfWeekType := dwfNone;
FFirstSeparator := '/';
FSecondSeparator := '/';
FDayOfWeekSeparator := '';
FDayOfWeekPosition := dwpLeading;
FDayOfWeekEnclosure := dweNone;
FDateEra := deNone;
FCalendarType := ctGregorian;
FPrefixSeparator := '';
FSuffixSeparator := '';
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
FDateType := dfWindowsShort;
FDateOrder := doMDY;
FYearFormat := yfLong;
FMonthFormat := mfLeadingZeroNumeric;
FDayFormat := dfLeadingZeroNumeric;
FDayOfWeekType := dwfNone;
FFirstSeparator := '/';
FSecondSeparator := '/';
FDayOfWeekSeparator := '';
FDayOfWeekPosition := dwpLeading;
FDayOfWeekEnclosure := dweNone;
FDateEra := deNone;
FCalendarType := ctGregorian;
FPrefixSeparator := '';
FSuffixSeparator := '';
end;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.Assign(Source: TPersistent);
begin
if Source is TCrpeDateFormat then
begin
DateType := TCrpeDateFormat(Source).DateType;
DateOrder := TCrpeDateFormat(Source).DateOrder;
YearFormat := TCrpeDateFormat(Source).YearFormat;
MonthFormat := TCrpeDateFormat(Source).MonthFormat;
DayFormat := TCrpeDateFormat(Source).DayFormat;
DayOfWeekType := TCrpeDateFormat(Source).DayOfWeekType;
FirstSeparator := TCrpeDateFormat(Source).FirstSeparator;
SecondSeparator := TCrpeDateFormat(Source).SecondSeparator;
DayOfWeekSeparator := TCrpeDateFormat(Source).DayOfWeekSeparator;
DayOfWeekPosition := TCrpeDateFormat(Source).DayOfWeekPosition;
DayOfWeekEnclosure := TCrpeDateFormat(Source).DayOfWeekEnclosure;
DateEra := TCrpeDateFormat(Source).DateEra;
CalendarType := TCrpeDateFormat(Source).CalendarType;
PrefixSeparator := TCrpeDateFormat(Source).PrefixSeparator;
SuffixSeparator := TCrpeDateFormat(Source).SuffixSeparator;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then Exit;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ GetFormat }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.GetFormat;
begin
GetDateType;
GetDateOrder;
GetYearFormat;
GetMonthFormat;
GetDayFormat;
GetDayOfWeekType;
GetFirstSeparator;
GetSecondSeparator;
GetDayOfWeekSeparator;
GetDayOfWeekPosition;
GetDayOfWeekEnclosure;
GetDateEra;
GetCalendarType;
GetPrefixSeparator;
GetSuffixSeparator;
end;
{------------------------------------------------------------------------------}
{ GetDateType }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetDateType : TCrDateType;
var
ValueInfo : PEValueInfo;
begin
Result := FDateType;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{Get DateType}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_WINDOWS_DEFAULT_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDateType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_WINDOWS_DEFAULT_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDateType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DWDT_USE_WINDOWS_LONG_DATE : FDateType := dfWindowsLong;
PE_DWDT_USE_WINDOWS_SHORT_DATE : FDateType := dfWindowsShort;
PE_DWDT_NOT_USING_WINDOWS_DEFAULTS : FDateType := dfUserDefined;
else
FDateType := dfWindowsShort;
end;
end;
{------------------------------------------------------------------------------}
{ GetDateOrder }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetDateOrder : TCrDateOrder;
var
ValueInfo : PEValueInfo;
begin
Result := FDateOrder;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{DateOrder}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_ORDER, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDateOrder <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_ORDER, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDateOrder <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DO_YEAR_MONTH_DAY : FDateOrder := doYMD;
PE_DO_DAY_MONTH_YEAR : FDateOrder := doDMY;
PE_DO_MONTH_DAY_YEAR : FDateOrder := doMDY;
else
FDateOrder := doMDY;
end;
end;
{------------------------------------------------------------------------------}
{ GetYearFormat }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetYearFormat : TCrYearFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FYearFormat;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{Year Format}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_YEAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetYearFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_YEAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetYearFormat <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DYT_SHORT_YEAR : FYearFormat := yfShort;
PE_DYT_LONG_YEAR : FYearFormat := yfLong;
PE_DYT_NO_YEAR : FYearFormat := yfNone;
else
FYearFormat := yfLong;
end;
end;
{------------------------------------------------------------------------------}
{ GetMonthFormat }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetMonthFormat : TCrMonthFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FMonthFormat;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{Month Format}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MONTH_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetMonthFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MONTH_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetMonthFormat <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DMT_NUMERIC_MONTH : FMonthFormat := mfNumeric;
PE_DMT_LEADING_ZERO_NUMERIC_MONTH : FMonthFormat := mfLeadingZeroNumeric;
PE_DMT_SHORT_MONTH : FMonthFormat := mfShort;
PE_DMT_LONG_MONTH : FMonthFormat := mfLong;
PE_DMT_NO_MONTH : FMonthFormat := mfNone;
else
FMonthFormat := mfLeadingZeroNumeric;
end;
end;
{------------------------------------------------------------------------------}
{ GetDayFormat }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetDayFormat : TCrDayFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FDayFormat;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{Day Format}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayFormat <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DDT_NUMERIC_DAY : FDayFormat := dfNumeric;
PE_DDT_LEADING_ZERO_NUMERIC_DAY : FDayFormat := dfLeadingZeroNumeric;
PE_DDT_NO_DAY : FDayFormat := dfNone;
else
FDayFormat := dfLeadingZeroNumeric;
end;
end;
{------------------------------------------------------------------------------}
{ GetDayOfWeekType }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetDayOfWeekType : TCrDayOfWeekType;
var
ValueInfo : PEValueInfo;
begin
Result := FDayOfWeekType;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{DayOfWeekType}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayOfWeekType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayOfWeekType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DOWT_SHORT_DAY_OF_WEEK : FDayOfWeekType := dwfShort;
PE_DOWT_LONG_DAY_OF_WEEK : FDayOfWeekType := dwfLong;
PE_DOWT_NO_DAY_OF_WEEK : FDayOfWeekType := dwfNone;
else
FDayOfWeekType := dwfNone;
end;
end;
{------------------------------------------------------------------------------}
{ GetFirstSeparator }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetFirstSeparator : string;
var
ValueInfo : PEValueInfo;
begin
Result := FFirstSeparator;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{FirstSeparator}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_FIRST_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetFirstSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_FIRST_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetFirstSeparator <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FFirstSeparator := String(ValueInfo.viString);
end;
{------------------------------------------------------------------------------}
{ GetSecondSeparator }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetSecondSeparator : string;
var
ValueInfo : PEValueInfo;
begin
Result := FSecondSeparator;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{SecondSeparator}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_SECOND_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSecondSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_SECOND_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSecondSeparator <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FSecondSeparator := String(ValueInfo.viString);
end;
{------------------------------------------------------------------------------}
{ GetDayOfWeekSeparator }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetDayOfWeekSeparator : string;
var
ValueInfo : PEValueInfo;
begin
Result := FDayOfWeekSeparator;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{DayOfWeekSeparator}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayOfWeekSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayOfWeekSeparator <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FDayOfWeekSeparator := String(ValueInfo.viString);
end;
{------------------------------------------------------------------------------}
{ GetDayOfWeekPosition }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetDayOfWeekPosition : TCrDayOfWeekPosition;
var
ValueInfo : PEValueInfo;
begin
Result := FDayOfWeekPosition;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{DayOfWeekPosition}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_POSITION, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayOfWeekPosition <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_POSITION,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayOfWeekPosition <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DOWP_LEADING_DAY_OF_WEEK : FDayOfWeekPosition := dwpLeading;
PE_DOWP_TRAILING_DAY_OF_WEEK : FDayOfWeekPosition := dwpTrailing;
else
FDayOfWeekPosition := dwpLeading;
end;
end;
{------------------------------------------------------------------------------}
{ GetDayOfWeekEnclosure }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetDayOfWeekEnclosure : TCrDayOfWeekEnclosure;
var
ValueInfo : PEValueInfo;
begin
Result := FDayOfWeekEnclosure;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{DayOfWeekEnclosure}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_ENCLOSURE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayOfWeekEnclosure <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_ENCLOSURE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDayOfWeekEnclosure <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DOWE_NONE : FDayOfWeekEnclosure := dweNone;
PE_DOWE_PARENTHESES : FDayOfWeekEnclosure := dweParentheses;
PE_DOWE_FWPARENTHESES : FDayOfWeekEnclosure := dweFWParentheses;
PE_DOWE_SQUARE_BRACKETS : FDayOfWeekEnclosure := dweSquareBrackets;
PE_DOWE_FWSQUARE_BRACKETS : FDayOfWeekEnclosure := dweFWSquareBrackets;
else
FDayOfWeekEnclosure := dweNone;
end;
end;
{------------------------------------------------------------------------------}
{ GetDateEra }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetDateEra : TCrDateEra;
var
ValueInfo : PEValueInfo;
begin
Result := FDateEra;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{DateEra}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_ERA_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDateEra <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_ERA_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDateEra <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DET_SHORT_ERA : FDateEra := deShort;
PE_DET_LONG_ERA : FDateEra := deLong;
PE_DET_NO_ERA : FDateEra := deNone;
else
FDateEra := deNone;
end;
end;
{------------------------------------------------------------------------------}
{ GetCalendarType }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetCalendarType : TCrCalendarType;
var
ValueInfo : PEValueInfo;
begin
Result := FCalendarType;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{CalendarType}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_CALENDAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCalendarType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_CALENDAR_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCalendarType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DCT_GREGORIANCALENDAR : FCalendarType := ctGregorian;
PE_DCT_GREGORIANUSCALENDAR : FCalendarType := ctGregorianus;
PE_DCT_JAPANESECALENDAR : FCalendarType := ctJapanese;
PE_DCT_TAIWANESECALENDAR : FCalendarType := ctTaiwanese;
PE_DCT_KOREANCALENDAR : FCalendarType := ctKorean;
PE_DCT_HIJRICALENDAR : FCalendarType := ctHijri;
PE_DCT_THAICALENDAR : FCalendarType := ctThai;
{SCR8+}
PE_DCT_HEBREWCALENDAR : FCalendarType := ctHebrew;
PE_DCT_GREGORIANMEFRENCHCALENDAR : FCalendarType := ctGregorianMEFrench;
PE_DCT_GREGORIANARABICCALENDAR : FCalendarType := ctGregorianArabic;
PE_DCT_GREGORIANXLITENGLISHCALENDAR : FCalendarType := ctGregorianTransEnglish;
PE_DCT_GREGORIANXLITFRENCHCALENDAR : FCalendarType := ctGregorianTransFrench;
else
FCalendarType := ctGregorian;
end;
end;
{------------------------------------------------------------------------------}
{ GetPrefixSeparator }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetPrefixSeparator : string;
var
ValueInfo : PEValueInfo;
begin
Result := FPrefixSeparator;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{PrefixSeparator}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_PREFIX_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetPrefixSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_PREFIX_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetPrefixSeparator <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FPrefixSeparator := String(ValueInfo.viString);
end;
{------------------------------------------------------------------------------}
{ GetSuffixSeparator }
{------------------------------------------------------------------------------}
function TCrpeDateFormat.GetSuffixSeparator : string;
var
ValueInfo : PEValueInfo;
begin
Result := FSuffixSeparator;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
{SuffixSeparator}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_SUFFIX_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuffixSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_SUFFIX_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuffixSeparator <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FSuffixSeparator := String(ValueInfo.viString);
end;
{------------------------------------------------------------------------------}
{ SetDateType }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetDateType (const Value: TCrDateType);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FDateType := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_WINDOWS_DEFAULT_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_WINDOWS_DEFAULT_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateType <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FDateType) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FDateType);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_WINDOWS_DEFAULT_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateType <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_WINDOWS_DEFAULT_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateType <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDateOrder }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetDateOrder (const Value: TCrDateOrder);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FDateOrder := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_ORDER, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateOrder <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_ORDER, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateOrder <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FDateOrder) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FDateOrder);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_ORDER, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateOrder <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_ORDER, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateOrder <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetYearFormat }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetYearFormat (const Value: TCrYearFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FYearFormat := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_YEAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetYearFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_YEAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetYearFormat <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FYearFormat) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FYearFormat);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_YEAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetYearFormat <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_YEAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetYearFormat <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetMonthFormat }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetMonthFormat (const Value: TCrMonthFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FMonthFormat := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MONTH_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMonthFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MONTH_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMonthFormat <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FMonthFormat) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FMonthFormat);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MONTH_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMonthFormat <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MONTH_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMonthFormat <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDayFormat }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetDayFormat (const Value: TCrDayFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FDayFormat := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayFormat <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayFormat <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FDayFormat) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FDayFormat);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayFormat <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayFormat <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDayOfWeekType }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetDayOfWeekType (const Value: TCrDayOfWeekType);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FDayOfWeekType := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekType <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FDayOfWeekType) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FDayOfWeekType);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekType <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekType <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetFirstSeparator }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetFirstSeparator (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FFirstSeparator := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_FIRST_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFirstSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_FIRST_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFirstSeparator <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FFirstSeparator) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FFirstSeparator));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_FIRST_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFirstSeparator <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_FIRST_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFirstSeparator <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetSecondSeparator }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetSecondSeparator (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FSecondSeparator := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_SECOND_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSecondSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_SECOND_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSecondSeparator <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FSecondSeparator) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FSecondSeparator));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_SECOND_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSecondSeparator <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_SECOND_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSecondSeparator <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDayOfWeekSeparator }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetDayOfWeekSeparator (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FDayOfWeekSeparator := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekSeparator <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FDayOfWeekSeparator) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FDayOfWeekSeparator));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekSeparator <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekSeparator <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDayOfWeekPosition }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetDayOfWeekPosition (const Value: TCrDayOfWeekPosition);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FDayOfWeekPosition := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_POSITION, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekPosition <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_POSITION,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekPosition <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FDayOfWeekPosition) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FDayOfWeekPosition);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_POSITION, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekPosition <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_POSITION,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekPosition <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDayOfWeekEnclosure }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetDayOfWeekEnclosure (const Value: TCrDayOfWeekEnclosure);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FDayOfWeekEnclosure := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_ENCLOSURE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekEnclosure <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_ENCLOSURE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekEnclosure <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FDayOfWeekEnclosure) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FDayOfWeekEnclosure);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DAY_OF_WEEK_ENCLOSURE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekEnclosure <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DAY_OF_WEEK_ENCLOSURE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDayOfWeekEnclosure <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDateEra }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetDateEra (const Value: TCrDateEra);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FDateEra := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_ERA_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateEra <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_ERA_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateEra <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FDateEra) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FDateEra);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_ERA_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateEra <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_ERA_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDateEra <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetCalendarType }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetCalendarType (const Value: TCrCalendarType);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FCalendarType := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_CALENDAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCalendarType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_CALENDAR_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCalendarType <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> (Ord(FCalendarType) + 1) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := (Ord(FCalendarType) + 1);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_CALENDAR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCalendarType <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_CALENDAR_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCalendarType <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetPrefixSeparator }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetPrefixSeparator (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FPrefixSeparator := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_PREFIX_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetPrefixSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_PREFIX_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetPrefixSeparator <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FPrefixSeparator) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FPrefixSeparator));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_PREFIX_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetPrefixSeparator <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_PREFIX_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetPrefixSeparator <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetSuffixSeparator }
{------------------------------------------------------------------------------}
procedure TCrpeDateFormat.SetSuffixSeparator (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FSuffixSeparator := Value;
if FFieldType <> fvDate then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_SUFFIX_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuffixSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_SUFFIX_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuffixSeparator <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FSuffixSeparator) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FSuffixSeparator));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_SUFFIX_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuffixSeparator <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_SUFFIX_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuffixSeparator <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeTimeFormat }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeTimeFormat.Create;
begin
inherited Create;
FTimeBase := tf12Hour;
FAmPmPosition := ampmAfter;
FHourType := tfNoLeadingZero;
FMinuteType := tfNumeric;
FSecondType := tfNumeric;
FAMString := 'AM';
FPMString := 'PM';
FHourMinSeparator := ':';
FMinSecSeparator := ':';
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
FTimeBase := tf12Hour;
FAmPmPosition := ampmAfter;
FHourType := tfNoLeadingZero;
FMinuteType := tfNumeric;
FSecondType := tfNumeric;
FAMString := 'AM';
FPMString := 'PM';
FHourMinSeparator := ':';
FMinSecSeparator := ':';
end;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.Assign(Source: TPersistent);
begin
if Source is TCrpeTimeFormat then
begin
TimeBase := TCrpeTimeFormat(Source).TimeBase;
AmPmPosition := TCrpeTimeFormat(Source).AmPmPosition;
HourType := TCrpeTimeFormat(Source).HourType;
MinuteType := TCrpeTimeFormat(Source).MinuteType;
SecondType := TCrpeTimeFormat(Source).SecondType;
AMString := TCrpeTimeFormat(Source).AMString;
PMString := TCrpeTimeFormat(Source).PMString;
HourMinSeparator := TCrpeTimeFormat(Source).HourMinSeparator;
MinSecSeparator := TCrpeTimeFormat(Source).MinSecSeparator;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then Exit;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ GetFormat }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.GetFormat;
begin
GetTimeBase;
GetAmPmPosition;
GetHourType;
GetMinuteType;
GetSecondType;
GetAMString;
GetPMString;
GetHourMinSeparator;
GetMinSecSeparator;
end;
{------------------------------------------------------------------------------}
{ GetTimeBase }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetTimeBase : TCrTimeBase;
var
ValueInfo : PEValueInfo;
begin
Result := FTimeBase;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{TimeBase}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TIME_BASE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTimeBase <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TIME_BASE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTimeBase <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_TB_12_HOUR : FTimeBase := tf12Hour;
PE_TB_24_HOUR : FTimeBase := tf24Hour;
else
FTimeBase := tf12Hour;
end;
Result := FTimeBase;
end;
{------------------------------------------------------------------------------}
{ GetAmPmPosition }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetAmPmPosition : TCrAmPmPosition;
var
ValueInfo : PEValueInfo;
begin
Result := FAmPmPosition;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{AmPmPosition}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_AM_PM_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAmPmPosition <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_AM_PM_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAmPmPosition <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_TAPT_AM_PM_BEFORE : FAmPmPosition := ampmBefore;
PE_TAPT_AM_PM_AFTER : FAmPmPosition := ampmAfter;
else
FAmPmPosition := ampmAfter;
end;
Result := FAmPmPosition;
end;
{------------------------------------------------------------------------------}
{ GetHourType }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetHourType : TCrTimeFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FHourType;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{HourType}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HOUR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetHourType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HOUR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetHourType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_THT_NUMERIC_HOUR : FHourType := tfNumeric;
PE_THT_NUMBERIC_HOUR_NO_LEADING_ZERO : FHourType := tfNoLeadingZero;
PE_THT_NO_HOUR : FHourType := tfNone;
else
FHourType := tfNoLeadingZero;
end;
Result := FHourType;
end;
{------------------------------------------------------------------------------}
{ GetMinuteType }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetMinuteType : TCrTimeFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FMinuteType;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{MinuteType}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MINUTE_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetMinuteType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MINUTE_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetMinuteType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_TMT_NUMERIC_MINUTE : FMinuteType := tfNumeric;
PE_TMT_NUMERIC_MINUTE_NO_LEADING_ZERO : FMinuteType := tfNoLeadingZero;
PE_TMT_NO_MINUTE : FMinuteType := tfNone;
else
FMinuteType := tfNumeric;
end;
Result := FMinuteType;
end;
{------------------------------------------------------------------------------}
{ GetSecondType }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetSecondType : TCrTimeFormat;
var
ValueInfo : PEValueInfo;
begin
Result := FSecondType;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{SecondType}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SECOND_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSecondType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SECOND_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSecondType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_TST_NUMERIC_SECOND : FSecondType := tfNumeric;
PE_TST_NUMERIC_SECOND_NO_LEADING_ZERO : FSecondType := tfNoLeadingZero;
PE_TST_NUMERIC_NO_SECOND : FSecondType := tfNone;
else
FSecondType := tfNumeric;
end;
Result := FSecondType;
end;
{------------------------------------------------------------------------------}
{ GetAMString }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetAMString : string;
var
ValueInfo : PEValueInfo;
begin
Result := FAmString;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{AMString}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_AM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAMString <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_AM_STRING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAMString <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FAMString := String(ValueInfo.viString);
Result := FAMString;
end;
{------------------------------------------------------------------------------}
{ GetPMString }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetPMString : string;
var
ValueInfo : PEValueInfo;
begin
Result := FPMString;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{PMString}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_PM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetPMString <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_PM_STRING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetPMString <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FPMString := String(ValueInfo.viString);
Result := FPMString;
end;
{------------------------------------------------------------------------------}
{ GetHourMinSeparator }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetHourMinSeparator : string;
var
ValueInfo : PEValueInfo;
begin
Result := FHourMinSeparator;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{HourMinSeparator}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HOUR_MINUTE_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetHourMinSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HOUR_MINUTE_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetHourMinSeparator <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FHourMinSeparator := String(ValueInfo.viString);
Result := FHourMinSeparator;
end;
{------------------------------------------------------------------------------}
{ GetMinSecSeparator }
{------------------------------------------------------------------------------}
function TCrpeTimeFormat.GetMinSecSeparator : string;
var
ValueInfo : PEValueInfo;
begin
Result := FMinSecSeparator;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
{MinSecSeparator}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MINUTE_SECOND_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetMinSecSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MINUTE_SECOND_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetMinSecSeparator <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FMinSecSeparator := String(ValueInfo.viString);
Result := FMinSecSeparator;
end;
{------------------------------------------------------------------------------}
{ SetTimeBase }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetTimeBase (const Value: TCrTimeBase);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FTimeBase := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TIME_BASE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTimeBase <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TIME_BASE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTimeBase <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FTimeBase) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FTimeBase);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TIME_BASE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTimeBase <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TIME_BASE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTimeBase <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetAmPmPosition }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetAmPmPosition (const Value: TCrAmPmPosition);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FAmPmPosition := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_AM_PM_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAmPmPosition <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_AM_PM_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAmPmPosition <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FAmPmPosition) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FAmPmPosition);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_AM_PM_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAmPmPosition <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_AM_PM_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAmPmPosition <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetHourType }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetHourType (const Value: TCrTimeFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FHourType := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HOUR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHourType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HOUR_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHourType <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FHourType) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FHourType);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HOUR_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHourType <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HOUR_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHourType <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetMinuteType }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetMinuteType (const Value: TCrTimeFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FMinuteType := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MINUTE_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMinuteType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MINUTE_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMinuteType <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FMinuteType) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FMinuteType);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MINUTE_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMinuteType <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MINUTE_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMinuteType <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetSecondType }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetSecondType (const Value: TCrTimeFormat);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FSecondType := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SECOND_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSecondType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SECOND_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSecondType <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FSecondType) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FSecondType);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SECOND_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSecondType <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SECOND_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSecondType <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetAMString }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetAMString (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FAMString := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_AM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAMString <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_AM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAMString <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FAMString) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FAMString));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_AM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAMString <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_AM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAMString <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetPMString }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetPMString (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FPMString := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_PM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetPMString <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_PM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetPMString <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FPMString) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FPMString));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_PM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetPMString <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_PM_STRING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetPMString <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetHourMinSeparator }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetHourMinSeparator (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FHourMinSeparator := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HOUR_MINUTE_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHourMinSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HOUR_MINUTE_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHourMinSeparator <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FHourMinSeparator) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FHourMinSeparator));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HOUR_MINUTE_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHourMinSeparator <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HOUR_MINUTE_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHourMinSeparator <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetMinSecSeparator }
{------------------------------------------------------------------------------}
procedure TCrpeTimeFormat.SetMinSecSeparator (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FMinSecSeparator := Value;
if FFieldType <> fvTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MINUTE_SECOND_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMinSecSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MINUTE_SECOND_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMinSecSeparator <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FMinSecSeparator) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FMinSecSeparator));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MINUTE_SECOND_SEPARATOR, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMinSecSeparator <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MINUTE_SECOND_SEPARATOR,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMinSecSeparator <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeDateTimeFormat }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeDateTimeFormat.Create;
begin
inherited Create;
FOrder := dtoDateTime;
FSeparator := '';
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeDateTimeFormat.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
FOrder := dtoDateTime;
FSeparator := '';
end;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeDateTimeFormat.Assign(Source: TPersistent);
begin
if Source is TCrpeDateTimeFormat then
begin
Order := TCrpeDateTimeFormat(Source).Order;
Separator := TCrpeDateTimeFormat(Source).Separator;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeDateTimeFormat.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then Exit;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ GetFormat }
{------------------------------------------------------------------------------}
procedure TCrpeDateTimeFormat.GetFormat;
begin
GetOrder;
GetSeparator;
end;
{------------------------------------------------------------------------------}
{ GetOrder }
{------------------------------------------------------------------------------}
function TCrpeDateTimeFormat.GetOrder : TCrDateTimeOrder;
var
ValueInfo : PEValueInfo;
begin
Result := FOrder;
if FFieldType <> fvDateTime then Exit;
if not StatusIsGo then Exit;
{DateTimeOrder}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_TIME_ORDER, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetOrder <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_TIME_ORDER, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetOrder <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_DTO_DATE_THEN_TIME : FOrder := dtoDateTime;
PE_DTO_TIME_THEN_DATE : FOrder := dtoTimeDate;
PE_DTO_DATE_ONLY : FOrder := dtoDate;
PE_DTO_TIME_ONLY : FOrder := dtoTime;
else
FOrder := dtoDateTime;
end;
Result := FOrder;
end;
{------------------------------------------------------------------------------}
{ GetSeparator }
{------------------------------------------------------------------------------}
function TCrpeDateTimeFormat.GetSeparator : string;
var
ValueInfo : PEValueInfo;
begin
Result := FSeparator;
if FFieldType <> fvDateTime then Exit;
if not StatusIsGo then Exit;
{DateTimeSeparator}
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_TIME_SEPARATOR_STRING, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_TIME_SEPARATOR_STRING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSeparator <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FSeparator := String(ValueInfo.viString);
Result := FSeparator;
end;
{------------------------------------------------------------------------------}
{ SetOrder }
{------------------------------------------------------------------------------}
procedure TCrpeDateTimeFormat.SetOrder (const Value: TCrDateTimeOrder);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FOrder := Value;
if FFieldType <> fvDateTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_TIME_ORDER, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetOrder <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_TIME_ORDER,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetOrder <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FOrder) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FOrder);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_TIME_ORDER, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetOrder <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_TIME_ORDER,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetOrder <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDateTimeSeparator }
{------------------------------------------------------------------------------}
procedure TCrpeDateTimeFormat.SetSeparator (const Value: string);
var
ValueInfo : PEValueInfo;
s1 : string;
Changed : Boolean;
begin
FSeparator := Value;
if FFieldType <> fvDateTime then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_TIME_SEPARATOR_STRING, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSeparator <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_TIME_SEPARATOR_STRING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSeparator <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
s1 := String(ValueInfo.viString);
if CompareStr(s1, FSeparator) <> 0 then
Changed := True;
if Changed then
begin
StrCopy(ValueInfo.viString, PChar(FSeparator));
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DATE_TIME_SEPARATOR_STRING, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSeparator <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_DATE_TIME_SEPARATOR_STRING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSeparator <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeParagraphFormat }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeParagraphFormat.Create;
begin
inherited Create;
FIndentFirstLine := 0; {are these integer..or?}
FIndentLeft := 0;
FIndentRight := 0;
FTextInterpretation := tiNone;
FLineSpacingType := lsMultiple;
FLineSpacing := 1; {N lines, can be fraction - 1.5, etc.}
FCharacterSpacing := 0; {in points}
FForEmbeddedField := False;
FForTextObject := False;
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
FIndentFirstLine := 0; {are these integer..or?}
FIndentLeft := 0;
FIndentRight := 0;
FTextInterpretation := tiNone;
FLineSpacingType := lsMultiple;
FLineSpacing := 1; {N lines, can be fraction - 1.5, etc.}
FCharacterSpacing := 0; {in points}
end;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.Assign(Source: TPersistent);
begin
if Source is TCrpeParagraphFormat then
begin
IndentFirstLine := TCrpeParagraphFormat(Source).IndentFirstLine;
IndentLeft := TCrpeParagraphFormat(Source).IndentLeft;
IndentRight := TCrpeParagraphFormat(Source).IndentRight;
TextInterpretation := TCrpeParagraphFormat(Source).TextInterpretation;
LineSpacingType := TCrpeParagraphFormat(Source).LineSpacingType;
LineSpacing := TCrpeParagraphFormat(Source).LineSpacing;
CharacterSpacing := TCrpeParagraphFormat(Source).CharacterSpacing;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeParagraphFormat.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then Exit;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ SetFieldType }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.SetFieldType(FType: TCrFieldValueType);
begin
FFieldType := FType;
end;
{------------------------------------------------------------------------------}
{ GetFormat }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.GetFormat;
begin
GetIndentFirstLine;
GetIndentLeft;
GetIndentRight;
GetTextInterpretation;
GetLineSpacingType;
GetLineSpacing;
GetCharacterSpacing;
end;
{------------------------------------------------------------------------------}
{ GetIndentFirstLine }
{------------------------------------------------------------------------------}
function TCrpeParagraphFormat.GetIndentFirstLine : integer;
var
ValueInfo : PEValueInfo;
TObjItem : TCrpeTextObjectsItem;
begin
Result := FIndentFirstLine;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
ValueInfo.valueType := PE_PF_INTEGER;
{ShowMessage: Cannot be retrieved..Print Engine error/bug}
{FirstLineIndent}
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_FIRST_LINE_INDENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetFirstLineIndent <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
begin if not (Parent.Parent is TCrpeTextObjectsItem) then Exit;
TObjItem := TCrpeTextObjectsItem(Parent.Parent);
if TObjItem.Paragraphs.Count = 0 then Exit;
ValueInfo.viInteger := TObjItem.Paragraphs[0].IndentFirstLine;
end
else
begin if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_FIRST_LINE_INDENT,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetFirstLineIndent <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
FIndentFirstLine := ValueInfo.viInteger;
Result := FIndentFirstLine;
end;
{------------------------------------------------------------------------------}
{ SetIndentFirstLine }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.SetIndentFirstLine (const Value: integer);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
TObjItem : TCrpeTextObjectsItem;
begin
FIndentFirstLine := Value;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
TObjItem := nil;
Changed := False;
ValueInfo.valueType := PE_PF_INTEGER;
{ Cannot be retrieved - Print Engine bug }
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_FIRST_LINE_INDENT, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFirstLineIndent <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
begin if not (Parent.Parent is TCrpeTextObjectsItem) then Exit;
TObjItem := TCrpeTextObjectsItem(Parent.Parent);
if TObjItem.Paragraphs.Count = 0 then Exit;
ValueInfo.viInteger := TObjItem.Paragraphs[0].IndentFirstLine;
end
else
begin if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_FIRST_LINE_INDENT,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFirstLineIndent <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> FIndentFirstLine then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := FIndentFirstLine;
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_FIRST_LINE_INDENT, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFirstLineIndent <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
TObjItem.Paragraphs[0].SetIndentFirstLine(ValueInfo.viInteger)
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_FIRST_LINE_INDENT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFirstLineIndent <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetIndentLeft }
{------------------------------------------------------------------------------}
function TCrpeParagraphFormat.GetIndentLeft : integer;
var
ValueInfo : PEValueInfo;
TObjItem : TCrpeTextObjectsItem;
begin
Result := FIndentLeft;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
ValueInfo.valueType := PE_PF_INTEGER;
{ShowMessage: Cannot be retrieved..Print Engine error/bug}
{LeftIndent}
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LEFT_INDENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLeftIndent <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
begin if not (Parent.Parent is TCrpeTextObjectsItem) then Exit;
TObjItem := TCrpeTextObjectsItem(Parent.Parent);
if TObjItem.Paragraphs.Count = 0 then Exit;
ValueInfo.viInteger := TObjItem.Paragraphs[0].IndentLeft;
end
else
begin if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LEFT_INDENT,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLeftIndent <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
FIndentLeft := ValueInfo.viInteger;
Result := FIndentLeft;
end;
{------------------------------------------------------------------------------}
{ SetIndentLeft }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.SetIndentLeft (const Value: integer);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
TObjItem : TCrpeTextObjectsItem;
begin
FIndentLeft := Value;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
TObjItem := nil;
Changed := False;
ValueInfo.valueType := PE_PF_INTEGER;
{ Cannot be retrieved - Print Engine bug }
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LEFT_INDENT, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeftIndent <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
begin
if not (Parent.Parent is TCrpeTextObjectsItem) then Exit;
TObjItem := TCrpeTextObjectsItem(Parent.Parent);
if TObjItem.Paragraphs.Count = 0 then Exit;
ValueInfo.viInteger := TObjItem.Paragraphs[0].IndentLeft;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LEFT_INDENT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeftIndent <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> FIndentLeft then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := FIndentLeft;
if FForEmbeddedField then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LEFT_INDENT, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeftIndent <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
TObjItem.Paragraphs[0].SetIndentLeft(ValueInfo.viInteger)
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LEFT_INDENT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeftIndent <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetIndentRight }
{------------------------------------------------------------------------------}
function TCrpeParagraphFormat.GetIndentRight : integer;
var
ValueInfo : PEValueInfo;
TObjItem : TCrpeTextObjectsItem;
begin
Result := FIndentRight;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
ValueInfo.valueType := PE_PF_INTEGER;
{ShowMessage: Cannot be retrieved..Print Engine error/bug}
{RightIndent}
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_RIGHT_INDENT, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetRightIndent <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
begin
if not (Parent.Parent is TCrpeTextObjectsItem) then Exit;
TObjItem := TCrpeTextObjectsItem(Parent.Parent);
if TObjItem.Paragraphs.Count = 0 then Exit;
ValueInfo.viInteger := TObjItem.Paragraphs[0].IndentRight;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_RIGHT_INDENT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetRightIndent <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
FIndentRight := ValueInfo.viInteger;
Result := FIndentRight;
end;
{------------------------------------------------------------------------------}
{ SetIndentRight }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.SetIndentRight (const Value: integer);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
TObjItem : TCrpeTextObjectsItem;
begin
FIndentRight := Value;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
TObjItem := nil;
Changed := False;
ValueInfo.valueType := PE_PF_INTEGER;
{ Cannot be retrieved - Print Engine bug }
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_RIGHT_INDENT, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRightIndent <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
begin
if not (Parent.Parent is TCrpeTextObjectsItem) then Exit;
TObjItem := TCrpeTextObjectsItem(Parent.Parent);
if TObjItem.Paragraphs.Count = 0 then Exit;
ValueInfo.viInteger := TObjItem.Paragraphs[0].IndentRight;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_RIGHT_INDENT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRightIndent <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> FIndentRight then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := FIndentRight;
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_RIGHT_INDENT, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRightIndent <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if FForTextObject then
begin
TObjItem.Paragraphs[0].SetIndentRight(ValueInfo.viInteger);
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_RIGHT_INDENT,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRightIndent <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetTextInterpretation }
{------------------------------------------------------------------------------}
function TCrpeParagraphFormat.GetTextInterpretation : TCrTextInterpretation;
var
ValueInfo : PEValueInfo;
begin
Result := FTextInterpretation;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if FForTextObject = True then Exit;
if not StatusIsGo then Exit;
{TextInterpretation}
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TEXT_INTERPRETATION, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTextInterpretation <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TEXT_INTERPRETATION,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTextInterpretation <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_TI_NONE : FTextInterpretation := tiNone;
PE_TI_RTF : FTextInterpretation := tiRTF;
PE_TI_HTML : FTextInterpretation := tiHTML;
else
FTextInterpretation := tiNone;
end;
Result := FTextInterpretation;
end;
{------------------------------------------------------------------------------}
{ SetTextInterpretation }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.SetTextInterpretation (const Value: TCrTextInterpretation);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FTextInterpretation := Value;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if FForTextObject = True then Exit;
if not StatusIsGo then Exit;
Changed := False;
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TEXT_INTERPRETATION, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTextInterpretation <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TEXT_INTERPRETATION,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTextInterpretation <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FTextInterpretation) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FTextInterpretation);
if FForEmbeddedField then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TEXT_INTERPRETATION, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTextInterpretation <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TEXT_INTERPRETATION,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTextInterpretation <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetLineSpacingType }
{------------------------------------------------------------------------------}
function TCrpeParagraphFormat.GetLineSpacingType : TCrLineSpacingType;
var
ValueInfo : PEValueInfo;
begin
Result := FLineSpacingType;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
{LineSpacingType}
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LINE_SPACING_TYPE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLineSpacingType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LINE_SPACING_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLineSpacingType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FLineSpacingType := lsMultiple;
case ValueInfo.viInteger of
PE_LSPC_EXACT : FLineSpacingType := lsExact;
PE_LSPC_MULTIPLE : FLineSpacingType := lsMultiple;
end;
Result := FLineSpacingType;
end;
{------------------------------------------------------------------------------}
{ SetLineSpacingType }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.SetLineSpacingType (const Value: TCrLineSpacingType);
var
ValueInfo : PEValueInfo;
iLineSpacing : Smallint;
Changed : Boolean;
begin
FLineSpacingType := Value;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LINE_SPACING_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLineSpacingType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LINE_SPACING_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLineSpacingType <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
iLineSpacing := PE_LSPC_MULTIPLE;
case FLineSpacingType of
lsMultiple : iLineSpacing := PE_LSPC_MULTIPLE;
lsExact : iLineSpacing := PE_LSPC_EXACT;
end;
if ValueInfo.viInteger <> iLineSpacing then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := iLineSpacing;
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LINE_SPACING_TYPE, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLineSpacingType <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LINE_SPACING_TYPE,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLineSpacingType <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetLineSpacing }
{------------------------------------------------------------------------------}
function TCrpeParagraphFormat.GetLineSpacing : double;
var
ValueInfo : PEValueInfo;
begin
Result := FLineSpacing;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
{LineSpacing}
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LINE_SPACING, ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLineSpacing <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LINE_SPACING,
ValueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLineSpacing <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{ShowMessage: bug when LineSpacingType is Exact: 65536 * FLineSpacing!
Cannot set LineSpacing when Type is Exact either. Therefore leaving Type to
Exact will cause Page Overflow error}
FLineSpacing := ValueInfo.viNumber;
Result := FLineSpacing;
end;
{------------------------------------------------------------------------------}
{ SetLineSpacing }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.SetLineSpacing (const Value: double);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FLineSpacing := Value;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LINE_SPACING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLineSpacing <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LINE_SPACING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLineSpacing <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viNumber <> FLineSpacing then
Changed := True;
if Changed then
begin
ValueInfo.viNumber := FLineSpacing;
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LINE_SPACING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLineSpacing <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_LINE_SPACING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLineSpacing <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetCharacterSpacing }
{------------------------------------------------------------------------------}
function TCrpeParagraphFormat.GetCharacterSpacing : double;
var
ValueInfo : PEValueInfo;
begin
Result := FCharacterSpacing;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
{CharacterSpacing}
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CHARACTER_SPACING, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCharacterSpacing <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CHARACTER_SPACING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCharacterSpacing <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FCharacterSpacing := TwipsToPoints(ValueInfo.viLong);
Result := FCharacterSpacing;
end;
{------------------------------------------------------------------------------}
{ SetCharacterSpacing }
{------------------------------------------------------------------------------}
procedure TCrpeParagraphFormat.SetCharacterSpacing (const Value: double);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FCharacterSpacing := Value;
if not (FFieldType in [fvString..fvPersistentMemo]) then Exit;
if not StatusIsGo then Exit;
Changed := False;
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CHARACTER_SPACING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCharacterSpacing <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CHARACTER_SPACING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCharacterSpacing <PEGetObjectFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if CompareTwipsToPoints(ValueInfo.viLong, FCharacterSpacing) then
Changed := True;
if Changed then
begin
ValueInfo.viLong := PointsToTwips(FCharacterSpacing);
if FForEmbeddedField then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_CHARACTER_SPACING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCharacterSpacing <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_CHARACTER_SPACING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCharacterSpacing <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeFieldFormatFormulas }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeFieldFormatFormulas.Create;
begin
inherited Create;
FName := ffnFontColor; {Set it to something that applies to all field types}
FFormula := TStringList.Create;
xFormula := TStringList.Create;
TStringList(FFormula).OnChange := OnChangeStrings;
end;
{------------------------------------------------------------------------------}
{ Destructor Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFieldFormatFormulas.Destroy;
begin
TStringList(FFormula).OnChange := nil;
FFormula.Free;
xFormula.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormatFormulas.Assign(Source: TPersistent);
begin
if Source is TCrpeFieldFormatFormulas then
begin
case FFieldType of
fvInt8s..fvCurrency :
begin {SuppressIfZero}
Name := ffnSuppressIfZero;
TCrpeFieldFormatFormulas(Source).Name := ffnSuppressIfZero;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{NegativeFormat}
Name := ffnNegativeFormat;
TCrpeFieldFormatFormulas(Source).Name := ffnNegativeFormat;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{UseThousandsSeparators}
Name := ffnUseThousandsSeparators;
TCrpeFieldFormatFormulas(Source).Name := ffnUseThousandsSeparators;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{UseLeadingZero}
Name := ffnUseLeadingZero;
TCrpeFieldFormatFormulas(Source).Name := ffnUseLeadingZero;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DecimalPlaces}
Name := ffnDecimalPlaces;
TCrpeFieldFormatFormulas(Source).Name := ffnDecimalPlaces;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{RoundingFormat}
Name := ffnRoundingFormat;
TCrpeFieldFormatFormulas(Source).Name := ffnRoundingFormat;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{CurrencySymbolFormat}
Name := ffnCurrencySymbolFormat;
TCrpeFieldFormatFormulas(Source).Name := ffnCurrencySymbolFormat;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{OneCurrencySymbolPerPage}
Name := ffnOneCurrencySymbolPerPage;
TCrpeFieldFormatFormulas(Source).Name := ffnOneCurrencySymbolPerPage;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{CurrencySymbolPosition}
Name := ffnCurrencySymbolPosition;
TCrpeFieldFormatFormulas(Source).Name := ffnCurrencySymbolPosition;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{ThousandSymbol}
Name := ffnThousandSymbol;
TCrpeFieldFormatFormulas(Source).Name := ffnThousandSymbol;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DecimalSymbol}
Name := ffnDecimalSymbol;
TCrpeFieldFormatFormulas(Source).Name := ffnDecimalSymbol;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{CurrencySymbol}
Name := ffnCurrencySymbol;
TCrpeFieldFormatFormulas(Source).Name := ffnCurrencySymbol;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{ReverseSignForDisplay}
Name := ffnReverseSignForDisplay;
TCrpeFieldFormatFormulas(Source).Name := ffnReverseSignForDisplay;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
end;
fvBoolean :
begin {BooleanType}
Name := ffnBooleanType;
TCrpeFieldFormatFormulas(Source).Name := ffnBooleanType;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
end;
fvDate :
begin {DateType}
Name := ffnDateType;
TCrpeFieldFormatFormulas(Source).Name := ffnDateType;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DateOrder}
Name := ffnDateOrder;
TCrpeFieldFormatFormulas(Source).Name := ffnDateOrder;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{YearFormat}
Name := ffnYearFormat;
TCrpeFieldFormatFormulas(Source).Name := ffnYearFormat;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{MonthFormat}
Name := ffnMonthFormat;
TCrpeFieldFormatFormulas(Source).Name := ffnMonthFormat;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DayFormat}
Name := ffnDayFormat;
TCrpeFieldFormatFormulas(Source).Name := ffnDayFormat;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{FirstDateSeparator}
Name := ffnFirstDateSeparator;
TCrpeFieldFormatFormulas(Source).Name := ffnFirstDateSeparator;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{SecondDateSeparator}
Name := ffnSecondDateSeparator;
TCrpeFieldFormatFormulas(Source).Name := ffnSecondDateSeparator;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DayOfWeekType}
Name := ffnDayOfWeekType;
TCrpeFieldFormatFormulas(Source).Name := ffnDayOfWeekType;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DayOfWeekSeparator}
Name := ffnDayOfWeekSeparator;
TCrpeFieldFormatFormulas(Source).Name := ffnDayOfWeekSeparator;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DayOfWeekPosition}
Name := ffnDayOfWeekPosition;
TCrpeFieldFormatFormulas(Source).Name := ffnDayOfWeekPosition;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DateEraFormat}
Name := ffnDateEraFormat;
TCrpeFieldFormatFormulas(Source).Name := ffnDateEraFormat;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{CalendarType}
Name := ffnCalendarType;
TCrpeFieldFormatFormulas(Source).Name := ffnCalendarType;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{PrefixSeparator}
Name := ffnPrefixSeparator;
TCrpeFieldFormatFormulas(Source).Name := ffnPrefixSeparator;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{SuffixSeparator}
Name := ffnSuffixSeparator;
TCrpeFieldFormatFormulas(Source).Name := ffnSuffixSeparator;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DayOfWeekEnclosure}
Name := ffnDayOfWeekEnclosure;
TCrpeFieldFormatFormulas(Source).Name := ffnDayOfWeekEnclosure;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
end;
fvTime :
begin {TimeBase}
Name := ffnTimeBase;
TCrpeFieldFormatFormulas(Source).Name := ffnTimeBase;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{AmPmPosition}
Name := ffnAmPmPosition;
TCrpeFieldFormatFormulas(Source).Name := ffnAmPmPosition;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{HourType}
Name := ffnHourType;
TCrpeFieldFormatFormulas(Source).Name := ffnHourType;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{MinuteType}
Name := ffnMinuteType;
TCrpeFieldFormatFormulas(Source).Name := ffnMinuteType;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{SecondType}
Name := ffnSecondType;
TCrpeFieldFormatFormulas(Source).Name := ffnSecondType;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{HourMinSeparator}
Name := ffnHourMinSeparator;
TCrpeFieldFormatFormulas(Source).Name := ffnHourMinSeparator;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{MinSecSeparator}
Name := ffnMinSecSeparator;
TCrpeFieldFormatFormulas(Source).Name := ffnMinSecSeparator;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{AMString}
Name := ffnAMString;
TCrpeFieldFormatFormulas(Source).Name := ffnAMString;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{PMString}
Name := ffnPMString;
TCrpeFieldFormatFormulas(Source).Name := ffnPMString;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
end;
fvString :
begin {FirstLineIndent}
Name := ffnFirstLineIndent;
TCrpeFieldFormatFormulas(Source).Name := ffnFirstLineIndent;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{LeftIndent}
Name := ffnLeftIndent;
TCrpeFieldFormatFormulas(Source).Name := ffnLeftIndent;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{RightIndent}
Name := ffnRightIndent;
TCrpeFieldFormatFormulas(Source).Name := ffnRightIndent;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{TextInterpretation}
Name := ffnTextInterpretation;
TCrpeFieldFormatFormulas(Source).Name := ffnTextInterpretation;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
end;
fvDateTime :
begin {DateTimeOrder}
Name := ffnDateTimeOrder;
TCrpeFieldFormatFormulas(Source).Name := ffnDateTimeOrder;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
{DateTimeSeparator}
Name := ffnDateTimeSeparator;
TCrpeFieldFormatFormulas(Source).Name := ffnDateTimeSeparator;
Formula.Assign(TCrpeFieldFormatFormulas(Source).Formula);
end;
end;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormatFormulas.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
FName := ffnFontColor;
FFormula.Clear;
xFormula.Clear;
end
else
begin
xFormula.Clear;
SetFormula(xFormula);
end;
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeFieldFormatFormulas.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then Exit;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ OnChangeStrings }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormatFormulas.OnChangeStrings(Sender: TObject);
begin
TStringList(FFormula).OnChange := nil;
xFormula.Assign(FFormula);
SetFormula(xFormula);
TStringList(FFormula).OnChange := OnChangeStrings;
end;
{------------------------------------------------------------------------------}
{ GetFormula }
{------------------------------------------------------------------------------}
function TCrpeFieldFormatFormulas.GetFormula : TStrings;
var
iName : Smallint;
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FFormula;
if not StatusIsGo then Exit;
iName := TCrpe(Cx).ConvertFormulaName(FName);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, iName, hText, iText) then
begin TStringList(FFormula).OnChange := OnChangeStrings;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetFormula - ' +
GetEnumName(TypeInfo(TCrFormatFormulaName), Ord(FName)) +
' <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle, iName, hText, iText) then
begin TStringList(FFormula).OnChange := OnChangeStrings;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetFormula - ' +
GetEnumName(TypeInfo(TCrFormatFormulaName), Ord(FName)) +
' <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FFormula.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FFormula;
end;
{------------------------------------------------------------------------------}
{ SetFormula }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormatFormulas.SetFormula (const Value: TStrings);
var
iName : Smallint;
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL : string;
sRPT : string;
begin
FFormula.Assign(Value);
if not StatusIsGo then Exit;
iName := TCrpe(Cx).ConvertFormulaName(FName);
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, iName, hText, iText) then
begin TStringList(FFormula).OnChange := OnChangeStrings;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFormula - ' +
GetEnumName(TypeInfo(TCrFormatFormulaName), Ord(FName)) +
' <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle, iName, hText, iText) then
begin TStringList(FFormula).OnChange := OnChangeStrings;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFormula - ' +
GetEnumName(TypeInfo(TCrFormatFormulaName), Ord(FName)) +
' <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FFormula);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, iName, PChar(sVCL)) then
begin TStringList(FFormula).OnChange := OnChangeStrings;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFormula - ' +
GetEnumName(TypeInfo(TCrFormatFormulaName), Ord(FName)) +
' <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle, iName, PChar(sVCL)) then
begin TStringList(FFormula).OnChange := OnChangeStrings;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetFormula - ' +
GetEnumName(TypeInfo(TCrFormatFormulaName), Ord(FName)) +
' <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetName }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormatFormulas.SetName (const Value: TCrFormatFormulaName);
begin
FName := Value;
if not StatusIsGo then Exit;
GetFormula;
end;
{******************************************************************************}
{ Class TCrpeFieldFormat }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeFieldFormat.Create;
begin
inherited Create;
FUseSystemDefaultFormatting := True;
FBooleanType := TrueFalse;
{Number}
FNumber := TCrpeNumberFormat.Create;
FSubClassList.Add(FNumber);
{Date}
FDate := TCrpeDateFormat.Create;
FSubClassList.Add(FDate);
{Time}
FTime := TCrpeTimeFormat.Create;
FSubClassList.Add(FTime);
{DateTime}
FDateTime := TCrpeDateTimeFormat.Create;
FSubClassList.Add(FDateTime);
{Paragraph}
FParagraph := TCrpeParagraphFormat.Create;
FSubClassList.Add(FParagraph);
{Formulas}
FFormulas := TCrpeFieldFormatFormulas.Create;
FSubClassList.Add(FFormulas);
end;
{------------------------------------------------------------------------------}
{ Destructor Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFieldFormat.Destroy;
begin
FNumber.Free;
FDate.Free;
FTime.Free;
FDateTime.Free;
FParagraph.Free;
FFormulas.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormat.Assign(Source: TPersistent);
begin
if Source is TCrpeFieldFormat then
begin
UseSystemDefaultFormatting := TCrpeFieldFormat(Source).UseSystemDefaultFormatting;
{Boolean}
if (TCrpeFieldFormat(Source).FieldType = fvBoolean) and
(FFieldType = fvBoolean) then
BooleanType := TCrpeFieldFormat(Source).BooleanType;
{Number}
if (TCrpeFieldFormat(Source).FieldType in [fvInt8s..fvCurrency]) and
(FFieldType in [fvInt8s..fvCurrency]) then
Number.Assign(TCrpeFieldFormat(Source).Number);
{Date}
if (TCrpeFieldFormat(Source).FieldType = fvDate) and
(FFieldType = fvDate) then
Date.Assign(TCrpeFieldFormat(Source).Date);
{Time}
if (TCrpeFieldFormat(Source).FieldType = fvTime) and
(FFieldType = fvTime) then
Time.Assign(TCrpeFieldFormat(Source).Time);
{DateTime}
if (TCrpeFieldFormat(Source).FieldType = fvDateTime) and
(FFieldType = fvDateTime) then
DateTime.Assign(TCrpeFieldFormat(Source).DateTime);
{Paragraph}
if (TCrpeFieldFormat(Source).FieldType in [fvTransientMemo..fvPersistentMemo]) and
(FFieldType in [fvTransientMemo..fvPersistentMemo]) then
Paragraph.Assign(TCrpeFieldFormat(Source).Paragraph);
{Formulas}
Formulas.Assign(TCrpeFieldFormat(Source).Formulas);
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormat.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
FUseSystemDefaultFormatting := True;
FBooleanType := TrueFalse;
end;
FNumber.Clear;
FDate.Clear;
FTime.Clear;
FDateTime.Clear;
FParagraph.Clear;
FFormulas.Clear;
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeFieldFormat.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then
begin
PropagateHandle(0);
Exit;
end;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ GetUseSystemDefaultFormatting }
{------------------------------------------------------------------------------}
function TCrpeFieldFormat.GetUseSystemDefaultFormatting : Boolean;
var
ValueInfo : PEValueInfo;
begin
Result := FUseSystemDefaultFormatting;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_SYSTEM_DEFAULT_FORMATTING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetUseSystemDefaultFormatting <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_SYSTEM_DEFAULT_FORMATTING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetUseSystemDefaultFormatting <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FUseSystemDefaultFormatting := ValueInfo.viBoolean;
Result := FUseSystemDefaultFormatting;
end;
{------------------------------------------------------------------------------}
{ SetUseSystemDefaultFormatting }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormat.SetUseSystemDefaultFormatting (const Value: Boolean);
var
ValueInfo : PEValueInfo;
begin
FUseSystemDefaultFormatting := Value;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_SYSTEM_DEFAULT_FORMATTING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseSystemDefaultFormatting <PEGetNthEmbeddedFieldFormat>') of
errIgnore : ValueInfo.viBoolean := not FUseSystemDefaultFormatting;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_SYSTEM_DEFAULT_FORMATTING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseSystemDefaultFormatting <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viBoolean <> Bool(FUseSystemDefaultFormatting) then
begin
ValueInfo.viBoolean := Bool(FUseSystemDefaultFormatting);
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_USE_SYSTEM_DEFAULT_FORMATTING, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseSystemDefaultFormatting <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_USE_SYSTEM_DEFAULT_FORMATTING,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetUseSystemDefaultFormatting <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetBooleanType }
{------------------------------------------------------------------------------}
function TCrpeFieldFormat.GetBooleanType : TCrBooleanType;
var
ValueInfo : PEValueInfo;
begin
Result := FBooleanType;
if FFieldType <> fvBoolean then Exit;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BOOLEAN_OUPUT_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBooleanType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_BOOLEAN_OUPUT_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBooleanType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case ValueInfo.viInteger of
PE_BOT_TRUE_OR_FALSE : FBooleanType := TrueFalse;
PE_BOT_T_OR_F : FBooleanType := TF;
PE_BOT_YES_OR_NO : FBooleanType := YesNo;
PE_BOT_Y_OR_N : FBooleanType := YN;
PE_BOT_ONE_OR_ZERO : FBooleanType := OneZero;
else
FBooleanType := TrueFalse;
end;
Result := FBooleanType;
end;
{------------------------------------------------------------------------------}
{ SetBooleanType }
{------------------------------------------------------------------------------}
procedure TCrpeFieldFormat.SetBooleanType (const Value: TCrBooleanType);
var
ValueInfo : PEValueInfo;
Changed : Boolean;
begin
FBooleanType := Value;
if FFieldType <> fvBoolean then Exit;
if not StatusIsGo then Exit;
Changed := False;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BOOLEAN_OUPUT_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBooleanType <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Changed := True;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_BOOLEAN_OUPUT_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBooleanType <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Compare}
if ValueInfo.viInteger <> Ord(FBooleanType) then
Changed := True;
if Changed then
begin
ValueInfo.viInteger := Ord(FBooleanType);
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BOOLEAN_OUPUT_TYPE, ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBooleanType <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_BOOLEAN_OUPUT_TYPE,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBooleanType <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeFieldObjectItem }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeFieldObjectItem.Create;
begin
inherited Create;
FFieldName := '';
FFieldLength := 0;
FFormat := TCrpeFieldObjectFormat.Create;
FFont := TCrpeFont.Create;
FFont.OnChange := OnChangeFont;
FHiliteConditions := TCrpeHiliteConditions.Create;
FSubClassList.Add(FFormat);
FSubClassList.Add(FFont);
FSubClassList.Add(FHiliteConditions);
SetFieldType(fvUnknown);
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFieldObjectItem.Destroy;
begin
FFormat.Free;
FFont.OnChange := nil;
FFont.Free;
FHiliteConditions.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectItem.Assign(Source: TPersistent);
begin
if Source is TCrpeFieldObjectItem then
begin
Format.Assign(TCrpeFieldObjectItem(Source).Format);
Font.Assign(TCrpeFieldObjectItem(Source).Font);
HiliteConditions.Assign(TCrpeFieldObjectItem(Source).HiliteConditions);
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectItem.Clear;
begin
inherited Clear;
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) then
begin
FIndex := -1;
Handle := 0;
FFieldName := '';
SetFieldType(fvUnknown);
FFieldLength := 0;
end;
FFormat.Clear;
FFont.Clear;
FHiliteConditions.Clear;
end;
{------------------------------------------------------------------------------}
{ SetFName }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectItem.SetFName (const Value: string);
begin
{Read only}
end;
{------------------------------------------------------------------------------}
{ SetFType }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectItem.SetFType (const Value: TCrFieldValueType);
begin
{Read only}
end;
{------------------------------------------------------------------------------}
{ SetFLength }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectItem.SetFLength (const Value: Word);
begin
{Read only}
end;
{------------------------------------------------------------------------------}
{ SetFieldType }
{ - propagates the FieldType to subclasses }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectItem.SetFieldType(const FType: TCrFieldValueType);
begin
FFieldType := FType;
FFormat.FField.FFieldType := FType;
FFormat.FField.FNumber.FFieldType := FType;
FFormat.FField.FDate.FFieldType := FType;
FFormat.FField.FDateTime.FFieldType := FType;
FFormat.FField.FTime.FFieldType := FType;
FFormat.FField.FParagraph.FFieldType := FType;
FHiliteConditions.FFieldType := FType;
end;
{------------------------------------------------------------------------------}
{ GetFont }
{------------------------------------------------------------------------------}
function TCrpeFieldObjectItem.GetFont : TCrpeFont;
begin
FFont.GetFont;
Result := FFont;
end;
{------------------------------------------------------------------------------}
{ OnChangeFont }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectItem.OnChangeFont (Sender: TObject);
begin
if StatusIsGo(FIndex) then
FFont.SetFont;
end;
{******************************************************************************}
{ Class TCrpeFieldObjectContainer }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Count }
{------------------------------------------------------------------------------}
function TCrpeFieldObjectContainer.Count : integer;
begin
Result := 0;
if not Assigned(Cx) then Exit;
if not TCrpe(Cx).StatusIsGo(0) then Exit;
Result := TCrpe(Cx).GetNObjects(FObjectType, FFieldObjectType);
end;
{------------------------------------------------------------------------------}
{ SetIndex }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectContainer.SetIndex (nIndex: integer);
var
objectInfo : PEObjectInfo;
fieldObjectInfo : PEFieldObjectInfo;
begin
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) or IsStrEmpty(TCrpe(Cx).ReportName) then
Exit;
if nIndex < 0 then
begin
PropagateIndex(-1);
PropagateHandle(0);
Exit;
end;
if not TCrpe(Cx).OpenJob then Exit;
Handle := TCrpe(Cx).GetObjectHandle(nIndex, FObjectType, FFieldObjectType);
if Handle = 0 then
begin
case TCrpe(Cx).GetErrorMsg(0,errNoOption,errVCL,ECRPE_SUBSCRIPT,
TCrpe(Cx).BuildErrorString(Self) + 'SetIndex(' + IntToStr(nIndex) + ')') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
PropagateHandle(Handle);
{Object Info}
if not TCrpe(Cx).CrpeEngine.PEGetObjectInfo(TCrpe(Cx).JobNumber, Handle, objectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetIndex(' + IntToStr(nIndex) + ') <PEGetObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
PropagateIndex(nIndex);
FItem.FLeft := objectInfo.xOffset;
FItem.FTop := objectInfo.yOffset;
FItem.FWidth := objectInfo.width;
FItem.FHeight := objectInfo.height;
FItem.FSection := TCrpe(Cx).SectionCodeToStringEx(objectInfo.sectionCode, False);
{Field Object Info}
if not TCrpe(Cx).CrpeEngine.PEGetFieldObjectInfo(TCrpe(Cx).JobNumber, Handle, fieldObjectInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errFormula,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetIndex(' +
IntToStr(nIndex) + ') <PEGetFieldObjectInfo>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
FItem.FFieldName := String(fieldObjectInfo.fieldName);
if fieldObjectInfo.valueType = PE_FVT_UNKNOWNFIELD then
FItem.SetFieldType(fvUnknown)
else
FItem.SetFieldType(TCrFieldValueType(fieldObjectInfo.valueType));
FItem.FFieldLength := fieldObjectInfo.nBytes;
if csDesigning in TCrpe(Cx).ComponentState then
begin
FItem.FBorder.GetBorder;
FItem.FFormat.FFieldType := FItem.FFieldType;
FItem.FFormat.GetFormat;
FItem.FFont.GetFont;
end;
{HiliteConditions}
if FItem.FHiliteConditions.FIndex > (FItem.FHiliteConditions.Count-1) then
FItem.FHiliteConditions.SetIndex(-1);
end;
{******************************************************************************}
{ Class TCrpeHiliteConditionsItem }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeHiliteConditionsItem.Create;
begin
inherited Create;
FRangeCondition := hrcEqualTo;
FStartValue := 0;
FEndValue := 0;
FFontColor := clNone;
FBackground := clNone;
FBorderStyle := hbsDefault;
FFontStyle := hfsDefault;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.Assign(Source: TPersistent);
begin
if Source is TCrpeHiliteConditionsItem then
begin
RangeCondition := TCrpeHiliteConditionsItem(Source).RangeCondition;
StartValue := TCrpeHiliteConditionsItem(Source).StartValue;
EndValue := TCrpeHiliteConditionsItem(Source).EndValue;
FontColor := TCrpeHiliteConditionsItem(Source).FontColor;
Background := TCrpeHiliteConditionsItem(Source).Background;
BorderStyle := TCrpeHiliteConditionsItem(Source).BorderStyle;
FontStyle := TCrpeHiliteConditionsItem(Source).FontStyle;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) then
begin
FIndex := -1;
Handle := 0;
FRangeCondition := hrcEqualTo;
FStartValue := 0;
FEndValue := 0;
FFontColor := clNone;
FBackground := clNone;
FBorderStyle := hbsDefault;
FFontStyle := hfsDefault;
end;
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeHiliteConditionsItem.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if csLoading in TCrpe(Cx).ComponentState then Exit;
if Handle = 0 then Exit;
if FIndex < 0 then Exit;
if not TCrpe(Cx).OpenJob then Exit;
if not (TCrpeHiliteConditions(Parent).FFieldType in [fvInt8s..fvCurrency]) then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ SetPriority }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.SetPriority (nIndex: Smallint);
begin
if not StatusIsGo then Exit;
if not TCrpe(Cx).CrpeEngine.PESetObjectNthHiliteConditionPriority(TCrpe(Cx).JobNumber, Handle,
FIndex, nIndex) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetPriority <PESetObjectNthHiliteConditionPriority>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetRangeCondition }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.SetRangeCondition (const Value: TCrHiliteRangeCondition);
var
HiliteInfo : PEObjectHiliteInfo;
begin
FRangeCondition := Value;
if not StatusIsGo then Exit;
{Get Current Condition Info}
if not TCrpe(Cx).CrpeEngine.PEGetObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetRangeCondition <PEGetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{RangeCondition}
if HiliteInfo.rangeCondition <> Ord(FRangeCondition) then
begin
HiliteInfo.rangeCondition := Ord(FRangeCondition);
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectNthHiliteCondition (TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetRangeCondition <PESetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetStartValue }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.SetStartValue (const Value: Double);
var
HiliteInfo : PEObjectHiliteInfo;
begin
FStartValue := Value;
if not StatusIsGo then Exit;
{Get Current Condition Info}
if not TCrpe(Cx).CrpeEngine.PEGetObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetStartValue <PEGetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{StartValue}
if HiliteInfo.leftEndpoint <> FStartValue then
begin
HiliteInfo.leftEndpoint := FStartValue;
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectNthHiliteCondition (TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetStartValue <PESetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetEndValue }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.SetEndValue (const Value: Double);
var
HiliteInfo : PEObjectHiliteInfo;
begin
FEndValue := Value;
if not StatusIsGo then Exit;
{Get Current Condition Info}
if not TCrpe(Cx).CrpeEngine.PEGetObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetEndValue <PEGetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{EndValue}
if HiliteInfo.rightEndpoint <> FEndValue then
begin
HiliteInfo.rightEndpoint := FEndValue;
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectNthHiliteCondition (TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetEndValue <PESetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetFontColor }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.SetFontColor (const Value: TColor);
var
HiliteInfo : PEObjectHiliteInfo;
nColor1 : TColor;
nColor2 : TColor;
begin
FFontColor := Value;
if not StatusIsGo then Exit;
{Get Current Condition Info}
if not TCrpe(Cx).CrpeEngine.PEGetObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetFontColor <PEGetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{FontColor}
if HiliteInfo.fontColor = PE_NO_COLOR then
nColor1 := clNone
else
nColor1 := TColor(HiliteInfo.fontColor);
nColor2 := FFontColor;
if nColor1 <> nColor2 then
begin
if nColor2 = clNone then
HiliteInfo.fontColor := PE_NO_COLOR
else
HiliteInfo.fontColor := ColorToRGB(nColor2);
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectNthHiliteCondition (TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetFontColor <PESetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetBackground }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.SetBackground (const Value: TColor);
var
HiliteInfo : PEObjectHiliteInfo;
nColor1 : TColor;
nColor2 : TColor;
begin
FBackground := Value;
if not StatusIsGo then Exit;
{Get Current Condition Info}
if not TCrpe(Cx).CrpeEngine.PEGetObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetBackgroundColor <PEGetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{BackgroundColor}
if HiliteInfo.bkColor = PE_NO_COLOR then
nColor1 := clNone
else
nColor1 := TColor(HiliteInfo.bkColor);
nColor2 := FBackground;
if nColor1 <> nColor2 then
begin
if nColor2 = clNone then
HiliteInfo.bkColor := PE_NO_COLOR
else
HiliteInfo.bkColor := ColorToRGB(nColor2);
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectNthHiliteCondition (TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetBackgroundColor <PESetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetBorderStyle }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.SetBorderStyle (const Value: TCrHiliteBorderStyle);
var
HiliteInfo : PEObjectHiliteInfo;
begin
FBorderStyle := Value;
if not StatusIsGo then Exit;
{Get Current Condition Info}
if not TCrpe(Cx).CrpeEngine.PEGetObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetBorderStyle <PEGetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{RangeCondition}
if HiliteInfo.borderStyle <> Ord(FBorderStyle) then
begin
HiliteInfo.borderStyle := Ord(FBorderStyle);
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectNthHiliteCondition (TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetBorderStyle <PESetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetFontStyle }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditionsItem.SetFontStyle (const Value: TCrHiliteFontStyle);
var
HiliteInfo : PEObjectHiliteInfo;
begin
FFontStyle := Value;
if not StatusIsGo then Exit;
{Get Current Condition Info}
if not TCrpe(Cx).CrpeEngine.PEGetObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetFontStyle <PEGetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{RangeCondition}
if HiliteInfo.fontStyle <> Ord(FFontStyle) then
begin
HiliteInfo.fontStyle := Ord(FFontStyle);
{Send to Print Engine}
if not TCrpe(Cx).CrpeEngine.PESetObjectNthHiliteCondition (TCrpe(Cx).JobNumber, Handle, FIndex, HiliteInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + '.SetFontStyle <PESetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeHiliteConditions }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeHiliteConditions.Create;
begin
inherited Create;
FFieldType := fvUnknown;
FItem := TCrpeHiliteConditionsItem.Create;
FSubClassList.Add(FItem);
end;
{------------------------------------------------------------------------------}
{ Destructor Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeHiliteConditions.Destroy;
begin
FItem.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditions.Assign(Source: TPersistent);
var
i : integer;
begin
if Source is TCrpeHiliteConditions then
begin
Clear;
for i := 0 to TCrpeHiliteConditions(Source).Count-1 do
begin Add;
Item.Assign(TCrpeHiliteConditions(Source).Items[i]);
end;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditions.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (FIndex < 0) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
end
else
begin
if Count = 0 then Exit;
if not TCrpe(Cx).CrpeEngine.PEClearObjectHiliteConditions(TCrpe(Cx).JobNumber, Handle) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
'HiliteConditions.Clear <PEClearObjectHiliteConditions>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FItem.Clear;
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeHiliteConditions.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if csLoading in TCrpe(Cx).ComponentState then Exit;
if Handle = 0 then Exit;
if not TCrpe(Cx).OpenJob then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ Count }
{------------------------------------------------------------------------------}
function TCrpeHiliteConditions.Count;
var
nConditions : integer;
begin
Result := 0;
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) then Exit;
if not StatusIsGo then Exit;
{Get the # of Sections in the Report}
nConditions := TCrpe(Cx).CrpeEngine.PEGetObjectNHiliteConditions(TCrpe(Cx).JobNumber, Handle);
if (nConditions = -1) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
'HiliteConditions.Count <PEGetObjectNHiliteConditions>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
Result := nConditions;
end;
{------------------------------------------------------------------------------}
{ Add }
{------------------------------------------------------------------------------}
function TCrpeHiliteConditions.Add : integer;
var
HiliteInfo : PEObjectHiliteInfo;
begin
Result := -1;
if not StatusIsGo then Exit;
HiliteInfo.rangeCondition := PE_HE_RC_EQUALTO;
HiliteInfo.leftEndpoint := 0;
HiliteInfo.rightEndpoint := 0;
HiliteInfo.fontColor := ColorToRGB(clBlack);
HiliteInfo.bkColor := ColorToRGB(clWhite);
HiliteInfo.borderStyle := PE_HE_BORDER_DEFAULTBORDERSTYLE;
HiliteInfo.fontStyle := PE_HE_FONTSTYLE_DEFAULTFONTSTYLE;
{Add the Condition}
if not TCrpe(Cx).CrpeEngine.PEAddObjectHiliteCondition(TCrpe(Cx).JobNumber, Handle, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
'HiliteConditions.Add <PEAddObjectHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
SetIndex(Count-1);
Result := FIndex;
end;
{------------------------------------------------------------------------------}
{ Delete }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditions.Delete (nIndex: integer);
begin
if not StatusIsGo then Exit;
{Remove the Condition}
if not TCrpe(Cx).CrpeEngine.PERemoveObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, nIndex) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
'HiliteConditions.Delete <PERemoveObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Decrement index if necessary}
if FIndex = Count then
SetIndex(FIndex-1);
end;
{------------------------------------------------------------------------------}
{ SetIndex }
{------------------------------------------------------------------------------}
procedure TCrpeHiliteConditions.SetIndex (nIndex: integer);
var
HiliteInfo : PEObjectHiliteInfo;
begin
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) or IsStrEmpty(TCrpe(Cx).ReportName) then
Exit;
if nIndex < 0 then
begin
PropagateIndex(-1);
Clear;
Exit;
end;
if Handle = 0 then Exit;
if not TCrpe(Cx).OpenJob then Exit;
{Get Hilite Condition}
if not TCrpe(Cx).CrpeEngine.PEGetObjectNthHiliteCondition(TCrpe(Cx).JobNumber, Handle, nIndex, HiliteInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
'HiliteConditions.SetIndex <PEGetObjectNthHiliteCondition>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
PropagateIndex(nIndex);
FItem.FRangeCondition := TCrHiliteRangeCondition(HiliteInfo.rangeCondition);
FItem.FStartValue := HiliteInfo.leftEndpoint;
FItem.FEndValue := HiliteInfo.rightEndpoint;
{FontColor}
if HiliteInfo.fontColor = PE_NO_COLOR then
FItem.FFontColor := clNone
else
FItem.FFontColor := TColor(HiliteInfo.fontColor);
{BackgroundColor}
if HiliteInfo.bkColor = PE_NO_COLOR then
FItem.FBackground := clNone
else
FItem.FBackground := TColor(HiliteInfo.bkColor);
FItem.FBorderStyle := TCrHiliteBorderStyle(HiliteInfo.borderStyle);
FItem.FFontStyle := TCrHiliteFontStyle(HiliteInfo.fontStyle);
end;
{------------------------------------------------------------------------------}
{ GetItem }
{------------------------------------------------------------------------------}
function TCrpeHiliteConditions.GetItem(nIndex: integer) : TCrpeHiliteConditionsItem;
begin
SetIndex(nIndex);
Result := FItem;
end;
{******************************************************************************}
{ Class TCrpeFont }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFont.Create;
begin
inherited Create;
FActualSize := 0;
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFont.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) then
Handle := 0;
Charset := DEFAULT_CHARSET;
Color := clWindowText;
Height := -11;
Name := 'MS Sans Serif';
Pitch := fpDefault;
Size := 8;
Style := [];
FActualSize := 0;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFont.Assign(Source: TPersistent);
begin
if Source is TCrpeFont then
begin
ActualSize := TCrpeFont(Source).ActualSize;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ CopyFontInfo }
{ - Copies font information from VCL's TCrpeFont to PEFontColorInfo }
{------------------------------------------------------------------------------}
procedure TCrpeFont.CopyFontInfo(var FontInfo: PEFontColorInfo;
VCLFont: TCrpeFont);
begin
{Name}
StrPCopy(FontInfo.faceName, VCLFont.Name);
{Family - No equivalent in TFont}
FontInfo.fontFamily := FF_DONTCARE;
{Pitch}
FontInfo.fontPitch := Ord(VCLFont.Pitch);
{Charset - only applies in Delphi 3 and higher}
FontInfo.charSet := VCLFont.Charset;
{Size}
FontInfo.pointSize := VCLFont.Size;
{Style: Italic, Underline, StrikeOut, Bold(weight)}
if fsItalic in VCLFont.Style then
FontInfo.isItalic := 1
else
FontInfo.isItalic := 0;
if fsUnderline in VCLFont.Style then
FontInfo.isUnderlined := 1
else
FontInfo.isUnderlined := 0;
if fsStrikeOut in VCLFont.Style then
FontInfo.isStruckOut := 1
else
FontInfo.isStruckOut := 0;
if fsBold in VCLFont.Style then
FontInfo.weight := FW_BOLD
else
FontInfo.weight := FW_NORMAL;
{Font Color}
if VCLFont.Color = clNone then
FontInfo.color := PE_NO_COLOR
else
FontInfo.color := ColorToRGB(VCLFont.Color);
{TwipSize}
FontInfo.twipSize := PointsToTwips(VCLFont.ActualSize);
end;
{------------------------------------------------------------------------------}
{ GetFont }
{------------------------------------------------------------------------------}
procedure TCrpeFont.GetFont;
var
FontColorInfo : PEFontColorInfo;
begin
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFontColor(TCrpe(Cx).JobNumber, Handle, FontColorInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Parent) + '[' + IntToStr(FIndex) +
'].Font.GetFont <PEGetObjectFontColor>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Name}
Name := String(FontColorInfo.faceName);
{Charset}
Charset := FontColorInfo.charSet;
{Font Color}
if FontColorInfo.color = PE_NO_COLOR then
Color := clNone
else
Color := TColor(FontColorInfo.color);
{Pitch}
Pitch := TFontPitch(FontColorInfo.fontPitch);
{Size}
Size := FontColorInfo.pointSize;
{Style}
Style := [];
if FontColorInfo.isItalic <> 0 then
Style := Style + [fsItalic];
if FontColorInfo.isStruckOut <> 0 then
Style := Style + [fsStrikeOut];
if FontColorInfo.isUnderlined <> 0 then
Style := Style + [fsUnderline];
if FontColorInfo.weight > FW_NORMAL then
Style := Style + [fsBold];
{We ignore FontFamily}
FActualSize := TwipsToPoints(FontColorInfo.twipSize);
end;
{------------------------------------------------------------------------------}
{ SetFont }
{------------------------------------------------------------------------------}
procedure TCrpeFont.SetFont;
var
FontColorInfo : PEFontColorInfo;
begin
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFontColor(TCrpe(Cx).JobNumber, Handle, FontColorInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Parent) + '[' + IntToStr(FIndex) +
'].Font.SetFont <PEGetObjectFontColor>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
if HasChanged(FontColorInfo) then
begin
CopyFontInfo(FontColorInfo, Self);
if not TCrpe(Cx).CrpeEngine.PESetObjectFontColor(TCrpe(Cx).JobNumber, Handle, FontColorInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Parent) + '[' + IntToStr(FIndex) +
'].Font.SetFont <PESetObjectFontColor>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetActualSize }
{------------------------------------------------------------------------------}
function TCrpeFont.GetActualSize: double;
var
FontColorInfo : PEFontColorInfo;
begin
Result := FActualSize;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFontColor(TCrpe(Cx).JobNumber, Handle, FontColorInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Parent) + '[' + IntToStr(FIndex) +
'].Font.GetFont <PEGetObjectFontColor>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
FActualSize := TwipsToPoints(FontColorInfo.twipSize);
Result := FActualSize;
end;
{------------------------------------------------------------------------------}
{ SetActualSize }
{------------------------------------------------------------------------------}
procedure TCrpeFont.SetActualSize (const Value: double);
var
FontColorInfo : PEFontColorInfo;
begin
FActualSize := Value;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFontColor(TCrpe(Cx).JobNumber, Handle, FontColorInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Parent) + '[' + IntToStr(FIndex) +
'].Font.SetFont <PEGetObjectFontColor>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
if FontColorInfo.twipSize <> PointsToTwips(FActualSize) then
begin
FontColorInfo.twipSize := PointsToTwips(FActualSize);
if FActualSize <> 0 then
FontColorInfo.pointSize := Round(FActualSize);
if not TCrpe(Cx).CrpeEngine.PESetObjectFontColor(TCrpe(Cx).JobNumber, Handle, FontColorInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Parent) + '[' + IntToStr(FIndex) +
'].Font.SetFont <PESetObjectFontColor>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ Changed }
{ - Compares Font info from Report and VCL to see if changed }
{------------------------------------------------------------------------------}
function TCrpeFont.HasChanged(RptFontInfo: PEFontColorInfo): Boolean;
var
xColor : TColor;
xStyle : TFontStyles;
begin
Result := False;
{Compare VCL and Rpt settings}
{Name}
if CompareText(Name, String(RptFontInfo.faceName)) <> 0 then
Result := True;
{CharSet}
if Charset <> RptFontInfo.charSet then
Result := True;
{Color}
if RptFontInfo.color = PE_NO_COLOR then
xColor := clNone
else
xColor := TColor(RptFontInfo.color);
if Color <> xColor then
Result := True;
{Pitch}
if Pitch <> TFontPitch(RptFontInfo.fontPitch) then
Result := True;
{Size}
if Size <> RptFontInfo.pointSize then
{ Bug : ADAPT00158354 : "DatabaseFields.item.Font.Size : Size of the font do not change"
following statement is commented out and one statement is added below - Shashikant,DishaTech - 21/4/03}
// Result := True;
begin Result := True;
self.ActualSize := Size;
end;
{ Above statement is added to solve Bug : ADAPT00158354. Since it is necessary to
keep FontColorInfo.twipSize and FontColorInfo.Pointsize in sync. while
setting fontsize using "PESetObjectFontColor" function. - Shashikant,DishaTech - 21/4/03}
{Style}
xStyle := [];
if RptFontInfo.isItalic <> 0 then
xStyle := xStyle + [fsItalic];
if RptFontInfo.isStruckOut <> 0 then
xStyle := xStyle + [fsStrikeOut];
if RptFontInfo.isUnderlined <> 0 then
xStyle := xStyle + [fsUnderline];
if RptFontInfo.weight > FW_NORMAL then
xStyle := xStyle + [fsBold];
if Style <> xStyle then
Result := True;
{ActualSize}
if FActualSize <> TwipsToPoints(RptFontInfo.twipSize) then
Result := True;
end;
{******************************************************************************}
{ Class TCrpeBorderFormulas }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Constructor Create }
{------------------------------------------------------------------------------}
constructor TCrpeBorderFormulas.Create;
begin
inherited Create;
FLeft := TStringList.Create;
FRight := TStringList.Create;
FTop := TStringList.Create;
FBottom := TStringList.Create;
FTightHorizontal := TStringList.Create;
FDropShadow := TStringList.Create;
FForeColor := TStringList.Create;
FBackgroundColor := TStringList.Create;
xFormula := TStringList.Create;
{Set up OnChange event}
TStringList(FLeft).OnChange := OnChangeLeft;
TStringList(FRight).OnChange := OnChangeRight;
TStringList(FTop).OnChange := OnChangeTop;
TStringList(FBottom).OnChange := OnChangeBottom;
TStringList(FTightHorizontal).OnChange := OnChangeTightHorizontal;
TStringList(FDropShadow).OnChange := OnChangeDropShadow;
TStringList(FForeColor).OnChange := OnChangeForeColor;
TStringList(FBackgroundColor).OnChange := OnChangeBackgroundColor;
end;
{------------------------------------------------------------------------------}
{ Destructor Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeBorderFormulas.Destroy;
begin
{Set up OnChange event}
TStringList(FLeft).OnChange := nil;
TStringList(FRight).OnChange := nil;
TStringList(FTop).OnChange := nil;
TStringList(FBottom).OnChange := nil;
TStringList(FTightHorizontal).OnChange := nil;
TStringList(FDropShadow).OnChange := nil;
TStringList(FForeColor).OnChange := nil;
TStringList(FBackgroundColor).OnChange := nil;
FLeft.Free;
FRight.Free;
FTop.Free;
FBottom.Free;
FTightHorizontal.Free;
FDropShadow.Free;
FForeColor.Free;
FBackgroundColor.Free;
xFormula.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.Assign(Source: TPersistent);
begin
if Source is TCrpeBorderFormulas then
begin
Left.Assign(TCrpeBorderFormulas(Source).Left);
Right.Assign(TCrpeBorderFormulas(Source).Right);
Top.Assign(TCrpeBorderFormulas(Source).Top);
Bottom.Assign(TCrpeBorderFormulas(Source).Bottom);
TightHorizontal.Assign(TCrpeBorderFormulas(Source).TightHorizontal);
DropShadow.Assign(TCrpeBorderFormulas(Source).DropShadow);
ForeColor.Assign(TCrpeBorderFormulas(Source).ForeColor);
BackgroundColor.Assign(TCrpeBorderFormulas(Source).BackgroundColor);
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (Handle = 0) or (FIndex < 0) then
begin
Handle := 0;
FIndex := -1;
FLeft.Clear;
FRight.Clear;
FTop.Clear;
FBottom.Clear;
FTightHorizontal.Clear;
FDropShadow.Clear;
FForeColor.Clear;
FBackgroundColor.Clear;
xFormula.Clear;
end
else
begin
xFormula.Clear;
SetLeft(xFormula);
SetRight(xFormula);
SetTop(xFormula);
SetBottom(xFormula);
SetTightHorizontal(xFormula);
SetDropShadow(xFormula);
SetForeColor(xFormula);
SetBackgroundColor(xFormula);
end;
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if Handle = 0 then Exit;
if FIndex < 0 then Exit;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ OnChangeLeft }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.OnChangeLeft (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetLeft(xFormula);
TStringList(Sender).OnChange := OnChangeLeft;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeRight }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.OnChangeRight (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetRight(xFormula);
TStringList(Sender).OnChange := OnChangeRight;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeTop }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.OnChangeTop (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetTop(xFormula);
TStringList(Sender).OnChange := OnChangeTop;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeBottom }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.OnChangeBottom (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetBottom(xFormula);
TStringList(Sender).OnChange := OnChangeBottom;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeTightHorizontal }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.OnChangeTightHorizontal (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetTightHorizontal(xFormula);
TStringList(Sender).OnChange := OnChangeTightHorizontal;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeDropShadow }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.OnChangeDropShadow (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetDropShadow(xFormula);
TStringList(Sender).OnChange := OnChangeDropShadow;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeForeColor }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.OnChangeForeColor (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetForeColor(xFormula);
TStringList(Sender).OnChange := OnChangeForeColor;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeBackgroundColor }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.OnChangeBackgroundColor (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetBackgroundColor(xFormula);
TStringList(Sender).OnChange := OnChangeBackgroundColor;
end;
end;
{------------------------------------------------------------------------------}
{ GetLeft }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.GetLeft : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FLeft;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{LineStyleLeft}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_LEFT_LINE_STYLE, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLeft <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_LEFT_LINE_STYLE, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLeft <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FLeft.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FLeft;
end;
{------------------------------------------------------------------------------}
{ GetRight }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.GetRight : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FRight;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{LineStyleRight}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_RIGHT_LINE_STYLE, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetRight <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_RIGHT_LINE_STYLE, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetRight <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FRight.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FRight;
end;
{------------------------------------------------------------------------------}
{ GetTop }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.GetTop : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FTop;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{LineStyleTop}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TOP_LINE_STYLE, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTop <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_TOP_LINE_STYLE, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTop <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FTop.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FTop;
end;
{------------------------------------------------------------------------------}
{ GetBottom }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.GetBottom : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FBottom;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{LineStyleBottom}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_BOTTOM_LINE_STYLE, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBottom <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_BOTTOM_LINE_STYLE, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBottom <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FBottom.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FBottom;
end;
{------------------------------------------------------------------------------}
{ GetTightHorizontal }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.GetTightHorizontal : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FTightHorizontal;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{TightHorizontal}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TIGHT_HORIZONTAL, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTightHorizontal <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_TIGHT_HORIZONTAL, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTightHorizontal <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FTightHorizontal.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FTightHorizontal;
end;
{------------------------------------------------------------------------------}
{ GetDropShadow }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.GetDropShadow : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FDropShadow;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{DropShadow}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_DROP_SHADOW, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDropShadow <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_DROP_SHADOW, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDropShadow <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FDropShadow.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FDropShadow;
end;
{------------------------------------------------------------------------------}
{ GetForeColor }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.GetForeColor : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FForeColor;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{ForeColor}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_FORE_COLOR, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetForeColor <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_FORE_COLOR, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetForeColor <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FForeColor.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FForeColor;
end;
{------------------------------------------------------------------------------}
{ GetBackgroundColor }
{------------------------------------------------------------------------------}
function TCrpeBorderFormulas.GetBackgroundColor : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FBackgroundColor;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{BackgroundColor}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_BACK_COLOR, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBackgroundColor <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_BACK_COLOR, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBackgroundColor <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FBackgroundColor.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FBackgroundColor;
end;
{------------------------------------------------------------------------------}
{ SetRight }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.SetRight (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FRight.Assign(Value);
if not Assigned(Cx) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Get FormatFormula}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_RIGHT_LINE_STYLE, hText, iText) then
begin TStringList(FRight).OnChange := OnChangeRight;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_RIGHT_LINE_STYLE, hText, iText) then
begin TStringList(FRight).OnChange := OnChangeRight;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FRight);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_RIGHT_LINE_STYLE, PChar(sVCL)) then
begin TStringList(FRight).OnChange := OnChangeRight;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_RIGHT_LINE_STYLE, PChar(sVCL)) then
begin TStringList(FRight).OnChange := OnChangeRight;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetLeft }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.SetLeft (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FLeft.Assign(Value);
if not StatusIsGo then Exit;
if Self.Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Get FormatFormula}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_LEFT_LINE_STYLE, hText, iText) then
begin TStringList(FLeft).OnChange := OnChangeLeft;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_LEFT_LINE_STYLE, hText, iText) then
begin TStringList(FLeft).OnChange := OnChangeLeft;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FLeft);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_LEFT_LINE_STYLE, PChar(sVCL)) then
begin TStringList(FLeft).OnChange := OnChangeLeft;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_LEFT_LINE_STYLE, PChar(sVCL)) then
begin TStringList(FLeft).OnChange := OnChangeLeft;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetTop }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.SetTop (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FTop.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Get FormatFormula}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TOP_LINE_STYLE, hText, iText) then
begin TStringList(FTop).OnChange := OnChangeTop;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_TOP_LINE_STYLE, hText, iText) then
begin TStringList(FTop).OnChange := OnChangeTop;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FTop);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TOP_LINE_STYLE, PChar(sVCL)) then
begin TStringList(FTop).OnChange := OnChangeTop;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_TOP_LINE_STYLE, PChar(sVCL)) then
begin TStringList(FTop).OnChange := OnChangeTop;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetBottom }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.SetBottom (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FBottom.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Get FormatFormula}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_BOTTOM_LINE_STYLE, hText, iText) then
begin TStringList(FBottom).OnChange := OnChangeBottom;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBottom <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_BOTTOM_LINE_STYLE, hText, iText) then
begin TStringList(FBottom).OnChange := OnChangeBottom;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBottom <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FBottom);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_BOTTOM_LINE_STYLE, PChar(sVCL)) then
begin TStringList(FBottom).OnChange := OnChangeBottom;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBottom <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_BOTTOM_LINE_STYLE, PChar(sVCL)) then
begin TStringList(FBottom).OnChange := OnChangeBottom;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBottom <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetTightHorizontal }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.SetTightHorizontal (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FTightHorizontal.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Get FormatFormula}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TIGHT_HORIZONTAL, hText, iText) then
begin TStringList(FTightHorizontal).OnChange := OnChangeTightHorizontal;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTightHorizontal <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_TIGHT_HORIZONTAL, hText, iText) then
begin TStringList(FTightHorizontal).OnChange := OnChangeTightHorizontal;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTightHorizontal <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FTightHorizontal);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TIGHT_HORIZONTAL, PChar(sVCL)) then
begin TStringList(FTightHorizontal).OnChange := OnChangeTightHorizontal;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTightHorizontal <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_TIGHT_HORIZONTAL, PChar(sVCL)) then
begin TStringList(FTightHorizontal).OnChange := OnChangeTightHorizontal;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTightHorizontal <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetDropShadow }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.SetDropShadow (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FDropShadow.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Get FormatFormula}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_DROP_SHADOW, hText, iText) then
begin TStringList(FDropShadow).OnChange := OnChangeDropShadow;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDropShadow <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle, PE_FFN_DROP_SHADOW, hText, iText) then
begin TStringList(FDropShadow).OnChange := OnChangeDropShadow;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDropShadow <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FDropShadow);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_DROP_SHADOW, PChar(sVCL)) then
begin TStringList(FDropShadow).OnChange := OnChangeDropShadow;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDropShadow <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_DROP_SHADOW, PChar(sVCL)) then
begin TStringList(FDropShadow).OnChange := OnChangeDropShadow;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDropShadow <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetForeColor }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.SetForeColor (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FForeColor.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Get FormatFormula}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_FORE_COLOR, hText, iText) then
begin TStringList(FForeColor).OnChange := OnChangeForeColor;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetForeColor <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle, PE_FFN_FORE_COLOR, hText, iText) then
begin TStringList(FForeColor).OnChange := OnChangeForeColor;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetForeColor <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FForeColor);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_FORE_COLOR, PChar(sVCL)) then
begin TStringList(FForeColor).OnChange := OnChangeForeColor;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetForeColor <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle, PE_FFN_FORE_COLOR, PChar(sVCL)) then
begin TStringList(FForeColor).OnChange := OnChangeForeColor;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetForeColor <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetBackgroundColor }
{------------------------------------------------------------------------------}
procedure TCrpeBorderFormulas.SetBackgroundColor (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FBackgroundColor.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Get FormatFormula}
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_BACK_COLOR, hText, iText) then
begin TStringList(FRight).OnChange := OnChangeRight;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_BACK_COLOR, hText, iText) then
begin TStringList(FBackgroundColor).OnChange := OnChangeBackgroundColor;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBackgroundColor <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FBackgroundColor);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_BACK_COLOR, PChar(sVCL)) then
begin TStringList(FBackgroundColor).OnChange := OnChangeBackgroundColor;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBackgroundColor <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle, PE_FFN_BACK_COLOR, PChar(sVCL)) then
begin TStringList(FBackgroundColor).OnChange := OnChangeBackgroundColor;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBackgroundColor <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeBorder }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeBorder.Create;
begin
inherited Create;
FLeft := lsNone;
FRight := lsNone;
FTop := lsNone;
FBottom := lsNone;
FTightHorizontal := False;
FDropShadow := False;
FForeColor := clNone;
FBackgroundColor := clNone;
FFormulas := TCrpeBorderFormulas.Create;
FSubClassList.Add(FFormulas);
FFieldN := -1;
end;
{------------------------------------------------------------------------------}
{ Destructor Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeBorder.Destroy;
begin
FFormulas.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.Assign(Source: TPersistent);
begin
if Source is TCrpeBorder then
begin
Left := TCrpeBorder(Source).Left;
Right := TCrpeBorder(Source).Right;
Top := TCrpeBorder(Source).Top;
Bottom := TCrpeBorder(Source).Bottom;
TightHorizontal := TCrpeBorder(Source).TightHorizontal;
DropShadow := TCrpeBorder(Source).DropShadow;
ForeColor := TCrpeBorder(Source).ForeColor;
BackgroundColor := TCrpeBorder(Source).BackgroundColor;
Formulas.Assign(TCrpeBorder(Source).Formulas);
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (Handle = 0) then
begin
Handle := 0;
FLeft := lsNone;
FRight := lsNone;
FTop := lsNone;
FBottom := lsNone;
FTightHorizontal := False;
FDropShadow := False;
FForeColor := clNone;
FBackgroundColor := clNone;
end
else
begin
SetLeft(lsNone);
SetRight(lsNone);
SetTop(lsNone);
SetBottom(lsNone);
SetTightHorizontal(False);
SetDropShadow(False);
SetForeColor(clNone);
SetBackgroundColor(clNone);
end;
FFormulas.Clear;
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeBorder.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then
begin
PropagateHandle(0);
Exit;
end;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{------------------------------------------------------------------------------}
{ SetFNum }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetFNum(nField: Smallint);
begin
FFieldN := nField;
FFormulas.FFieldN := nField;
end;
{------------------------------------------------------------------------------}
{ GetBorder }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.GetBorder;
begin
GetLeft;
GetLeft;
GetRight;
GetTop;
GetBottom;
GetTightHorizontal;
GetDropShadow;
GetForeColor;
GetBackgroundColor;
end;
{------------------------------------------------------------------------------}
{ GetLeft }
{------------------------------------------------------------------------------}
function TCrpeBorder.GetLeft : TCrLineStyle;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FLeft;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{LineStyleLeft}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LEFT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLeft <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_LEFT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetLeft <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case valueInfo.viInteger of
PE_LS_NO_LINE : FLeft := lsNone;
PE_LS_SINGLE_LINE : FLeft := lsSingle;
PE_LS_DOUBLE_LINE : FLeft := lsDouble;
PE_LS_DASH_LINE : FLeft := lsDash;
PE_LS_DOT_LINE : FLeft := lsDot;
else
FLeft := lsNone;
end;
end;
{------------------------------------------------------------------------------}
{ SetLeft }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetLeft (const Value: TCrLineStyle);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FLeft := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Left}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LEFT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_LEFT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viInteger <> Ord(FLeft) then
begin
valueInfo.viInteger := Ord(FLeft);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_LEFT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_LEFT_LINE_STYLE,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetLeft <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetRight }
{------------------------------------------------------------------------------}
function TCrpeBorder.GetRight : TCrLineStyle;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FRight;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{LineStyleRight}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_RIGHT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetRight <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_RIGHT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetRight <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case valueInfo.viInteger of
PE_LS_NO_LINE : FRight := lsNone;
PE_LS_SINGLE_LINE : FRight := lsSingle;
PE_LS_DOUBLE_LINE : FRight := lsDouble;
PE_LS_DASH_LINE : FRight := lsDash;
PE_LS_DOT_LINE : FRight := lsDot;
else
FRight := lsNone;
end;
end;
{------------------------------------------------------------------------------}
{ SetRight }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetRight (const Value: TCrLineStyle);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FRight := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Right}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_RIGHT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_RIGHT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viInteger <> Ord(FRight) then
begin
valueInfo.viInteger := Ord(FRight);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_RIGHT_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_RIGHT_LINE_STYLE,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetRight <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetTop }
{------------------------------------------------------------------------------}
function TCrpeBorder.GetTop : TCrLineStyle;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FTop;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{LineStyleTop}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TOP_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTop <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_TOP_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTop <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case valueInfo.viInteger of
PE_LS_NO_LINE : FTop := lsNone;
PE_LS_SINGLE_LINE : FTop := lsSingle;
PE_LS_DOUBLE_LINE : FTop := lsDouble;
PE_LS_DASH_LINE : FTop := lsDash;
PE_LS_DOT_LINE : FTop := lsDot;
else
FTop := lsNone;
end;
end;
{------------------------------------------------------------------------------}
{ SetTop }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetTop (const Value: TCrLineStyle);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FTop := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Top}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TOP_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_TOP_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viInteger <> Ord(FTop) then
begin
valueInfo.viInteger := Ord(FTop);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TOP_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_TOP_LINE_STYLE,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTop <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetBottom }
{------------------------------------------------------------------------------}
function TCrpeBorder.GetBottom : TCrLineStyle;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FBottom;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{LineStyleBottom}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BOTTOM_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBottom <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_BOTTOM_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBottom <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case valueInfo.viInteger of
PE_LS_NO_LINE : FBottom := lsNone;
PE_LS_SINGLE_LINE : FBottom := lsSingle;
PE_LS_DOUBLE_LINE : FBottom := lsDouble;
PE_LS_DASH_LINE : FBottom := lsDash;
PE_LS_DOT_LINE : FBottom := lsDot;
else
FBottom := lsNone;
end;
end;
{------------------------------------------------------------------------------}
{ SetBottom }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetBottom (const Value: TCrLineStyle);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FBottom := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Bottom}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BOTTOM_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBottom <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_BOTTOM_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBottom <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viInteger <> Ord(FBottom) then
begin
valueInfo.viInteger := Ord(FBottom);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BOTTOM_LINE_STYLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBottom <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_BOTTOM_LINE_STYLE,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBottom <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetTightHorizontal }
{------------------------------------------------------------------------------}
function TCrpeBorder.GetTightHorizontal : Boolean;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FTightHorizontal;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{TightHorizontal}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TIGHT_HORIZONTAL, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTightHorizontal <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_TIGHT_HORIZONTAL, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTightHorizontal <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viBoolean = True then
FTightHorizontal := True
else
FTightHorizontal := False;
end;
{------------------------------------------------------------------------------}
{ SetTightHorizontal }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetTightHorizontal (const Value: Boolean);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FTightHorizontal := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Tight Horizontal}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TIGHT_HORIZONTAL, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTightHorizontal <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_TIGHT_HORIZONTAL, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTightHorizontal <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viBoolean <> Bool(FTightHorizontal) then
begin
valueInfo.viBoolean := Bool(FTightHorizontal);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TIGHT_HORIZONTAL, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTightHorizontal <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_TIGHT_HORIZONTAL,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTightHorizontal <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetDropShadow }
{------------------------------------------------------------------------------}
function TCrpeBorder.GetDropShadow : Boolean;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FDropShadow;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{DropShadow}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DROP_SHADOW, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDropShadow <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_DROP_SHADOW, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetDropShadow <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viBoolean = True then
FDropShadow := True
else
FDropShadow := False;
end;
{------------------------------------------------------------------------------}
{ SetDropShadow }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetDropShadow (const Value: Boolean);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FDropShadow := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Drop Shadow}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DROP_SHADOW, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDropShadow <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_DROP_SHADOW, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDropShadow <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viBoolean <> Bool(FDropShadow) then
begin
valueInfo.viBoolean := Bool(FDropShadow);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_DROP_SHADOW, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDropShadow <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_DROP_SHADOW, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetDropShadow <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetForeColor }
{------------------------------------------------------------------------------}
function TCrpeBorder.GetForeColor : TColor;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FForeColor;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{ForeColor}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_FORE_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetForeColor <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_FORE_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetForeColor <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viColor = PE_NO_COLOR then
FForeColor := clNone
else
FForeColor := TColor(ValueInfo.viColor);
end;
{------------------------------------------------------------------------------}
{ SetForeColor }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetForeColor (const Value: TColor);
var
valueInfo : PEValueInfo;
nColor1 : TColor;
nColor2 : TColor;
xJob : Smallint;
begin
FForeColor := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{ForeColor}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_FORE_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetForeColor <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_FORE_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetForeColor <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viColor = PE_NO_COLOR then
nColor1 := clNone
else
nColor1 := TColor(ValueInfo.viColor);
nColor2 := FForeColor;
if nColor1 <> nColor2 then
begin
if nColor2 = clNone then
valueInfo.viColor := PE_NO_COLOR
else
valueInfo.viColor := ColorToRGB(nColor2);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_FORE_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetForeColor <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_FORE_COLOR,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetForeColor <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetBackgroundColor }
{------------------------------------------------------------------------------}
function TCrpeBorder.GetBackgroundColor : TColor;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FBackgroundColor;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{BackgroundColor}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BACK_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBackgroundColor <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_BACK_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetBackgroundColor <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viColor = PE_NO_COLOR then
FBackgroundColor := clNone
else
FBackgroundColor := TColor(ValueInfo.viColor);
end;
{------------------------------------------------------------------------------}
{ SetBackgroundColor }
{------------------------------------------------------------------------------}
procedure TCrpeBorder.SetBackgroundColor (const Value: TColor);
var
valueInfo : PEValueInfo;
nColor1 : TColor;
nColor2 : TColor;
xJob : Smallint;
begin
FBackgroundColor := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Background Color}
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BACK_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBackgroundColor <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_BACK_COLOR,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBackgroundColor <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if valueInfo.viColor = PE_NO_COLOR then
nColor1 := clNone
else
nColor1 := TColor(valueInfo.viColor);
nColor2 := FBackgroundColor;
if nColor1 <> nColor2 then
begin
if nColor2 = clNone then
valueInfo.viColor := PE_NO_COLOR
else
valueInfo.viColor := ColorToRGB(nColor2);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_BACK_COLOR, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBackgroundColor <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_BACK_COLOR,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetBackgroundColor <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeFormat }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFormat.Create;
begin
inherited Create;
FSuppress := False;
FKeepTogether := True;
FCloseBorder := True;
FToolTip := '';
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFormat.Assign(Source: TPersistent);
begin
if Source is TCrpeFormat then
begin
Suppress := TCrpeFormat(Source).Suppress;
KeepTogether := TCrpeFormat(Source).KeepTogether;
CloseBorder := TCrpeFormat(Source).CloseBorder;
ToolTip := TCrpeFormat(Source).ToolTip;
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFormat.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (Handle = 0) then
begin
Handle := 0;
FSuppress := False;
FKeepTogether := True;
FCloseBorder := True;
FToolTip := '';
end
else
begin
SetSuppress(False);
SetKeepTogether(True);
SetCloseBorder(True);
SetToolTip('');
end;
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeFormat.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if FIndex < 0 then Exit;
if Handle = 0 then
begin
PropagateHandle(0);
Exit;
end;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{******************************************************************************}
{ Class TCrpeFormatA }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFormatA.Create;
begin
inherited Create;
FFormulas := TCrpeFormatFormulasA.Create;
FSubClassList.Add(FFormulas);
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFormatA.Destroy;
begin
FFormulas.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFormatA.Assign(Source: TPersistent);
begin
if Source is TCrpeFormatA then
begin
Formulas.Assign(TCrpeFormatA(Source).Formulas);
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFormatA.Clear;
begin
if not Assigned(Cx) then Exit;
inherited Clear;
FFormulas.Clear;
end;
{------------------------------------------------------------------------------}
{ GetFormat }
{------------------------------------------------------------------------------}
procedure TCrpeFormatA.GetFormat;
begin
GetSuppress;
GetKeepTogether;
GetCloseBorder;
GetToolTip;
end;
{------------------------------------------------------------------------------}
{ GetSuppress }
{------------------------------------------------------------------------------}
function TCrpeFormatA.GetSuppress : Boolean;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FSuppress;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Suppress}
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_VISIBLE, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppress <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
FSuppress := False;
if valueInfo.viBoolean = False then
FSuppress := True;
Result := FSuppress;
end;
{------------------------------------------------------------------------------}
{ SetSuppress }
{------------------------------------------------------------------------------}
procedure TCrpeFormatA.SetSuppress (const Value: Boolean);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FSuppress := Value;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{Suppress}
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_VISIBLE, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
if FSuppress = True then
valueInfo.viBoolean := False;
if FSuppress = False then
valueInfo.viBoolean := True;
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_VISIBLE, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetKeepTogether }
{------------------------------------------------------------------------------}
function TCrpeFormatA.GetKeepTogether : Boolean;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FKeepTogether;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{KeepTogether}
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_KEEP_OBJECT_TOGETHER, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppress <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
FKeepTogether := True;
if valueInfo.viBoolean = False then
FKeepTogether := False;
Result := FKeepTogether;
end;
{------------------------------------------------------------------------------}
{ GetCloseBorder }
{------------------------------------------------------------------------------}
function TCrpeFormatA.GetCloseBorder : Boolean;
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
Result := FCloseBorder;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{CloseBorder}
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_SPLIT_ADORNMENT, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCloseBorder <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
FCloseBorder := True;
if valueInfo.viBoolean = True then
FCloseBorder := False;
Result := FCloseBorder;
end;
{------------------------------------------------------------------------------}
{ GetToolTip }
{------------------------------------------------------------------------------}
function TCrpeFormatA.GetToolTip : string;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FToolTip;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{FormatFormula: ToolTip}
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_TOOL_TIP_TEXT, hText, iText) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetToolTip <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FToolTip := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FToolTip;
end;
{------------------------------------------------------------------------------}
{ SetKeepTogether }
{------------------------------------------------------------------------------}
procedure TCrpeFormatA.SetKeepTogether (const Value: Boolean);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FKeepTogether := Value;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{KeepTogether}
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_KEEP_OBJECT_TOGETHER,
valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
valueInfo.viBoolean := Bool(FKeepTogether);
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_KEEP_OBJECT_TOGETHER,
valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetCloseBorder }
{------------------------------------------------------------------------------}
procedure TCrpeFormatA.SetCloseBorder (const Value: Boolean);
var
valueInfo : PEValueInfo;
xJob : Smallint;
begin
FCloseBorder := Value;
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{CloseBorder}
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(xJob, Handle, PE_OFN_SPLIT_ADORNMENT,
valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{The VCL and Print Engine properties have opposite meaning...}
valueInfo.viBoolean := not (Bool(FCloseBorder));
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(xJob, Handle, PE_OFN_SPLIT_ADORNMENT,
valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{------------------------------------------------------------------------------}
{ SetToolTip }
{------------------------------------------------------------------------------}
procedure TCrpeFormatA.SetToolTip (const Value: string);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sText : String;
xJob : Smallint;
begin
if IsQuoted(Value) then
FToolTip := Value
else
FTooltip := QuotedStr(Value);
if Handle = 0 then Exit;
if not Assigned(Cx) then Exit;
if Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
{FormatFormula: ToolTip}
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_TOOL_TIP_TEXT, hText, iText) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetToolTip <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sText := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle, PE_FFN_TOOL_TIP_TEXT,
PChar(FToolTip)) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetToolTip <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{******************************************************************************}
{ Class TCrpeFormatB }
{ - TextObjects, Subreports }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFormatB.Create;
begin
inherited Create;
{Internal}
FFieldN := -1;
{Format}
FAlignment := haDefault;
FCanGrow := False;
FMaxNLines := 0;
FTextRotation := trZero;
FSuppressIfDuplicated := False;
FFormulas := TCrpeFormatFormulasB.Create;
FSubClassList.Add(FFormulas);
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFormatB.Destroy;
begin
FFormulas.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.Assign(Source: TPersistent);
begin
if Source is TCrpeFormatB then
begin
Alignment := TCrpeFormatB(Source).Alignment;
CanGrow := TCrpeFormatB(Source).CanGrow;
MaxNLines := TCrpeFormatB(Source).MaxNLines;
TextRotation := TCrpeFormatB(Source).TextRotation;
SuppressIfDuplicated := TCrpeFormatB(Source).SuppressIfDuplicated;
Formulas.Assign(TCrpeFormatB(Source).Formulas);
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.Clear;
begin
if not Assigned(Cx) then Exit;
inherited Clear;
if IsStrEmpty(TCrpe(Cx).ReportName) or (Handle = 0) then
begin
FFieldN := -1;
FAlignment := haDefault;
FSuppressIfDuplicated := False;
FCanGrow := False;
FMaxNLines := 0;
FTextRotation := trZero;
end
else
begin
SetAlignment(haDefault);
SetSuppressIfDuplicated(False);
SetCanGrow(False);
SetMaxNLines(0);
SetTextRotation(trZero);
end;
FFormulas.Clear;
end;
{------------------------------------------------------------------------------}
{ SetFieldType }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetFieldType(FType: TCrFieldValueType);
begin
FFieldType := FType;
end;
{------------------------------------------------------------------------------}
{ GetFormat }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.GetFormat;
begin
GetSuppress;
GetKeepTogether;
GetCloseBorder;
GetToolTip;
GetAlignment;
GetCanGrow;
GetMaxNLines;
GetTextRotation;
GetSuppressIfDuplicated;
end;
{------------------------------------------------------------------------------}
{ GetSuppress }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetSuppress : Boolean;
var
valueInfo : PEValueInfo;
begin
Result := FSuppress;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_VISIBLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppress <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_VISIBLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppress <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FSuppress := False;
if valueInfo.viBoolean = False then
FSuppress := True;
Result := FSuppress;
end;
{------------------------------------------------------------------------------}
{ SetSuppress }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetSuppress (const Value: Boolean);
var
valueInfo : PEValueInfo;
begin
FSuppress := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_VISIBLE, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_VISIBLE, valueInfo) then
begin
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
if FSuppress = True then
valueInfo.viBoolean := Bool(False)
else
valueInfo.viBoolean := Bool(True);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_VISIBLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_VISIBLE, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetKeepTogether }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetKeepTogether : Boolean;
var
valueInfo : PEValueInfo;
begin
Result := FKeepTogether;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_KEEP_OBJECT_TOGETHER, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetKeepTogether <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_KEEP_OBJECT_TOGETHER, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetKeepTogether <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FKeepTogether := True;
if valueInfo.viBoolean = False then
FKeepTogether := False;
Result := FKeepTogether;
end;
{------------------------------------------------------------------------------}
{ SetKeepTogether }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetKeepTogether (const Value: Boolean);
var
valueInfo : PEValueInfo;
begin
FKeepTogether := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_KEEP_OBJECT_TOGETHER, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_KEEP_OBJECT_TOGETHER,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
valueInfo.viBoolean := Bool(FKeepTogether);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_KEEP_OBJECT_TOGETHER, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_KEEP_OBJECT_TOGETHER,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetCloseBorder }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetCloseBorder : Boolean;
var
valueInfo : PEValueInfo;
begin
Result := FCloseBorder;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SPLIT_ADORNMENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCloseBorder <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SPLIT_ADORNMENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCloseBorder <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FCloseBorder := True;
{if Split Adornment is True, CloseBorder is False}
if valueInfo.viBoolean = True then
FCloseBorder := False;
Result := FCloseBorder;
end;
{------------------------------------------------------------------------------}
{ SetCloseBorder }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetCloseBorder (const Value: Boolean);
var
valueInfo : PEValueInfo;
begin
FCloseBorder := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SPLIT_ADORNMENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SPLIT_ADORNMENT,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
valueInfo.viBoolean := not Bool(FCloseBorder);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SPLIT_ADORNMENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SPLIT_ADORNMENT,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetToolTip }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetToolTip : string;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FToolTip;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TOOL_TIP_TEXT, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetToolTip <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_TOOL_TIP_TEXT, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetToolTip <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FToolTip := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FToolTip;
end;
{------------------------------------------------------------------------------}
{ SetToolTip }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetToolTip (const Value: string);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sText : String;
begin
if IsQuoted(Value) then
FToolTip := Value
else
FTooltip := QuotedStr(Value);
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TOOL_TIP_TEXT, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetToolTip <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_TOOL_TIP_TEXT, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetToolTip <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sText := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_TOOL_TIP_TEXT, PChar(FToolTip)) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetToolTip <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle, PE_FFN_TOOL_TIP_TEXT,
PChar(FToolTip)) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetToolTip <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetAlignment }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetAlignment : TCrHorizontalAlignment;
var
valueInfo : PEValueInfo;
begin
Result := FAlignment;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HORALIGNMENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAlignment <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HORALIGNMENT,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAlignment <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FAlignment := TCrHorizontalAlignment(valueInfo.viInteger);
Result := FAlignment;
end;
{------------------------------------------------------------------------------}
{ SetAlignment }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetAlignment (const Value: TCrHorizontalAlignment);
var
valueInfo : PEValueInfo;
begin
FAlignment := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HORALIGNMENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAlignment <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HORALIGNMENT,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAlignment <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
valueInfo.viInteger := Ord(FAlignment);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_HORALIGNMENT, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAlignment <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_HORALIGNMENT,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAlignment <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetSuppressIfDuplicated }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetSuppressIfDuplicated : Boolean;
var
valueInfo : PEValueInfo;
begin
Result := FSuppressIfDuplicated;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SUPPRESS_IF_DUPLICATED, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppressIfDuplicated <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SUPPRESS_IF_DUPLICATED,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppressIfDuplicated <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FSuppressIfDuplicated := True;
if valueInfo.viBoolean = False then
FSuppressIfDuplicated := False;
Result := FSuppressIfDuplicated;
end;
{------------------------------------------------------------------------------}
{ SetSuppressIfDuplicated }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetSuppressIfDuplicated (const Value: Boolean);
var
valueInfo : PEValueInfo;
begin
FSuppressIfDuplicated := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SUPPRESS_IF_DUPLICATED, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfDuplicated <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SUPPRESS_IF_DUPLICATED,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfDuplicated <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
valueInfo.viBoolean := Bool(FSuppressIfDuplicated);
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_SUPPRESS_IF_DUPLICATED, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfDuplicated <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_SUPPRESS_IF_DUPLICATED,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfDuplicated <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetCanGrow }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetCanGrow : Boolean;
var
valueInfo : PEValueInfo;
begin
Result := FCanGrow;
if not StatusIsGo then Exit;
if (FFieldType in [fvString..fvPersistentMemo]) then
begin{CanGrow}
if Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_EXPAND, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCanGrow <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_EXPAND, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCanGrow <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FCanGrow := True;
if valueInfo.viBoolean = False then
FCanGrow := False;
Result := FCanGrow;
end;
end;
{------------------------------------------------------------------------------}
{ SetCanGrow }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetCanGrow (const Value: Boolean);
var
valueInfo : PEValueInfo;
begin
FCanGrow := Value;
if not StatusIsGo then Exit;
if (FFieldType in [fvString..fvPersistentMemo]) then
begin
if Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_EXPAND, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCanGrow <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_EXPAND,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCanGrow <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
valueInfo.viBoolean := Bool(FCanGrow);
if Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_EXPAND, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCanGrow <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_EXPAND,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCanGrow <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetMaxNLines }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetMaxNLines : integer;
var
valueInfo : PEValueInfo;
begin
Result := FMaxNLines;
if not StatusIsGo then Exit;
if (FFieldType in [fvString..fvPersistentMemo]) then
begin{MaxNLines}
if Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MAX_N_LINES, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetMaxNLines <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MAX_N_LINES,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetMaxNLines <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
FMaxNLines := ValueInfo.viInteger;
Result := FMaxNLines;
end;
end;
{------------------------------------------------------------------------------}
{ SetMaxNLines }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetMaxNLines (const Value: integer);
var
valueInfo : PEValueInfo;
begin
FMaxNLines := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MAX_N_LINES, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMaxNLines <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MAX_N_LINES,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMaxNLines <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
ValueInfo.viInteger := FMaxNLines;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_MAX_N_LINES, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMaxNLines <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_MAX_N_LINES,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetMaxNLines <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetTextRotation }
{------------------------------------------------------------------------------}
function TCrpeFormatB.GetTextRotation : TCrTextRotation;
var
valueInfo : PEValueInfo;
begin
Result := FTextRotation;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TEXT_ROTATION, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTextRotation <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TEXT_ROTATION,
valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetTextRotation <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case valueInfo.viInteger of
0 : FTextRotation := trZero;
90 : FTextRotation := tr90;
270 : FTextRotation := tr270;
else
FTextRotation := trZero;
end;
Result := FTextRotation;
end;
{------------------------------------------------------------------------------}
{ SetTextRotation }
{------------------------------------------------------------------------------}
procedure TCrpeFormatB.SetTextRotation (const Value: TCrTextRotation);
var
valueInfo : PEValueInfo;
i : Smallint;
begin
FTextRotation := Value;
if not StatusIsGo then Exit;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormat (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TEXT_ROTATION, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTextRotation <PEGetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TEXT_ROTATION,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTextRotation <PEGetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
case FTextRotation of
trZero : i := 0;
tr90 : i := 90;
tr270 : i := 270;
else
i := 0;
end;
ValueInfo.viInteger := i;
if Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormat(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_OFN_TEXT_ROTATION, valueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTextRotation <PESetNthEmbeddedFieldFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormat(TCrpe(Cx).JobNumber, Handle, PE_OFN_TEXT_ROTATION,
ValueInfo) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetTextRotation <PESetObjectFormat>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeFormatC }
{ - TextObjects }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFormatC.Create;
begin
inherited Create;
{Field Formatting - Paragraph properties}
FParagraph := TCrpeParagraphFormat.Create;
FSubClassList.Add(FParagraph);
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFormatC.Destroy;
begin
FParagraph.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFormatC.Assign(Source: TPersistent);
begin
if Source is TCrpeFormatC then
begin
Paragraph.Assign(TCrpeFormatC(Source).Paragraph);
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFormatC.Clear;
begin
if not Assigned(Cx) then Exit;
inherited Clear;
FParagraph.Clear;
end;
{******************************************************************************}
{ Class TCrpeFormatFormulas }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFormatFormulas.Create;
begin
inherited Create;
FSuppress := TStringList.Create;
FKeepTogether := TStringList.Create;
FCloseBorder := TStringList.Create;
FHyperLink := TStringList.Create;
xFormula := TStringList.Create;
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFormatFormulas.Destroy;
begin
FSuppress.Free;
FKeepTogether.Free;
FCloseBorder.Free;
FHyperLink.Free;
xFormula.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulas.Clear;
begin
if not Assigned(Cx) then Exit;
if IsStrEmpty(TCrpe(Cx).ReportName) or (Handle = 0) then
begin
FIndex := -1;
Handle := 0;
FSuppress.Clear;
FKeepTogether.Clear;
FCloseBorder.Clear;
FHyperLink.Clear;
xFormula.Clear;
end
else
begin
xFormula.Clear;
SetSuppress(xFormula);
SetKeepTogether(xFormula);
SetCloseBorder(xFormula);
SetHyperLink(xFormula);
end;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulas.Assign(Source: TPersistent);
begin
if Source is TCrpeFormatFormulas then
begin
Suppress.Assign(TCrpeFormatFormulas(Source).Suppress);
KeepTogether.Assign(TCrpeFormatFormulas(Source).KeepTogether);
CloseBorder.Assign(TCrpeFormatFormulas(Source).CloseBorder);
HyperLink.Assign(TCrpeFormatFormulas(Source).HyperLink);
Exit;
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ StatusIsGo }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulas.StatusIsGo : Boolean;
begin
Result := False;
if not Assigned(Cx) then Exit;
if (csLoading in TCrpe(Cx).ComponentState) then Exit;
if Handle = 0 then Exit;
if FIndex < 0 then Exit;
if not TCrpe(Cx).JobIsOpen then Exit;
Result := True;
end;
{******************************************************************************}
{ Class TCrpeFormatFormulasA }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFormatFormulasA.Create;
begin
inherited Create;
TStringList(FSuppress).OnChange := OnChangeSuppress;
TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
TStringList(FHyperLink).OnChange := OnChangeHyperLink;
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFormatFormulasA.Destroy;
begin
TStringList(FSuppress).OnChange := nil;
TStringList(FKeepTogether).OnChange := nil;
TStringList(FCloseBorder).OnChange := nil;
TStringList(FHyperLink).OnChange := nil;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ GetSuppress }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasA.GetSuppress : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FSuppress;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_OBJECT_VISIBILITY, hText, iText) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppress <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FSuppress.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FSuppress;
end;
{------------------------------------------------------------------------------}
{ SetSuppress }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasA.SetSuppress (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FSuppress.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_OBJECT_VISIBILITY, hText, iText) then
begin
TStringList(FSuppress).OnChange := OnChangeSuppress;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FSuppress);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_OBJECT_VISIBILITY, PChar(sVCL)) then
begin TStringList(FSuppress).OnChange := OnChangeSuppress;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeSuppress }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasA.OnChangeSuppress (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetSuppress(xFormula);
TStringList(Sender).OnChange := OnChangeSuppress;
end;
end;
{------------------------------------------------------------------------------}
{ GetKeepTogether }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasA.GetKeepTogether : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FKeepTogether;
if not StatusIsGo then
Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_KEEP_OBJECT_TOGETHER, hText, iText) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetKeepTogether <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FKeepTogether.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FKeepTogether;
end;
{------------------------------------------------------------------------------}
{ SetKeepTogether }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasA.SetKeepTogether (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FKeepTogether.Assign(Value);
if not StatusIsGo then
Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_KEEP_OBJECT_TOGETHER, hText, iText) then
begin
TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FKeepTogether);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_KEEP_OBJECT_TOGETHER, PChar(sVCL)) then
begin TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeKeepTogether }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasA.OnChangeKeepTogether (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetKeepTogether(xFormula);
TStringList(Sender).OnChange := OnChangeKeepTogether;
end;
end;
{------------------------------------------------------------------------------}
{ GetCloseBorder }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasA.GetCloseBorder : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FCloseBorder;
if not StatusIsGo then
Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_SPLIT_ADORNMENT, hText, iText) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCloseBorder <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FCloseBorder.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FCloseBorder;
end;
{------------------------------------------------------------------------------}
{ SetCloseBorder }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasA.SetCloseBorder (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
xJob : Smallint;
begin
FCloseBorder.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_SPLIT_ADORNMENT, hText, iText) then
begin
TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FCloseBorder);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle,
PE_FFN_SPLIT_ADORNMENT, PChar(sVCL)) then
begin TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeCloseBorder }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasA.OnChangeCloseBorder (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetCloseBorder(xFormula);
TStringList(Sender).OnChange := OnChangeCloseBorder;
end;
end;
{------------------------------------------------------------------------------}
{ GetHyperLink }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasA.GetHyperLink : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
xJob : Smallint;
begin
Result := FHyperLink;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_HYPERLINK, hText, iText) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetHyperLink <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FHyperLink.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FHyperLink;
end;
{------------------------------------------------------------------------------}
{ SetHyperLink }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasA.SetHyperLink (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sRPT,sVCL : string;
xJob : Smallint;
begin
FHyperLink.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeSubreportsItem then
xJob := TCrpe(Cx).PrintJobs(0)
else
xJob := TCrpe(Cx).JobNumber;
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(xJob, Handle,
PE_FFN_HYPERLINK, hText, iText) then
begin
case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHyperLink <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
sVCL := RTrimList(FHyperLink);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(xJob, Handle, PE_FFN_HYPERLINK, PChar(sVCL)) then
begin case TCrpe(Cx).GetErrorMsg(xJob,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHyperLink <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeHyperLink }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasA.OnChangeHyperLink (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetHyperLink(xFormula);
TStringList(Sender).OnChange := OnChangeHyperLink;
end;
end;
{******************************************************************************}
{ Class TCrpeFormatFormulasB }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFormatFormulasB.Create;
begin
inherited Create;
FAlignment := TStringList.Create;
FCanGrow := TStringList.Create;
FSuppressIfDuplicated := TStringList.Create;
{Set up OnChange event}
TStringList(FSuppress).OnChange := OnChangeSuppress;
TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
TStringList(FHyperLink).OnChange := OnChangeHyperLink;
TStringList(FAlignment).OnChange := OnChangeAlignment;
TStringList(FCanGrow).OnChange := OnChangeCanGrow;
TStringList(FSuppressIfDuplicated).OnChange := OnChangeSuppressIfDuplicated;
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFormatFormulasB.Destroy;
begin
TStringList(FSuppress).OnChange := nil;
TStringList(FKeepTogether).OnChange := nil;
TStringList(FCloseBorder).OnChange := nil;
TStringList(FHyperLink).OnChange := nil;
TStringList(FAlignment).OnChange := nil;
TStringList(FCanGrow).OnChange := nil;
TStringList(FSuppressIfDuplicated).OnChange := nil;
FAlignment.Free;
FCanGrow.Free;
FSuppressIfDuplicated.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.Assign(Source: TPersistent);
begin
if Source is TCrpeFormatFormulasB then
begin
Alignment.Assign(TCrpeFormatFormulasB(Source).Alignment);
CanGrow.Assign(TCrpeFormatFormulasB(Source).CanGrow);
SuppressIfDuplicated.Assign(TCrpeFormatFormulasB(Source).SuppressIfDuplicated);
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.Clear;
begin
if not Assigned(Cx) then Exit;
inherited Clear;
if IsStrEmpty(TCrpe(Cx).ReportName) or (Handle = 0) then
begin
FAlignment.Clear;
FCanGrow.Clear;
FSuppressIfDuplicated.Clear;
end
else
begin
SetAlignment(xFormula);
SetCanGrow(xFormula);
SetSuppressIfDuplicated(xFormula);
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeSuppress }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.OnChangeSuppress (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetSuppress(xFormula);
TStringList(Sender).OnChange := OnChangeSuppress;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeKeepTogether }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.OnChangeKeepTogether (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetKeepTogether(xFormula);
TStringList(Sender).OnChange := OnChangeKeepTogether;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeCloseBorder }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.OnChangeCloseBorder (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetCloseBorder(xFormula);
TStringList(Sender).OnChange := OnChangeCloseBorder;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeHyperLink }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.OnChangeHyperLink (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetHyperLink(xFormula);
TStringList(Sender).OnChange := OnChangeHyperLink;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeAlignment }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.OnChangeAlignment (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetAlignment(xFormula);
TStringList(Sender).OnChange := OnChangeAlignment;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeCanGrow }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.OnChangeCanGrow (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetCanGrow(xFormula);
TStringList(Sender).OnChange := OnChangeCanGrow;
end;
end;
{------------------------------------------------------------------------------}
{ OnChangeSuppressIfDuplicated }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.OnChangeSuppressIfDuplicated (Sender: TObject);
begin
if Sender is TStringList then
begin
TStringList(Sender).OnChange := nil;
xFormula.Assign(TStringList(Sender));
SetSuppressIfDuplicated(xFormula);
TStringList(Sender).OnChange := OnChangeSuppressIfDuplicated;
end;
end;
{------------------------------------------------------------------------------}
{ GetSuppress }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasB.GetSuppress : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FSuppress;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_OBJECT_VISIBILITY, hText, iText) then
begin TStringList(FSuppress).OnChange := OnChangeSuppress;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppress <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_OBJECT_VISIBILITY, hText, iText) then
begin TStringList(FSuppress).OnChange := OnChangeSuppress;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppress <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FSuppress.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FSuppress;
end;
{------------------------------------------------------------------------------}
{ SetSuppress }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.SetSuppress (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
begin
FSuppress.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_OBJECT_VISIBILITY, hText, iText) then
begin TStringList(FSuppress).OnChange := OnChangeSuppress;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle, PE_FFN_OBJECT_VISIBILITY,
hText, iText) then
begin TStringList(FSuppress).OnChange := OnChangeSuppress;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
sVCL := RTrimList(FSuppress);
{Compare Formula with Report Formula}
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_OBJECT_VISIBILITY, PChar(sVCL)) then
begin TStringList(FSuppress).OnChange := OnChangeSuppress;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_OBJECT_VISIBILITY, PChar(sVCL)) then
begin TStringList(FSuppress).OnChange := OnChangeSuppress;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppress <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetKeepTogether }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasB.GetKeepTogether : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FKeepTogether;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_KEEP_OBJECT_TOGETHER, hText, iText) then
begin TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetKeepTogether <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_KEEP_OBJECT_TOGETHER, hText, iText) then
begin TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetKeepTogether <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FKeepTogether.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FKeepTogether;
end;
{------------------------------------------------------------------------------}
{ SetKeepTogether }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.SetKeepTogether (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
begin
FKeepTogether.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_KEEP_OBJECT_TOGETHER, hText, iText) then
begin TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_KEEP_OBJECT_TOGETHER, hText, iText) then
begin TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
sVCL := RTrimList(FKeepTogether);
{Compare Formula with Report Formula}
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_KEEP_OBJECT_TOGETHER, PChar(sVCL)) then
begin TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_KEEP_OBJECT_TOGETHER, PChar(sVCL)) then
begin TStringList(FKeepTogether).OnChange := OnChangeKeepTogether;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetKeepTogether <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetCloseBorder }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasB.GetCloseBorder : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FCloseBorder;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_SPLIT_ADORNMENT, hText, iText) then
begin TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCloseBorder <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_SPLIT_ADORNMENT, hText, iText) then
begin TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCloseBorder <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FCloseBorder.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FCloseBorder;
end;
{------------------------------------------------------------------------------}
{ SetCloseBorder }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.SetCloseBorder (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
begin
FCloseBorder.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_SPLIT_ADORNMENT, hText, iText) then
begin TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_SPLIT_ADORNMENT, hText, iText) then
begin TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
sVCL := RTrimList(FCloseBorder);
{Compare Formula with Report Formula}
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_SPLIT_ADORNMENT, PChar(sVCL)) then
begin TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_SPLIT_ADORNMENT, PChar(sVCL)) then
begin TStringList(FCloseBorder).OnChange := OnChangeCloseBorder;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCloseBorder <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetHyperLink }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasB.GetHyperLink : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FHyperLink;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_HYPERLINK, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetHyperLink <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_HYPERLINK, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetHyperLink <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FHyperLink.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FHyperLink;
end;
{------------------------------------------------------------------------------}
{ SetHyperLink }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.SetHyperLink (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sRPT,sVCL : string;
begin
FHyperLink.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_HYPERLINK, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHyperLink <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_HYPERLINK, hText, iText) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHyperLink <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
sVCL := RTrimList(FHyperLink);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_HYPERLINK, PChar(sVCL)) then
begin TStringList(FHyperLink).OnChange := OnChangeHyperLink;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHyperLink <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle, PE_FFN_HYPERLINK, PChar(sVCL)) then
begin case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetHyperLink <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetAlignment }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasB.GetAlignment : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FAlignment;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_HOR_ALIGNMENT, hText, iText) then
begin TStringList(FAlignment).OnChange := OnChangeAlignment;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAlignment <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_HOR_ALIGNMENT, hText, iText) then
begin TStringList(FAlignment).OnChange := OnChangeAlignment;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetAlignment <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FAlignment.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FAlignment;
end;
{------------------------------------------------------------------------------}
{ SetAlignment }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.SetAlignment (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
begin
FAlignment.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_HOR_ALIGNMENT, hText, iText) then
begin TStringList(FAlignment).OnChange := OnChangeAlignment;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAlignment <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_HOR_ALIGNMENT, hText, iText) then
begin TStringList(FAlignment).OnChange := OnChangeAlignment;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAlignment <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
sVCL := RTrimList(FAlignment);
{Compare Formula with Report Formula}
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_HOR_ALIGNMENT, PChar(sVCL)) then
begin TStringList(FAlignment).OnChange := OnChangeAlignment;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAlignment <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_HOR_ALIGNMENT, PChar(sVCL)) then
begin TStringList(FAlignment).OnChange := OnChangeAlignment;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetAlignment <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetCanGrow }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasB.GetCanGrow : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FCanGrow;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_EXPAND, hText, iText) then
begin TStringList(FCanGrow).OnChange := OnChangeCanGrow;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCanGrow <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_EXPAND, hText, iText) then
begin TStringList(FCanGrow).OnChange := OnChangeCanGrow;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetCanGrow <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FCanGrow.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FCanGrow;
end;
{------------------------------------------------------------------------------}
{ SetCanGrow }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.SetCanGrow (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
begin
FCanGrow.Assign(Value);
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_EXPAND, hText, iText) then
begin TStringList(FCanGrow).OnChange := OnChangeCanGrow;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCanGrow <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_EXPAND, hText, iText) then
begin TStringList(FCanGrow).OnChange := OnChangeCanGrow;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCanGrow <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FCanGrow);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_EXPAND, PChar(sVCL)) then
begin TStringList(FCanGrow).OnChange := OnChangeCanGrow;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCanGrow <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_EXPAND, PChar(sVCL)) then
begin TStringList(FCanGrow).OnChange := OnChangeCanGrow;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetCanGrow <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{------------------------------------------------------------------------------}
{ GetSuppressIfDuplicated }
{------------------------------------------------------------------------------}
function TCrpeFormatFormulasB.GetSuppressIfDuplicated : TStrings;
var
hText : HWnd;
iText : Smallint;
pText : PChar;
begin
Result := FSuppressIfDuplicated;
{SuppressIfDuplicated formula not applicable to TextObjects}
if (Parent.Parent is TCrpeTextObjectsItem) then Exit;
if not StatusIsGo then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_SUPPRESS_IF_DUPLICATE, hText, iText) then
begin TStringList(FSuppressIfDuplicated).OnChange := OnChangeSuppressIfDuplicated;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppressIfDuplicated <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_SUPPRESS_IF_DUPLICATE, hText, iText) then
begin TStringList(FSuppressIfDuplicated).OnChange := OnChangeSuppressIfDuplicated;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'GetSuppressIfDuplicated <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
FSuppressIfDuplicated.Text := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
Result := FSuppressIfDuplicated;
end;
{------------------------------------------------------------------------------}
{ SetSuppressIfDuplicated }
{------------------------------------------------------------------------------}
procedure TCrpeFormatFormulasB.SetSuppressIfDuplicated (const Value: TStrings);
var
hText : HWnd;
iText : Smallint;
pText : PChar;
sVCL, sRPT : string;
begin
FSuppressIfDuplicated.Assign(Value);
if not StatusIsGo then Exit;
if (Parent.Parent is TCrpeTextObjectsItem) then Exit;
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PEGetNthEmbeddedFieldFormatFormula (TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_SUPPRESS_IF_DUPLICATE, hText, iText) then
begin TStringList(FSuppressIfDuplicated).OnChange := OnChangeSuppressIfDuplicated;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfDuplicated <PEGetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin
if not TCrpe(Cx).CrpeEngine.PEGetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_SUPPRESS_IF_DUPLICATE, hText, iText) then
begin TStringList(FSuppressIfDuplicated).OnChange := OnChangeSuppressIfDuplicated;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfDuplicated <PEGetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
{Get FormatFormula Text}
pText := GlobalLock(hText);
sRPT := WideCharToString(PWideChar(pText));
GlobalUnlock(hText);
GlobalFree(hText);
{Compare Formula with Report Formula}
sVCL := RTrimList(FSuppressIfDuplicated);
if CompareStr(sVCL, sRPT) <> 0 then
begin
if Parent.Parent is TCrpeEmbeddedFieldsItem then
begin
if not TCrpe(Cx).CrpeEngine.PESetNthEmbeddedFieldFormatFormula(TCrpe(Cx).JobNumber, Handle,
FFieldN, PE_FFN_SUPPRESS_IF_DUPLICATE, PChar(sVCL)) then
begin TStringList(FSuppressIfDuplicated).OnChange := OnChangeSuppressIfDuplicated;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errCRPEBugs,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfDuplicated <PESetNthEmbeddedFieldFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end
else
begin if not TCrpe(Cx).CrpeEngine.PESetObjectFormatFormula(TCrpe(Cx).JobNumber, Handle,
PE_FFN_SUPPRESS_IF_DUPLICATE, PChar(sVCL)) then
begin TStringList(FSuppressIfDuplicated).OnChange := OnChangeSuppressIfDuplicated;
case TCrpe(Cx).GetErrorMsg(TCrpe(Cx).JobNumber,errNoOption,errEngine,'',
TCrpe(Cx).BuildErrorString(Self) + 'SetSuppressIfDuplicated <PESetObjectFormatFormula>') of
errIgnore : Exit;
errAbort : Abort;
errRaise : raise ECrpeError.Create(TCrpe(Cx).LastErrorNumber, TCrpe(Cx).LastErrorString);
end;
end;
end;
end;
end;
{******************************************************************************}
{ Class TCrpeFieldObjectFormat }
{******************************************************************************}
{------------------------------------------------------------------------------}
{ Create }
{------------------------------------------------------------------------------}
constructor TCrpeFieldObjectFormat.Create;
begin
inherited Create;
FField := TCrpeFieldFormat.Create;
FSubClassList.Add(FField);
end;
{------------------------------------------------------------------------------}
{ Destroy }
{------------------------------------------------------------------------------}
destructor TCrpeFieldObjectFormat.Destroy;
begin
FField.Free;
inherited Destroy;
end;
{------------------------------------------------------------------------------}
{ Assign }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectFormat.Assign(Source: TPersistent);
begin
if Source is TCrpeFieldObjectFormat then
begin
Field.Assign(TCrpeFieldObjectFormat(Source).Field);
end;
inherited Assign(Source);
end;
{------------------------------------------------------------------------------}
{ Clear }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectFormat.Clear;
begin
inherited Clear;
FField.Clear;
end;
{------------------------------------------------------------------------------}
{ SetFieldType }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectFormat.SetFieldType(FType: TCrFieldValueType);
begin
FFieldType := FType;
FField.FFieldType := FType;
FField.FNumber.FFieldType := FType;
FField.FDate.FFieldType := FType;
FField.FDateTime.FFieldType := FType;
FField.FTime.FFieldType := FType;
FField.FParagraph.FFieldType := FType;
FField.FFormulas.FFieldType := FType;
end;
{------------------------------------------------------------------------------}
{ SetFNum }
{------------------------------------------------------------------------------}
procedure TCrpeFieldObjectFormat.SetFNum(nField: Smallint);
begin
FFieldN := nField;
FField.FFieldN := nField;
FField.FNumber.FFieldN := nField;
FField.FDate.FFieldN := nField;
FField.FDateTime.FFieldN := nField;
FField.FTime.FFieldN := nField;
FField.FParagraph.FFieldN := nField;
FField.FFormulas.FFieldN := nField;
end;
end.
|
unit CCMFMakerFrm;
interface
uses
Winapi.Windows,
Winapi.Messages,
Winapi.ShellApi,
System.SysUtils,
System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.StdCtrls,
Vcl.ExtCtrls,
Vcl.ComCtrls,
Vcl.Buttons,
GR32,
GR32_Layers,
GR32_Image,
GLFileTGA,
uHeightmapClasses;
type
TMFMakerForm = class(TForm)
Image32_Terrain: TImage32;
Panel1: TPanel;
SaveBtn: TSpeedButton;
ExitBtn: TSpeedButton;
HelpBtn: TSpeedButton;
Button_GO: TSpeedButton;
EdgesBtn: TSpeedButton;
ClearBtn: TSpeedButton;
GoTB: TTrackBar;
SizeRG: TRadioGroup;
Memo_Octaves: TMemo;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
ScrollBar_Radius: TScrollBar;
ScrollBar_Depth: TScrollBar;
CheckBox_Box: TCheckBox;
SaveDialog1: TSaveDialog;
CheckBox_RenderWater: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure ExitBtnClick(Sender: TObject);
procedure HelpBtnClick(Sender: TObject);
procedure SizeRGClick(Sender: TObject);
procedure ClearBtnClick(Sender: TObject);
procedure Button_GOClick(Sender: TObject);
procedure EdgesBtnClick(Sender: TObject);
procedure Image32_TerrainMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer;
Layer: TCustomLayer);
procedure Image32_TerrainMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer; Layer: TCustomLayer);
procedure SaveBtnClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
HeightMap : THeightMap;
FirstTime:Boolean;
procedure DoRender;
//procedure SetStatus(s : string);
end;
var
MFMakerForm: TMFMakerForm;
StartPath : string;
const
BASE_DIR = 'Output\';
implementation
uses
StrFunctions,CCEditorFrm;
{$R *.DFM}
procedure TMFMakerForm.FormCreate(Sender: TObject);
begin
FirstTime:=True;
end;
procedure TMFMakerForm.FormShow(Sender: TObject);
begin
If FirstTime then begin
FirstTime:=False;
Image32_Terrain.Bitmap.SetSize(Image32_Terrain.Width, Image32_Terrain.Height);
Heightmap := THeightMap.Create(Image32_Terrain.Width, Image32_Terrain.Height);
Button_GO.Click;
//StartPath := ExtractFilePath(ParamStr(0));
StartPath := GetCurrentDir+'\';
DoRender;
end;
end;
procedure TMFMakerForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Heightmap.Destroy;
end;
procedure TMFMakerForm.ExitBtnClick(Sender: TObject);
begin
close;
end;
procedure TMFMakerForm.HelpBtnClick(Sender: TObject);
begin
ShellExecute(
Application.Handle, // handle to parent window
'open', // pointer to string that specifies operation to perform
PChar(ExtractFilePath(ParamStr(0))+'MFClouds.htm'),// pointer to filename or folder name string
'',// pointer to string that specifies executable-file parameters
//+'help'
PChar(ExtractFilePath(ParamStr(0))),// pointer to string that specifies default directory
SW_SHOWNORMAL);
end;
procedure TMFMakerForm.SizeRGClick(Sender: TObject);
begin
Case SizeRG.ItemIndex of
0: Begin Image32_Terrain.Width:=64; Image32_Terrain.Height:=64; ClearBtnClick(Self);End;
1: Begin Image32_Terrain.Width:=128; Image32_Terrain.Height:=128; ClearBtnClick(Self);End;
2: Begin Image32_Terrain.Width:=256; Image32_Terrain.Height:=256; ClearBtnClick(Self);End;
end;
Image32_Terrain.Bitmap.SetSize(Image32_Terrain.Width, Image32_Terrain.Height);
Heightmap.Destroy;
Heightmap := THeightMap.Create(Image32_Terrain.Width, Image32_Terrain.Height);
ClearBtnClick(Self);
end;
procedure TMFMakerForm.ClearBtnClick(Sender: TObject);
begin
Heightmap.Height.Clear;
DoRender;
end;
procedure TMFMakerForm.Button_GOClick(Sender: TObject);
var
s : string;
i : integer;
f, a : single;
x,y : integer;
maxd : single;
d : single;
begin //Hidden under the panel...
for i := 0 to Memo_Octaves.Lines.Count-1 do
begin
s := Memo_Octaves.Lines[i];
if s='clear' then
begin
Heightmap.Height.Clear;
Continue;
end;
if s='rescale' then
begin
HeightMap.Rescale(0,1);
Continue;
end;
if s='bubble' then
begin
maxd := sqrt(sqr(HeightMap.SizeX/2));//sqr(HeightMap.SizeY/2));
for x := 0 to HeightMap.SizeX-1 do
for y := 0 to HeightMap.SizeY-1 do
begin
d := sqrt(sqr(x-HeightMap.SizeX/2)+sqr(y-HeightMap.SizeY/2));
if d>MaxD then
HeightMap.Height[x,y] := 0
else
HeightMap.Height[x,y] := 2-2*d/maxd;
end;
//HeightMap.Rescale(0,1);
Continue;
end;
if GetBefore('|', s)='s' then
begin
s := GetAfter('|',s);
f := StrToFloat(GetBefore('|', s));
a := StrToFloat(GetAfter('|', s));
Heightmap.Subdivide(trunc(f),a);
continue;
end;
if GetBefore('|', s)='n' then
begin
s := GetAfter('|',s);
f := StrToFloat(GetBefore('|', s));
a := StrToFloat(GetAfter('|', s));
Heightmap.AddNoise(f,a);
continue;
end;
if GetBefore('|', s)='mi' then
begin
Heightmap.MakeIsland(StrToFloat(GetAfter('|', s)));
continue;
end;
end;
DoRender;
end;
procedure TMFMakerForm.EdgesBtnClick(Sender: TObject);
begin
HeightMap.Rescale(0,1);
HeightMap.MakeIsland(0.1);
HeightMap.Rescale(0,1);
//HeightMap.ClampToLevel(0.5);
DoRender;
end;
procedure TMFMakerForm.Image32_TerrainMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer;
Layer: TCustomLayer);
var
Mult : integer;
begin
if ssRight in Shift then
Mult := 1
else
Mult := -1;
if CheckBox_Box.Checked then
HeightMap.BoxLower(x,y, Mult*ScrollBar_Depth.Position/100, ScrollBar_Radius.Position)
else
HeightMap.CircleLower(x,y, Mult*ScrollBar_Depth.Position/100, ScrollBar_Radius.Position);
DoRender;
end;
var
oldX : integer=-100;
oldY : integer=-100;
procedure TMFMakerForm.Image32_TerrainMouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer; Layer: TCustomLayer);
var
Mult : integer;
// r : integer;
begin
if ssRight in Shift then
Mult := 1
else
Mult := -1;
if (ssLeft in Shift) or (ssRight in Shift) then
begin
HeightMap.CircleLower(x,y, Mult*ScrollBar_Depth.Position/100, ScrollBar_Radius.Position);
DoRender;
end else
begin
// r := ScrollBar_Radius.Position;
end;
end;
procedure TMFMakerForm.SaveBtnClick(Sender: TObject);
var
fName : String;
tga : TTGAImage;
begin
// Image1
// SaveDialog1.Filter := 'MF Cloud image (*.bmp)|*.bmp';
SaveDialog1.Filter := 'MF Cloud image (*.bmp;*.tga)|*.bmp;*.tga';
SaveDialog1.InitialDir:=ImagePath;//ExtractFilePath(ParamStr(0));
SaveDialog1.DefaultExt:='bmp';
SaveDialog1.Filename:='';//'*.bmp' ;
If SaveDialog1.Execute then
begin
//Image1.picture.bitmap.SaveToFile(SaveDialog1.FileName);
//Image32_Terrain.Bitmap.SaveToFile(SaveDialog1.FileName);
fName:=SaveDialog1.FileName;
if ExtractFileExt(fName)='' then fName:=fName+'.bmp' else
if ExtractFileExt(fName)='.bmp' then begin {do nothing} end
else changefileext(fName,'.tga');
if LowerCase(ExtractFileExt(fName))='.tga' then begin
tga:=TTGAImage.Create;
try
tga.Assign(Image32_Terrain.Bitmap{bmp}{pic.Bitmap});
tga.SaveToFile(fName)
finally
tga.Free;
end;
end else //bmp.SaveToFile(fName);
//Saved2.SaveToFile(SaveDialog1.FileName);
Image32_Terrain.Bitmap.SaveToFile(SaveDialog1.FileName);
end;
end;
procedure TMFMakerForm.DoRender;
begin
Heightmap.RenderTo(Image32_Terrain.Bitmap,
CheckBox_RenderWater.Checked,
(GoTB.Position/10)
{0.2});
end;
{procedure TMFMakerForm.SetStatus(s: string);
begin
// StatusBar1.SimpleText := s;
end;}
end.
|
unit uSecondCopy;
interface
uses
Winapi.Windows,
System.SysUtils,
UnitSendMessageWithTimeoutThread,
uConstants,
uRuntime,
uSplashThread,
uShellIntegration,
uTranslate;
procedure FindRunningVersion;
procedure AllowRunSecondCopy;
implementation
var
HSemaphore: THandle = 0;
procedure FindRunningVersion;
var
MessageToSent: string;
CD: TCopyDataStruct;
Buf: Pointer;
P: PByte;
WinHandle: HWND;
begin
SetLastError(0);
HSemaphore := CreateSemaphore( nil, 0, 1, PChar(DB_ID));
if ((HSemaphore <> 0) and (GetLastError = ERROR_ALREADY_EXISTS)) then
begin
CloseHandle(HSemaphore);
HSemaphore := 0;
WinHandle := FindWindow(nil, PChar(DBID));
if WinHandle <> 0 then
begin
MessageToSent := GetCommandLine;
cd.dwData := WM_COPYDATA_ID;
cd.cbData := ((Length(MessageToSent) + 1) * SizeOf(Char));
GetMem(Buf, cd.cbData);
try
P := PByte(Buf);
StrPLCopy(PChar(P), MessageToSent, Length(MessageToSent));
cd.lpData := Buf;
if SendMessageEx(WinHandle, WM_COPYDATA, 0, NativeInt(@cd)) then
begin
CloseSplashWindow;
DBTerminating := True;
end else
begin
CloseSplashWindow;
if ID_YES <> MessageBoxDB(0, TA('This program is running, but isn''t responding! Run new instance?', 'System'), TA('Error'), TD_BUTTON_YESNO, TD_ICON_ERROR) then
DBTerminating := True;
end;
finally
FreeMem(Buf);
end;
end;
end;
end;
procedure AllowRunSecondCopy;
begin
if HSemaphore <> 0 then
CloseHandle(HSemaphore);
end;
end.
|
unit ThreadRefreshQuery;
interface
uses
Classes, Windows, Messages, SysUtils, Variants, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DB, Ora, ExFunc;
type
TThreadRefreshQuery = class(TThread)
FqOld, FqNew: TOraQuery;
FMethod: TThreadMethod;
FActiveThread, FCreateQNew, FCreateLog: boolean;
private
procedure Log(s: string); // лог
public
constructor Create(
AqOld: TOraQuery; AMethod: TThreadMethod; ACreateLog: boolean=false);
{
destructor Destroy; override;
function GetQNew(): boolean; // передаємо кверю
}
protected
procedure Execute; override;
end;
implementation
{ TThreadRefreshQuery }
constructor TThreadRefreshQuery.Create(
AqOld: TOraQuery; AMethod: TThreadMethod; ACreateLog: boolean=false);
begin
inherited Create(True);
FreeOnTerminate := true;
Priority := tpHigher;
FActiveThread := true;
FCreateQNew := false;
FCreateLog := ACreateLog; // лог
Log('Создание ...'); // лог
FqOld := AqOld;
FMethod := AMethod;
Resume;
end;
procedure TThreadRefreshQuery.Execute;
var
iBreak, i: integer;
//****************************************************************************
procedure KillThread(); // якщо ми хочимо знищити процес до його завершення
begin
if not FActiveThread then
raise Exception.Create('FActiveThread = False');
end;
//****************************************************************************
begin
Log('TOraQuery('+ FqOld.Name +', '+ IntToStr(FqOld.RecordCount) +'), TThreadMethod('+ VarToStr(Assigned(FMethod)) +')'); // лог
Log('Выполнение ...'); // лог
try
try
FqNew := TOraQuery.Create(FqOld.Owner);
FqNew.Assign(FqOld);
FqNew.FetchAll := true;
FqNew.NonBlocking := true;
for i := 0 to FqNew.Params.Count-1 do
Log('Params: '+ FqNew.Params[i].Name +' - '+ FqNew.Params[i].AsString); // лог
Log('SQL: '+ copy(FqNew.SQL.Text, 1, 100)); // лог
FqNew.Close;
FqNew.Open;
iBreak := 0;
while not (FqNew.Active and FqNew.Fetched) do
begin
KillThread(); // якщо ми хочимо знищити процес до його завершення
Sleep(60);
inc(iBreak);
if iBreak > 1000 then
raise Exception.Create('Fetched 60 second');
end;
Log('TOraQuery('+ FqOld.Name +', '+ IntToStr(FqNew.RecordCount) +')'); // лог
FqNew.Filter := FqOld.Filter;
FqNew.Filtered := FqOld.Filtered;
Log('TOraQuery('+ FqOld.Name +', '+ IntToStr(FqNew.RecordCount) +')'); // лог
KillThread(); // якщо ми хочимо знищити процес до його завершення
except on E: Exception do
begin
FActiveThread := false; // завершуємо роботу потоку
Log('Ошибка: '+ E.Message); // лог
exit; // вихід
end;
end;
FqNew.NonBlocking := false;
FCreateQNew := true;
Log('FCreateQNew := True'); // лог
if Assigned(FMethod) then
Synchronize(FMethod);
while FActiveThread do
Sleep(10);
finally
Log('Уничтожение ...'); // лог
FActiveThread := false;
FCreateQNew := false;
end;
end;
{
destructor TThreadRefreshQuery.Destroy;
begin
Log('Уничтожение ...'); // лог
FActiveThread := false;
FCreateQNew := false;
Terminate;
WaitFor;
FreeOnTerminate := true;
inherited Destroy;
end;
function TThreadRefreshQuery.GetQNew(): boolean; // передаємо кверю
var
sName: string;
begin
result := false;
if FCreateQNew then
begin
sName := FqOld.Name;
FqOld.Close;
FqOld.Free;
FqNew.Name := sName;
FqOld := FqNew;
result := true;
end;
end;
}
procedure TThreadRefreshQuery.Log(s: string); // лог
begin
if FCreateLog then
begin
if not DirectoryExists(GetMainDir +'Thread') then
CreateDir(GetMainDir +'Thread');
ExFunc.log(GetMainDir +'Thread\Thread_'+ VarToStr(Self.ThreadID) +'.log',
FormatDateTime('dd.mm.yyyy hh:nn:ss', now()) +' '+ s);
end;
end;
end.
|
unit uColorTheme;
interface
uses Graphics, uUtils, Classes, SysUtils;
{
For serialization
}
type ColorThemeRecord = record
interact, active, text,
textfield, warn, title,
background,
coordBG, coordGrid, coordPoint, coordOutline,
coordLine, coordText, coordAxis, scrollbarBG: TColor;
name: String[255];
end;
{
Represents common theme instance
}
type ColorTheme = class
interact, active, text,
textfield, warn, title,
background,
coordBG, coordGrid, coordPoint, coordOutline,
coordLine, coordText, coordAxis, scrollbarBG: TColor;
name: String[255];
constructor Create(name: String);
end;
// used by default
var CT_DEFAULT_THEME: ColorTheme;
{
Generic behavior for ColorTheme supporters
}
type IThemeSupporter = interface
['{7CCBBBE9-45F9-4AD4-836C-1F4023526034}'] // ctrl-shift-g
procedure setTheme(theme: ColorTheme);
function getTheme(): ColorTheme;
procedure updateColors();
end;
{
Returns class instance
}
function ctToClass(r: ColorThemeRecord): ColorTheme;
{
Returns record instance
}
function ctToRecord(ct: ColorTheme): ColorThemeRecord;
{
Returns new class instance
}
function ctCopy(r: ColorTheme): ColorTheme;
{
Reads file into class instance
}
function ctImport(path: String): ColorTheme;
{
Saves class instance into file
}
procedure ctExport(path: String; ct: ColorTheme);
implementation
// ColorTheme
constructor ColorTheme.Create(name: String);
begin
title := clHighLight;
active := $009b9b69; //TColor(RGB(105, 155, 155));
interact := cl3DDkShadow;
textfield := $00888888;
text := clWhite;
background := clBtnShadow;
warn := $0055aaaa;
coordBG := $00dddddd;
coordGrid := $00cccccc0;
coordPoint := clWhite;
coordOutline := interact;
coordLine := coordOutline;
coordText := background;
coordAxis := interact;
scrollbarBG := textfield;
self.name := name;
end;
function ctToRecord(ct: ColorTheme): ColorThemeRecord;
var r: ColorThemeRecord;
begin
r.title := ct.title;
r.active := ct.active;
r.interact := ct.interact;
r.textfield := ct.textfield;
r.text := ct.text;
r.background := ct.background;
r.warn := ct.warn;
r.coordBG := ct.coordBG;
r.coordGrid := ct.coordGrid;
r.coordPoint := ct.coordPoint;
r.coordOutline := ct.coordOutline;
r.name := ct.name;
r.coordLine := ct.coordLine;
r.coordText := ct.coordText;
r.coordAxis := ct.coordAxis;
r.scrollbarBG := ct.scrollbarBG;
ctToRecord := r;
end;
function ctToClass(r: ColorThemeRecord): ColorTheme;
var ct: ColorTheme;
begin
ct := ColorTheme.Create('Some theme');
ct.title := r.title;
ct.active := r.active;
ct.interact := r.interact;
ct.textfield := r.textfield;
ct.text := r.text;
ct.background := r.background;
ct.warn := r.warn;
ct.coordBG := r.coordBG;
ct.coordGrid := r.coordGrid;
ct.coordPoint := r.coordPoint;
ct.coordOutline := r.coordOutline;
ct.name := r.name;
ct.coordLine := r.coordLine;
ct.coordText := r.coordText;
ct.coordAxis := r.coordAxis;
ct.scrollbarBG := r.scrollbarBG;
ctToClass := ct;
end;
function ctCopy(r: ColorTheme): ColorTheme;
var ct: ColorTheme;
begin
ct := ColorTheme.Create('Copy of ' + r.name);
ct.title := r.title;
ct.active := r.active;
ct.interact := r.interact;
ct.textfield := r.textfield;
ct.text := r.text;
ct.background := r.background;
ct.warn := r.warn;
ct.coordBG := r.coordBG;
ct.coordGrid := r.coordGrid;
ct.coordPoint := r.coordPoint;
ct.coordOutline := r.coordOutline;
ct.name := r.name;
ct.coordLine := r.coordLine;
ct.coordText := r.coordText;
ct.coordAxis := r.coordAxis;
ct.scrollbarBG := r.scrollbarBG;
ctCopy := ct;
end;
procedure ctExport(path: String; ct: ColorTheme);
var
fs: TFileStream;
r: ColorThemeRecord;
begin
newFile(path);
fs := TFileStream.Create(path, fmOpenWrite);
r := ctToRecord(ct);
fs.Write(r, sizeOf(ColorThemeRecord)); // req
fs.Free;
end;
function ctImport(path: String): ColorTheme;
var
fs: TFileStream;
r: ColorThemeRecord;
begin
ctImport := nil;
if FileExists(path) then begin
fs := TFileStream.Create(path, fmOpenRead);
fs.Read(r, sizeOf(ColorThemeRecord));
ctImport := ctToClass(r);
fs.Free;
end;
end;
initialization
// init default theme
CT_DEFAULT_THEME := ColorTheme.Create('Default');
end.
|
program HelloWorld;
//{IFNDEF UNIX} {r GameLauncher.res} {ENDIF}
uses
sgTypes, SwinGame;
procedure TestRectLineCollision();
var
lns: array [0..3] of LineSegment;
r: Rectangle;
i: Integer;
begin
r := RectangleFrom(50, 50, 50, 50);
DrawRectangle(ColorWhite, r);
lns[0] := LineFrom(PointAt(55, 55), MousePosition());
for i := 0 to 0 do
begin
if RectLineCollision(r, lns[i]) then
DrawLine(ColorRed, lns[i])
else
DrawLine(ColorBlue, lns[i]);
end;
end;
procedure Main();
var
rect, rect2: Rectangle;
mvmtLn: LineSegment;
mvmt, outMvmt: Vector;
tmr: Timer;
mat: Matrix2D;
begin
OpenAudio();
OpenGraphicsWindow('Collision Test', 800, 600);
rect := RectangleFrom(303, 453, 5, 5);
rect2 := RectangleFrom(300, 450, 10, 10);
mvmt := VectorTo(100, 0);
tmr := CreateTimer();
StartTimer(tmr);
mat := RotationMatrix(10);
repeat // The game loop...
ProcessEvents();
//DrawBitmap(BitmapNamed('SplashBack'), 0, 0);
ClearScreen(ColorBlack);
TestRectLineCollision();
FillRectangle(ColorWhite, rect);
DrawRectangle(ColorGreen, rect2);
if TimerTicks(tmr) div 500 > 0 then
begin
mvmt := MatrixMultiply(mat, mvmt);
ResetTimer(tmr);
end;
mvmtLn := LineFromVector(rect.x + rect.width / 2, rect.y + rect.height / 2, mvmt);
DrawLine(ColorRed, mvmtLn);
outMvmt := VectorOutOfRectFromRect(rect, rect2, mvmt);
mvmtLn := LineFromVector(rect.x, rect.y, outMvmt);
DrawLine(ColorBlue, mvmtLn);
DrawRectangle(ColorBlue, rect.x + outMvmt.x, rect.y + outMvmt.y, rect.width, rect.height);
DrawFramerate(0,0);
RefreshScreen();
until WindowCloseRequested();
ReleaseAllResources();
CloseAudio();
end;
begin
Main();
end.
|
{*******************************************************************************
Title: T2Ti ERP
Description: VO relacionado à tabela [FIN_CONFIGURACAO_BOLETO]
The MIT License
Copyright: Copyright (C) 2016 T2Ti.COM
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The author may be contacted at:
t2ti.com@gmail.com
@author Albert Eije (t2ti.com@gmail.com)
@version 2.0
*******************************************************************************}
unit FinConfiguracaoBoletoVO;
{$mode objfpc}{$H+}
interface
uses
VO, Classes, SysUtils, FGL,
ContaCaixaVO;
type
TFinConfiguracaoBoletoVO = class(TVO)
private
FID: Integer;
FID_CONTA_CAIXA: Integer;
FID_EMPRESA: Integer;
FINSTRUCAO01: String;
FINSTRUCAO02: String;
FCAMINHO_ARQUIVO_REMESSA: String;
FCAMINHO_ARQUIVO_RETORNO: String;
FCAMINHO_ARQUIVO_LOGOTIPO: String;
FCAMINHO_ARQUIVO_PDF: String;
FMENSAGEM: String;
FLOCAL_PAGAMENTO: String;
FLAYOUT_REMESSA: String;
FACEITE: String;
FESPECIE: String;
FCARTEIRA: String;
FCODIGO_CONVENIO: String;
FCODIGO_CEDENTE: String;
FTAXA_MULTA: Extended;
//Transientes
FContaCaixaNome: String;
FContaCaixaVO: TContaCaixaVO;
published
constructor Create; override;
destructor Destroy; override;
property Id: Integer read FID write FID;
property IdContaCaixa: Integer read FID_CONTA_CAIXA write FID_CONTA_CAIXA;
property ContaCaixaNome: String read FContaCaixaNome write FContaCaixaNome;
property IdEmpresa: Integer read FID_EMPRESA write FID_EMPRESA;
property Instrucao01: String read FINSTRUCAO01 write FINSTRUCAO01;
property Instrucao02: String read FINSTRUCAO02 write FINSTRUCAO02;
property CaminhoArquivoRemessa: String read FCAMINHO_ARQUIVO_REMESSA write FCAMINHO_ARQUIVO_REMESSA;
property CaminhoArquivoRetorno: String read FCAMINHO_ARQUIVO_RETORNO write FCAMINHO_ARQUIVO_RETORNO;
property CaminhoArquivoLogotipo: String read FCAMINHO_ARQUIVO_LOGOTIPO write FCAMINHO_ARQUIVO_LOGOTIPO;
property CaminhoArquivoPdf: String read FCAMINHO_ARQUIVO_PDF write FCAMINHO_ARQUIVO_PDF;
property Mensagem: String read FMENSAGEM write FMENSAGEM;
property LocalPagamento: String read FLOCAL_PAGAMENTO write FLOCAL_PAGAMENTO;
property LayoutRemessa: String read FLAYOUT_REMESSA write FLAYOUT_REMESSA;
property Aceite: String read FACEITE write FACEITE;
property Especie: String read FESPECIE write FESPECIE;
property Carteira: String read FCARTEIRA write FCARTEIRA;
property CodigoConvenio: String read FCODIGO_CONVENIO write FCODIGO_CONVENIO;
property CodigoCedente: String read FCODIGO_CEDENTE write FCODIGO_CEDENTE;
property TaxaMulta: Extended read FTAXA_MULTA write FTAXA_MULTA;
//Transientes
property ContaCaixaVO: TContaCaixaVO read FContaCaixaVO write FContaCaixaVO;
end;
TListaFinConfiguracaoBoletoVO = specialize TFPGObjectList<TFinConfiguracaoBoletoVO>;
implementation
constructor TFinConfiguracaoBoletoVO.Create;
begin
inherited;
FContaCaixaVO := TContaCaixaVO.Create;
end;
destructor TFinConfiguracaoBoletoVO.Destroy;
begin
FreeAndNil(FContaCaixaVO);
inherited;
end;
initialization
Classes.RegisterClass(TFinConfiguracaoBoletoVO);
finalization
Classes.UnRegisterClass(TFinConfiguracaoBoletoVO);
end.
|
unit uMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg, Buttons;
type
TfrmMain = class(TForm)
Label1: TLabel;
Label2: TLabel;
imgSystemInfo: TImage;
Label3: TLabel;
Label4: TLabel;
Panel1: TPanel;
btnConnection: TBitBtn;
btnUserList: TBitBtn;
Bevel1: TBevel;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure btnUserListClick(Sender: TObject);
procedure btnConnectionClick(Sender: TObject);
private
FUserList: TStringList;
FIDClient: String;
public
function GetConfigFile: String;
function Encode(Key, Value:String): String;
function Decode(Key, Value:String): String;
property UserList: TStringList read FUserList write FUserList;
property IDClient: String read FIDClient write FIDClient;
end;
var
frmMain: TfrmMain;
implementation
uses uFrmConnection, uEncryptFunctions;
{$R *.dfm}
procedure TfrmMain.FormCreate(Sender: TObject);
begin
FUserList := TStringList.Create;
end;
procedure TfrmMain.FormDestroy(Sender: TObject);
begin
FreeAndNil(FUserList);
end;
procedure TfrmMain.btnUserListClick(Sender: TObject);
begin
ShowMessage(FUserList.Text);
end;
function TfrmMain.GetConfigFile: String;
begin
{ Alex 08/15/2011 }
// Result := ChangeFileExt(ExtractFileName(Application.ExeName), '.ini');
Result := 'MRAppServer.ini';
end;
procedure TfrmMain.btnConnectionClick(Sender: TObject);
begin
with TFrmConnection.Create(Self) do
Start;
end;
function TfrmMain.Decode(Key, Value: String): String;
begin
Result := DecodeServerInfo(Value, Key, CIPHER_TEXT_STEALING, FMT_UU);
end;
function TfrmMain.Encode(Key, Value: String): String;
begin
Result := EncodeServerInfo(Value, Key, CIPHER_TEXT_STEALING, FMT_UU);
end;
end.
|
(***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is TurboPower Async Professional
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1991-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* EXSCRIP0.PAS 4.06 *}
{*********************************************************}
{**********************Description************************}
{* Demonstrates the use of ApdScript with ApdProtocol *}
{* and ApdProtocolStatus displayed on an AdTerminal.*}
{*********************************************************}
unit ExScrip0;
interface
uses
WinTypes, WinProcs, SysUtils, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, AdScript, AdPort, AdProtcl, AdPStat,
OoMisc, ADTrmEmu;
type
TForm1 = class(TForm)
ApdComPort1: TApdComPort;
Start: TButton;
ApdScript1: TApdScript;
Quit: TButton;
ApdProtocol1: TApdProtocol;
ApdProtocolStatus1: TApdProtocolStatus;
AdTerminal1: TAdTerminal;
procedure StartClick(Sender: TObject);
procedure ApdScript1ScriptFinish(CP: TObject; Condition: Integer);
procedure QuitClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.StartClick(Sender: TObject);
begin
ApdScript1.StartScript;
end;
procedure TForm1.ApdScript1ScriptFinish(CP: TObject; Condition: Integer);
begin
ShowMessage('Script finished!');
end;
procedure TForm1.QuitClick(Sender: TObject);
begin
Close;
end;
end.
|
unit ibSHStatisticsFrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
DB, VirtualTrees, ImgList,
ExtCtrls, Math, Clipbrd,
SHDesignIntf, ibSHDesignIntf, ibSHDriverIntf, ibSHComponentFrm, ibSHMessages, ibSHConsts,
ibSHValues, SynEdit, pSHSynEdit, ComCtrls, Menus;
type
TStatisticNodeType = (ptRoot, ptCommon, ptTabelName, ptOperation);
TStatisticKind = (pkIdxReads, pkSeqReads, pkUpdates, pkDeletes, pkInserts,
pkBackoutCount, pkExpunge, pkPurge);
PStatisticRec = ^TStatisticRec;
TStatisticRec = record
NodeType: TStatisticNodeType;
StatisticKind: TStatisticKind;
Text: string;
Value: string;
IntValue: Integer;
ImageIndex: Integer;
end;
TibBTStatisticsForm = class(TibBTComponentForm, ISHRunCommands, ISHEditCommands,
IibSHStatisticsForm)
vtStatistic: TVirtualDrawTree;
ImageList1: TImageList;
Panel4: TPanel;
pSHSynEdit2: TpSHSynEdit;
Splitter2: TSplitter;
PopupMenuMessage: TPopupMenu;
pmiHideMessage: TMenuItem;
procedure vtStatisticHeaderClick(Sender: TVTHeader;
Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
procedure vtStatisticFreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
procedure vtStatisticGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
var Ghosted: Boolean; var ImageIndex: Integer);
procedure vtStatisticGetNodeDataSize(Sender: TBaseVirtualTree;
var NodeDataSize: Integer);
procedure vtStatisticDrawNode(Sender: TBaseVirtualTree;
const PaintInfo: TVTPaintInfo);
procedure pmiHideMessageClick(Sender: TObject);
private
FCurrentMaxValue: Integer;
function GetStatistics: IibSHStatistics;
function GetShowSysTables: Boolean;
procedure ShowMessages;
procedure HideMessages;
procedure GutterDrawNotify(Sender: TObject; ALine: Integer; var ImageIndex: Integer);
protected
{ ISHRunCommands }
function GetCanRun: Boolean; override;
function GetCanPause: Boolean; override;
function GetCanCreate: Boolean; override;
function GetCanAlter: Boolean; override;
function GetCanClone: Boolean; override;
function GetCanDrop: Boolean; override;
function GetCanRecreate: Boolean; override;
function GetCanDebug: Boolean; override;
function GetCanCommit: Boolean; override;
function GetCanRollback: Boolean; override;
function GetCanRefresh: Boolean; override;
procedure Run; override;
procedure Pause; override;
procedure ISHRunCommands.Create = ICreate;
procedure ICreate; override;
procedure Alter; override;
procedure Clone; override;
procedure Drop; override;
procedure Recreate; override;
procedure Debug; override;
procedure Commit; override;
procedure Rollback; override;
procedure Refresh; override;
{ ISHEditCommands }
function GetCanUndo: Boolean; override;
function GetCanRedo: Boolean; override;
function GetCanCut: Boolean; override;
function GetCanCopy: Boolean; override;
function GetCanPaste: Boolean; override;
function GetCanSelectAll: Boolean; override;
function GetCanClearAll: Boolean; override;
procedure Undo; override;
procedure Redo; override;
procedure Cut; override;
procedure Copy; override;
procedure Paste; override;
procedure SelectAll; override;
procedure ClearAll; override;
procedure FillTree;
property Statistics: IibSHStatistics read GetStatistics;
property ShowSysTables: Boolean read GetShowSysTables;
public
{ Public declarations }
constructor Create(AOwner: TComponent; AParent: TWinControl;
AComponent: TSHComponent; ACallString: string); override;
property CurrentMaxValue: Integer read FCurrentMaxValue write FCurrentMaxValue;
end;
var
ibBTStatisticsForm: TibBTStatisticsForm;
implementation
{$R *.dfm}
{ TibBTStatisticsForm }
constructor TibBTStatisticsForm.Create(AOwner: TComponent;
AParent: TWinControl; AComponent: TSHComponent; ACallString: string);
begin
inherited Create(AOwner, AParent, AComponent, ACallString);
ImageList1.AddImage(Designer.ImageList, Designer.GetImageIndex(IibSHTable));
Editor := pSHSynEdit2;
Editor.Lines.Clear;
Editor.OnGutterDraw := GutterDrawNotify;
Editor.GutterDrawer.ImageList := ImageList1;
Editor.GutterDrawer.Enabled := True;
RegisterEditors;
FillTree;
FocusedControl := vtStatistic;
end;
function TibBTStatisticsForm.GetStatistics: IibSHStatistics;
begin
Supports(Component, IibSHStatistics, Result);
end;
function TibBTStatisticsForm.GetShowSysTables: Boolean;
begin
Result := False;
end;
procedure TibBTStatisticsForm.ShowMessages;
begin
Panel4.Visible := True;
Splitter2.Visible := True;
end;
procedure TibBTStatisticsForm.HideMessages;
begin
Panel4.Visible := False;
Splitter2.Visible := False;
end;
procedure TibBTStatisticsForm.GutterDrawNotify(Sender: TObject; ALine: Integer;
var ImageIndex: Integer);
begin
if ALine = 0 then ImageIndex := 2;
end;
function TibBTStatisticsForm.GetCanRun: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanPause: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanCreate: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanAlter: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanClone: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanDrop: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanRecreate: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanDebug: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanCommit: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanRollback: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanRefresh: Boolean;
begin
Result := Assigned(Statistics) and Assigned(Statistics.Database) and
(not Statistics.Database.WasLostConnect);
end;
procedure TibBTStatisticsForm.Run;
begin
//
end;
procedure TibBTStatisticsForm.Pause;
begin
//
end;
procedure TibBTStatisticsForm.ICreate;
begin
//
end;
procedure TibBTStatisticsForm.Alter;
begin
//
end;
procedure TibBTStatisticsForm.Clone;
begin
//
end;
procedure TibBTStatisticsForm.Drop;
begin
//
end;
procedure TibBTStatisticsForm.Recreate;
begin
//
end;
procedure TibBTStatisticsForm.Debug;
begin
//
end;
procedure TibBTStatisticsForm.Commit;
begin
//
end;
procedure TibBTStatisticsForm.Rollback;
begin
//
end;
procedure TibBTStatisticsForm.Refresh;
begin
FillTree;
end;
function TibBTStatisticsForm.GetCanUndo: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanRedo: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanCut: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanCopy: Boolean;
begin
Result := True;
end;
function TibBTStatisticsForm.GetCanPaste: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanSelectAll: Boolean;
begin
Result := False;
end;
function TibBTStatisticsForm.GetCanClearAll: Boolean;
begin
Result := False;
end;
procedure TibBTStatisticsForm.Undo;
begin
//
end;
procedure TibBTStatisticsForm.Redo;
begin
//
end;
procedure TibBTStatisticsForm.Cut;
begin
//
end;
procedure TibBTStatisticsForm.Copy;
var
vStrToCopy: string;
vShowGarbageStatistic: Boolean;
I: Integer;
vDataset: IibSHDRVDataset;
vQuery: IibSHDRVQuery;
S: string;
begin
vStrToCopy := EmptyStr;
if Assigned(Statistics) then
begin
if Supports(Statistics.DRVTimeStatistics, IibSHDRVDataset, vDataset) then
begin
S := vDataset.SelectSQL.Text;
if Length(S) > 0 then vStrToCopy := vStrToCopy + S + sLineBreak + sLineBreak;
{
if vDataset.Active then
try
vStrToCopy := vStrToCopy + vDataset.Plan + sLineBreak + sLineBreak;
except
end;
}
end
else
if Supports(Statistics.DRVTimeStatistics, IibSHDRVQuery, vQuery) then
begin
S := vQuery.SQL.Text;
if Length(S) > 0 then vStrToCopy := vStrToCopy + S + sLineBreak + sLineBreak;
{
if vQuery.Prepared then
try
vStrToCopy := vStrToCopy + vQuery.Plan + sLineBreak + sLineBreak;
except
end;
}
end;
vStrToCopy := vStrToCopy + SOperationsPerTable + sLineBreak;
with Statistics.DRVStatistics do
begin
for I := 0 to Pred(TablesCount) do
begin
if not ShowSysTables then
if Pos('RDB$', TableStatistics[I].TableName) = 1 then continue;
if (not (TableStatistics[I].IdxReads + TableStatistics[I].SeqReads +
TableStatistics[I].Inserts + TableStatistics[I].Updates+
TableStatistics[I].Deletes = 0)) then
begin
vStrToCopy := vStrToCopy + TableStatistics[I].TableName + sLineBreak;
if TableStatistics[I].SeqReads > 0 then
vStrToCopy := vStrToCopy +
FormatFloat('###,###,###,###,##0', TableStatistics[I].SeqReads) +
SNonIndexedReads + sLineBreak;
if TableStatistics[I].IdxReads > 0 then
vStrToCopy := vStrToCopy +
FormatFloat('###,###,###,###,##0', TableStatistics[I].IdxReads) +
SIndexedReads + sLineBreak;
if TableStatistics[I].Inserts > 0 then
vStrToCopy := vStrToCopy +
FormatFloat('###,###,###,###,##0', TableStatistics[I].Inserts) +
SInserts + sLineBreak;
if TableStatistics[I].Updates > 0 then
vStrToCopy := vStrToCopy +
FormatFloat('###,###,###,###,##0', TableStatistics[I].Updates) +
SUpdates + sLineBreak;
if TableStatistics[I].Deletes > 0 then
vStrToCopy := vStrToCopy +
FormatFloat('###,###,###,###,##0', TableStatistics[I].Deletes) +
SDeletes + sLineBreak;
end;
end;
// Garbage collection statistic - никогда ничего не показывает ???
vShowGarbageStatistic := False;
for I := 0 to Pred(TablesCount) do
if (TableStatistics[I].Backout + TableStatistics[I].Expunge +
TableStatistics[I].Purge > 0) then
begin
vShowGarbageStatistic := True;
Break;
end;
if vShowGarbageStatistic then
begin
vStrToCopy := vStrToCopy + SGarbageStatistics + sLineBreak;
for I := 0 to Pred(TablesCount) do
begin
if not ShowSysTables then
if Pos('RDB$', TableStatistics[I].TableName) = 1 then continue;
if (not (TableStatistics[I].Backout + TableStatistics[I].Expunge +
TableStatistics[I].Purge = 0)) then
begin
vStrToCopy := vStrToCopy + TableStatistics[I].TableName + sLineBreak;
if TableStatistics[I].Backout > 0 then
vStrToCopy := vStrToCopy +
FormatFloat('###,###,###,###,##0', TableStatistics[I].Backout) +
SBackouts + sLineBreak;
if TableStatistics[I].Expunge > 0 then
vStrToCopy := vStrToCopy +
FormatFloat('###,###,###,###,##0', TableStatistics[I].Expunge) +
SExpunges + sLineBreak;
if TableStatistics[I].Purge > 0 then
vStrToCopy := vStrToCopy +
FormatFloat('###,###,###,###,##0', TableStatistics[I].Purge) +
SPurges + sLineBreak;
end;
end;
end;
end;
if Assigned(Statistics.DRVTimeStatistics) then
with Statistics.DRVTimeStatistics do
begin
vStrToCopy := vStrToCopy + SQueryTime + sLineBreak;
vStrToCopy := vStrToCopy + SPrepare + ':' + msToStr(PrepareTime) + sLineBreak;
vStrToCopy := vStrToCopy + SExecute + ':' + msToStr(ExecuteTime) + sLineBreak;
vStrToCopy := vStrToCopy + SFetch + ':' + msToStr(FetchTime) + sLineBreak;
end;
end;
if Length(vStrToCopy) > 0 then
Clipboard.AsText := vStrToCopy;
end;
procedure TibBTStatisticsForm.Paste;
begin
//
end;
procedure TibBTStatisticsForm.SelectAll;
begin
//
end;
procedure TibBTStatisticsForm.ClearAll;
begin
//
end;
procedure TibBTStatisticsForm.FillTree;
var
Level_0: PVirtualNode;
Level_1: PVirtualNode;
Level_2: PVirtualNode;
Data: PStatisticRec;
I: Integer;
vShowGarbageStatistic: Boolean;
vDataSet: IibSHDRVDataset;
vQuery: IibSHDRVQuery;
vTemp: Integer;
begin
with vtStatistic do
begin
BeginUpdate;
HideMessages;
vtStatistic.Clear;
if Assigned(Statistics) then
begin
if Assigned(Statistics.DRVTimeStatistics) then
with Statistics.DRVTimeStatistics do
begin
if Assigned(Editor) then
begin
if Supports(Statistics.DRVTimeStatistics, IibSHDRVDataset, vDataSet) then
begin
Designer.TextToStrings(vDataSet.SelectSQL.Text, Editor.Lines, True);
ShowMessages;
end
else
if Supports(Statistics.DRVTimeStatistics, IibSHDRVQuery, vQuery) then
begin
Designer.TextToStrings(vQuery.SQL.Text, Editor.Lines, True);
ShowMessages;
end;
end;
Level_0 := AddChild(nil);
Data := GetNodeData(Level_0);
Data.Text := SQueryTime;
Data.Value := '';
Data.NodeType := ptRoot;
Data.ImageIndex := 1;
Level_1 := AddChild(Level_0);
Data := GetNodeData(Level_1);
Data.Text := SPrepare;
Data.Value := msToStr(PrepareTime);
Data.IntValue := PrepareTime;
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_1 := AddChild(Level_0);
Data := GetNodeData(Level_1);
Data.Text := SExecute;
Data.Value := msToStr(ExecuteTime);
Data.IntValue := ExecuteTime;
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_1 := AddChild(Level_0);
Data := GetNodeData(Level_1);
Data.Text := SFetch;
Data.Value := msToStr(FetchTime);
Data.IntValue := FetchTime;
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
end;
// Operations
Level_0 := AddChild(nil);
Data := GetNodeData(Level_0);
Data.Text := SOperationsPerTable;
Data.Value := '';
Data.NodeType := ptRoot;
Data.ImageIndex := 0;
with Statistics.DRVStatistics do
begin
CurrentMaxValue := 0;
// SortByPerformance;
for I := 0 to Pred(TablesCount) do
begin
if not ShowSysTables then
if Pos('RDB$', TableStatistics[I].TableName) = 1 then continue;
if (not (TableStatistics[I].IdxReads + TableStatistics[I].SeqReads +
TableStatistics[I].Inserts + TableStatistics[I].Updates+
TableStatistics[I].Deletes = 0)) then
begin
Level_1 := AddChild(Level_0);
Data := GetNodeData(Level_1);
Data.Text := TableStatistics[I].TableName;
Data.Value := '';
Data.NodeType := ptTabelName;
Data.ImageIndex := Pred(ImageList1.Count);
if TableStatistics[I].SeqReads > 0 then
begin
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := '';
Data.Value := FormatFloat('###,###,###,###,##0', TableStatistics[I].SeqReads);
Data.IntValue := TableStatistics[I].SeqReads;
if Data.IntValue > CurrentMaxValue then CurrentMaxValue := Data.IntValue;
Data.NodeType := ptOperation;
Data.StatisticKind := pkSeqReads;
Data.ImageIndex := -1;
end;
if TableStatistics[I].IdxReads > 0 then
begin
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := '';
Data.Value := FormatFloat('###,###,###,###,##0', TableStatistics[I].IdxReads);
Data.IntValue := TableStatistics[I].IdxReads;
if Data.IntValue > CurrentMaxValue then CurrentMaxValue := Data.IntValue;
Data.NodeType := ptOperation;
Data.StatisticKind := pkIdxReads;
Data.ImageIndex := -1;
end;
if TableStatistics[I].Inserts > 0 then
begin
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := '';
Data.Value := FormatFloat('###,###,###,###,##0', TableStatistics[I].Inserts);
Data.IntValue := TableStatistics[I].Inserts;
if Data.IntValue > CurrentMaxValue then CurrentMaxValue := Data.IntValue;
Data.NodeType := ptOperation;
Data.StatisticKind := pkInserts;
Data.ImageIndex := -1;
end;
if TableStatistics[I].Updates > 0 then
begin
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := '';
Data.Value := FormatFloat('###,###,###,###,##0', TableStatistics[I].Updates);
Data.IntValue := TableStatistics[I].Updates;
if Data.IntValue > CurrentMaxValue then CurrentMaxValue := Data.IntValue;
Data.NodeType := ptOperation;
Data.StatisticKind := pkUpdates;
Data.ImageIndex := -1;
end;
if TableStatistics[I].Deletes > 0 then
begin
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := '';
Data.Value := FormatFloat('###,###,###,###,##0', TableStatistics[I].Deletes);
Data.IntValue := TableStatistics[I].Deletes;
if Data.IntValue > CurrentMaxValue then CurrentMaxValue := Data.IntValue;
Data.NodeType := ptOperation;
Data.StatisticKind := pkDeletes;
Data.ImageIndex := -1;
end;
Expanded[Level_1] := True;
end;
end;
// Garbage collection statistic - никогда ничего не показывает ???
vShowGarbageStatistic := False;
for I := 0 to Pred(TablesCount) do
if (TableStatistics[I].Backout + TableStatistics[I].Expunge +
TableStatistics[I].Purge > 0) then
begin
vShowGarbageStatistic := True;
Break;
end;
if vShowGarbageStatistic then
begin
Level_0 := AddChild(nil);
Data := GetNodeData(Level_0);
Data.Text := SGarbageStatistics;
Data.Value := '';
Data.NodeType := ptRoot;
Data.ImageIndex := -1;
// SortByGarbageCollected;
for I := 0 to Pred(TablesCount) do
begin
if not ShowSysTables then
if Pos('RDB$', TableStatistics[I].TableName) = 1 then continue;
if (not (TableStatistics[I].Backout + TableStatistics[I].Expunge +
TableStatistics[I].Purge = 0)) then
begin
Level_1 := AddChild(Level_0);
Data := GetNodeData(Level_1);
Data.Text := TableStatistics[I].TableName;
Data.Value := '';
Data.NodeType := ptTabelName;
Data.ImageIndex := Pred(ImageList1.Count);
if TableStatistics[I].Backout > 0 then
begin
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := '';
Data.Value := FormatFloat('###,###,###,###,##0', TableStatistics[I].Backout);
Data.IntValue := TableStatistics[I].Backout;
if Data.IntValue > CurrentMaxValue then CurrentMaxValue := Data.IntValue;
Data.NodeType := ptOperation;
Data.StatisticKind := pkBackoutCount;
Data.ImageIndex := -1;
end;
if TableStatistics[I].Expunge > 0 then
begin
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := '';
Data.Value := FormatFloat('###,###,###,###,##0', TableStatistics[I].Expunge);
Data.IntValue := TableStatistics[I].Expunge;
if Data.IntValue > CurrentMaxValue then CurrentMaxValue := Data.IntValue;
Data.NodeType := ptOperation;
Data.StatisticKind := pkExpunge;
Data.ImageIndex := -1;
end;
if TableStatistics[I].Purge > 0 then
begin
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := '';
Data.Value := FormatFloat('###,###,###,###,##0', TableStatistics[I].Purge);
Data.IntValue := TableStatistics[I].Purge;
if Data.IntValue > CurrentMaxValue then CurrentMaxValue := Data.IntValue;
Data.NodeType := ptOperation;
Data.StatisticKind := pkPurge;
Data.ImageIndex := -1;
end;
Expanded[Level_1] := True;
end;
end;
end;
// (*
// if Assigned(vDatabaseStatistic) and Assigned(vDatabase) then
// with vDatabase, vDatabaseStatistic do
begin
{Memory}
//Level_1 := AddChild(Level_0);
Level_1 := AddChild(nil);
Data := GetNodeData(Level_1);
Data.Text := Format('Memory', []);
Data.Value := '';
//Data.NodeType := ptCommon;
Data.NodeType := ptRoot;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Currently in use', []);
Data.IntValue := CurrentMemory;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' bytes';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Maximum used since the first attachment', []);
Data.IntValue := MaxMemory;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' bytes';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Buffers currently allocated', []);
Data.IntValue := NumBuffers;
vTemp := Data.IntValue;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Buffers currently allocated', []);
Data.IntValue := vTemp * DatabasePageSize;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' bytes';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
{Operations}
//Level_1 := AddChild(Level_0);
Level_1 := AddChild(nil);
Data := GetNodeData(Level_1);
Data.Text := Format('Pages', []);
Data.Value := '';
//Data.NodeType := ptCommon;
Data.NodeType := ptRoot;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Fetches (Reads from memory buffer)', []);
Data.IntValue := Fetches;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Reads from memory buffer since the server started', []);
Data.IntValue := AllFetches;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Marks (Writes to memory buffer)', []);
Data.IntValue := Marks;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Writes to memory buffer since the server started', []);
Data.IntValue := AllMarks;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Reads from database', []);
Data.IntValue := Reads;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Reads from database since the server started', []);
Data.IntValue := AllReads;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Writes to database', []);
Data.IntValue := Writes;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
Level_2 := AddChild(Level_1);
Data := GetNodeData(Level_2);
Data.Text := Format('Writes to database since the server started', []);
Data.IntValue := AllWrites;
Data.Value := FormatFloat('###,###,###,###,##0', Data.IntValue) + ' pages';
Data.NodeType := ptCommon;
Data.ImageIndex := -1;
end;
// *)
end;
end;
FullExpand;
EndUpdate;
end;
end;
procedure TibBTStatisticsForm.vtStatisticHeaderClick(
Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Column = 0 then
with vtStatistic do
begin
BeginUpdate;
if Tag = 0 then
begin
FullExpand;
Tag := 1;
end
else
begin
FullCollapse;
Tag := 0;
end;
EndUpdate;
end;
end;
procedure TibBTStatisticsForm.vtStatisticFreeNode(
Sender: TBaseVirtualTree; Node: PVirtualNode);
var
Data: PStatisticRec;
begin
Data := Sender.GetNodeData(Node);
if Assigned(Data) then
Finalize(Data^);
end;
procedure TibBTStatisticsForm.vtStatisticGetImageIndex(
Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind;
Column: TColumnIndex; var Ghosted: Boolean; var ImageIndex: Integer);
var
Data: PStatisticRec;
begin
Data := Sender.GetNodeData(Node);
if Assigned(Data) then
// if (Kind = ikNormal) or (Kind = ikSelected) then
case Column of
0: ImageIndex := Data.ImageIndex;
1: ImageIndex := -1;
end;
end;
procedure TibBTStatisticsForm.vtStatisticGetNodeDataSize(
Sender: TBaseVirtualTree; var NodeDataSize: Integer);
begin
NodeDataSize := SizeOf(TStatisticRec);
end;
procedure TibBTStatisticsForm.vtStatisticDrawNode(
Sender: TBaseVirtualTree; const PaintInfo: TVTPaintInfo);
var
Data: PStatisticRec;
X: Integer;
XX: Double;
// TW: Integer;
// TH: Integer;
S: WideString;
R: TRect;
vLegend: string;
procedure NodeOutText(AText: string);
begin
S := AText;
with Sender as TVirtualDrawTree, PaintInfo do
if Length(S) > 0 then
begin
with R do
begin
if (NodeWidth - 2 * Margin) > (Right - Left) then
S := ShortenString(Canvas.Handle, S, Right - Left, False);
end;
DrawTextW(Canvas.Handle, PWideChar(S), Length(S), R, DT_TOP or DT_LEFT or DT_VCENTER or DT_SINGLELINE, False);
end;
end;
begin
with Sender as TVirtualDrawTree, PaintInfo do
begin
Data := Sender.GetNodeData(Node);
if ((Node = FocusedNode) and (Sender as TVirtualDrawTree).Focused) then
Canvas.Font.Color := clHighlightText
else
// if (Data.Attributes and SFGAO_COMPRESSED) <> 0 then
// Canvas.Font.Color := clBlue
// else
Canvas.Font.Color := clWindowText;
SetBKMode(Canvas.Handle, TRANSPARENT);
R := ContentRect;
R.Right := R.Right - 1;
// InflateRect(R, -TextMargin, 0);
// Dec(R.Right);
// Dec(R.Bottom);
S := '';
case Column of
1:
begin
Canvas.Brush.Color := clWindow;
if ((Node = FocusedNode) and (Sender as TVirtualDrawTree).Focused) then
Canvas.Font.Color := clHighlightText
else
Canvas.Font.Color := clWindowText;
SetBKMode(Canvas.Handle, TRANSPARENT);
vLegend := EmptyStr;
if Data.NodeType = ptOperation then
begin
case Data.StatisticKind of
pkIdxReads: vLegend := SIndexedReads;
pkSeqReads: vLegend := SNonIndexedReads;
pkUpdates: vLegend := SUpdates;
pkDeletes: vLegend := SDeletes;
pkInserts: vLegend := SInserts;
pkBackoutCount: vLegend := SBackouts;
pkExpunge: vLegend := SExpunges;
pkPurge: vLegend := SPurges;
end;
end;
NodeOutText(Data.Value + vLegend);
end;
0:
begin
case Data.NodeType of
ptRoot:
begin
// Canvas.Font.Style := Canvas.Font.Style + [fsBold];
Canvas.Brush.Color := clWindow;
NodeOutText(Data.Text);
// Canvas.Font.Style := Canvas.Font.Style - [fsBold];
end;
ptCommon:
begin
Canvas.Brush.Color := clWindow;
NodeOutText(Data.Text);
end;
ptTabelName:
begin
Canvas.Brush.Color := clWindow;
NodeOutText(Data.Text);
end;
ptOperation:
begin
Canvas.Brush.Style := bsSolid;
Canvas.Pen.Style := psSolid;
Canvas.Pen.Color := clBlack;
case Data.StatisticKind of
pkIdxReads: Canvas.Brush.Color := clBlue;
pkSeqReads: Canvas.Brush.Color := clRed;
pkInserts: Canvas.Brush.Color := clAqua;
pkUpdates: Canvas.Brush.Color := clYellow;
pkDeletes: Canvas.Brush.Color := clGray;
end;
R.Left := R.Left - 1;
R.Top := R.Top + 1;
R.Bottom := R.Bottom - 1;
X := R.Right - R.Left;
if CurrentMaxValue <> 0 then
begin
XX := Min(0.01 * CurrentMaxValue, 5);
XX := Max(XX, Data.IntValue)/CurrentMaxValue;
XX := X*XX;
X := X - Round(XX);
// X := X - Round(X * (Data.IntValue/CurrentMaxValue));
R.Right := R.Right - X;
if ((R.Right - R.Left) < 1) then
R.Right := R.Left + 1;
Canvas.FillRect(R);
Canvas.Rectangle(R);
end;
{
R := ContentRect;
TW := Canvas.TextWidth(Data.Value);
TH := Canvas.TextHeight(Data.Value);
R.Top :=
Canvas.TextOut();
}
end;
end;
end;
end;
end;
end;
procedure TibBTStatisticsForm.pmiHideMessageClick(Sender: TObject);
begin
HideMessages;
end;
end.
|
(*
Category: SWAG Title: SCREEN HANDLING ROUTINES
Original name: 0092.PAS
Description: Nice little Percentage Meter
Author: CJ CLIFFE
Date: 09-04-95 10:58
*)
{
I've seen a LOT of programs which Say they are doing something like
Reading/Writing to files, and you wonder if they have crashed or what,
I think it would be nice to have a nice Status Bar to show the progress
of what is going on! so here's my contribution to everyone:
Statbar: Highly Accurate Status Bar..
All Code except for HideCursor and ShowCursor is mine.
}
Uses crt;
(*
Procedure HideCursor; Assembler; Asm {I forget where I got}
MOV ax,$0100; MOV cx,$2607; INT $10 end; { these two }
Procedure ShowCursor; Assembler; Asm
MOV ax,$0100; MOV cx,$0506; INT $10 end;
*)
Procedure Dupeit(Str: String; Num: Integer); {Just a little Helper, dupes}
var
Cnt: integer; { lines }
begin
For Cnt := 1 to Num do begin
write(Str);
end;
end;
Procedure Statbar(cnum,enum,xspot,yspot,fullcolor,emptycolor: Integer);
var
percentage: Integer; {Uh-Oh, here comes the Mathematical}
begin { Crap!! }
{Hidecursor;} {Kill That Damned Cursor!}
percentage := round(cnum / enum * 100 / 2); {/2 can be changed for}
Gotoxy(xspot,yspot); { Shorter Stat Bars }
Textcolor(fullcolor);
dupeit('#',Percentage); {Can change the Char to whatever}
Textcolor(emptycolor);
dupeit('-',50 - Percentage); {same as above}
write(' ',percentage * 2,'%'); {this is not needed, just an extra}
{Showcursor;}
end;
Procedure WriteXy(x,y: Integer; dstr: String; tcolor: integer);
Begin
{Hidecursor;}
Gotoxy(x,y); { Yeah, I now it's Cheap and cheezy}
Textcolor(tcolor); { but it gets the job done well! }
write(dstr);
{Showcursor;}
end;
var
B1,B2,B3: integer;
Begin
B1 := 0;
B2 := 0;
B3 := 0;
Clrscr;
WriteXy(30,3,'Statbar By CJ Cliffe..',yellow);
Repeat
Inc(B1,4);
Inc(B2,1);
Inc(B3,1);
{ The Statbar procedure works like so:
Statbar(Current Number, Final Number, x location, y location,
Color of completed bars, color of empty bars);
Will process (as far as I know) Any pairs of numbers, as long as the Current
Number does not exceed the Final Number, everything should look fine.. }
Statbar(B1,800,15,5,Lightcyan,Cyan); {800 Just makes em go nice 'n}
Statbar(B2,400,15,7,LightRed,Red); {slow because they are FAST }
Statbar(B3,300,15,9,LightGreen,Green);
Until B1 = 800;
WriteXy(30,15,'Press any key to quit...',Lightblue);
Readkey;
end.
|
unit MainForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
MercuryShield_TLB, Transaction_TLB, MSEnum_TLB, System_Windows_Forms_TLB;
type
TForm1 = class(TForm)
btnProcess: TButton;
procedure btnProcessClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
// TranSentry variables
ms: IMercuryShieldUI;
request: IRequest;
dialogResult: Integer;
response: IResponse;
sb: TStringBuilder;
implementation
{$R *.dfm}
procedure TForm1.btnProcessClick(Sender: TObject);
begin
// Create request object
request := CoRequest.Create;
// Set transction type for Credit Sale
request.TenderType := TenderTypes_Credit;
request.TransactionType := TransactionTypes_Sale;
// Set TokenFrequency for Credit transactions
request.TokenFrequency := TokenFrequencies_OneTime;
// Required transaction information
request.CreditServers := 'x1.mercurydev.net;b2.mercurydev.net';
request.MerchantID := '395347306=TOKEN';
request.Memo := '[Product, Version]'; // Supply your POS product and version number
request.UserID := 'test'; // UserID PA-DSS requirement for logging (must be 'test' for test cards)
request.InvoiceNumber := '1';
request.ReferenceNumber := '1';
// Set the amount of the transaction
request.AmountData.PurchaseAmount := 1.25;
// Create the MercuryShieldUI object
ms := CoMercuryShieldUI.Create;
// Set the request property of the MercuryShieldUI object
ms.MercuryShieldRequest := request;
// Display the UI
dialogResult := ms.ShowDialog;
// Check if transaction was canceled by the user
if dialogResult = DialogResult_Cancel then
begin
Application.MessageBox('User canceled transaction.', 'Canceled', 0);
end
else
begin
response := ms.MercuryShieldResponse;
sb := TStringBuilder.Create;
sb.Append('Credit Sale Response');
sb.AppendLine();
sb.AppendLine('CmdStatus: ' + response.CmdStatus);
sb.AppendLine('TextResponse: ' + response.TextResponse);
sb.AppendLine('ProcessData: ' + response.ProcessData);
ShowMessage(sb.ToString());
end;
end;
end.
|
unit DSA.Tree.BSTMap;
{$mode objfpc}{$H+}
interface
uses
Classes,
SysUtils,
Rtti,
DSA.Interfaces.Comparer,
DSA.Interfaces.DataStructure,
DSA.Utils,
DSA.List_Stack_Queue.ArrayList;
type
{ TBSTMap }
generic TBSTMap<K, V, TKeyComparer> = class(TInterfacedObject,
specialize IMap<K, V>)
private
type
{ TNode }
TNode = class
public
key: K;
Value: V;
Left, Right: TNode;
constructor Create(newkey: K; newValue: V);
end;
TPtrV = specialize TPtr_V<V>;
TArrayList_K = specialize TArrayList<K>;
var
__root: TNode;
__size: integer;
__comparer: specialize IDSA_Comparer<K>;
function __add(node: TNode; key: K; Value: V): TNode;
function __getNode(node: TNode; key: K): TNode;
function __removeMin(node: TNode): TNode;
function __remove(node: TNode; key: K): TNode;
function __minimum(node: TNode): TNode;
procedure __inOrder(node: TNode; list: TArrayList_K);
public
constructor Create();
function Contains(key: K): boolean;
function Get(key: K): TPtrV;
function GetSize: integer;
function IsEmpty: boolean;
function Remove(key: K): TPtrV;
procedure Add(key: K; Value: V);
procedure Set_(key: K; newValue: V);
function KeySets: TArrayList_K;
end;
procedure Main;
implementation
type
TBSTMap_str_int = specialize TBSTMap<string, integer, TComparer_str>;
procedure Main();
var
words: TArrayList_str;
map: TBSTMap_str_int;
i: integer;
begin
words := TArrayList_str.Create();
if TDsaUtils.ReadFile(FILE_PATH + A_File_Name, words) then
begin
Writeln('Total words: ', words.GetSize);
end;
map := TBSTMap_str_int.Create;
for i := 0 to words.GetSize - 1 do
begin
if map.Contains(words[i]) then
map.Set_(words[i], map.Get(words[i]).PValue^ + 1)
else
map.Add(words[i], 1);
end;
Writeln('Total different words: ', map.GetSize);
TDsaUtils.DrawLine;
Writeln('Frequency of pride: ', map.Get('pride').PValue^);
Writeln('Frequency of prejudice: ', map.Get('prejudice').PValue^);
end;
{ TBSTMap }
procedure TBSTMap.Add(key: K; Value: V);
begin
__root := __add(__root, key, Value);
end;
function TBSTMap.Contains(key: K): boolean;
begin
Result := __getNode(__root, key) <> nil;
end;
constructor TBSTMap.Create();
begin
inherited;
__comparer := TKeyComparer.Default;
end;
function TBSTMap.Get(key: K): TPtrV;
var
node: TNode;
begin
node := __getNode(__root, key);
if node = nil then
Result.PValue := nil
else
Result.PValue := @node.Value;
end;
function TBSTMap.GetSize: integer;
begin
Result := __size;
end;
function TBSTMap.IsEmpty: boolean;
begin
Result := __size = 0;
end;
function TBSTMap.Remove(key: K): TPtrV;
var
node: TNode;
begin
node := __getNode(__root, key);
if node = nil then
begin
Result.PValue := nil;
end
else
begin
__root := __remove(__root, key);
Result.PValue := @node.Value;
end;
end;
procedure TBSTMap.Set_(key: K; newValue: V);
var
node: TNode;
Value: TValue;
s: string;
begin
node := __getNode(__root, key);
if node = nil then
begin
TValue.Make(@key, TypeInfo(K), Value);
s := Value.ToString;
raise Exception.Create(s + ' doesn''t exist!');
end
else
node.Value := newValue;
end;
function TBSTMap.KeySets: TArrayList_K;
var
list: TArrayList_K;
begin
list := TArrayList_K.Create;
__inOrder(__root, list);
Result := list;
end;
function TBSTMap.__add(node: TNode; key: K; Value: V): TNode;
var
bool: integer;
begin
if node = nil then
begin
Inc(__size);
Result := TNode.Create(key, Value);
Exit;
end;
bool := __comparer.Compare(Key, node.Key);
if bool < 0 then
node.Left := __add(node.Left, key, Value)
else if bool > 0 then
node.Right := __add(node.Right, key, Value)
else
node.Value := Value;
Result := node;
end;
function TBSTMap.__getNode(node: TNode; key: K): TNode;
var
bool: integer;
begin
if node = nil then
Exit(nil);
bool := __comparer.Compare(Key, node.Key);
if bool < 0 then
Result := __getNode(node.Left, key)
else if bool > 0 then
Result := __getNode(node.Right, key)
else
Result := node;
end;
function TBSTMap.__minimum(node: TNode): TNode;
begin
if node.Left = nil then
begin
Result := node;
end
else
begin
Result := __minimum(node.Left);
end;
end;
procedure TBSTMap.__inOrder(node: TNode; list: TArrayList_K);
begin
if node = nil then
Exit;
__inOrder(node.Left, list);
list.AddLast(node.key);
__inOrder(node.Right, list);
end;
function TBSTMap.__remove(node: TNode; key: K): TNode;
var
leftNode, rightNode, succesorNode, minNode: TNode;
bool: integer;
begin
leftNode := nil;
rightNode := nil;
succesorNode := nil;
if node = nil then
Exit(nil);
bool := __comparer.Compare(Key, node.Key);
if bool < 0 then
begin
node.Left := __remove(node.Left, key);
Result := node;
end
else if bool > 0 then
begin
node.Right := __remove(node.Right, key);
Result := node;
end
else // e = node.e
begin
if node.Left = nil then
begin
rightNode := node.Right;
FreeAndNil(node);
Dec(__size);
Result := rightNode;
end
else if node.Right = nil then
begin
leftNode := node.Left;
FreeAndNil(node);
Dec(__size);
Result := leftNode;
end
else
begin
// 待删除节点左右子树均不空的情况
// 找到比待删除节点大的最小节点,即待删除节点右子树的最小节点
// 用这个节点顶替待删除节点的位置
minNode := __minimum(node.Right);
succesorNode := TNode.Create(minNode.key, minNode.Value);
succesorNode.Right := __removeMin(node.Right);
succesorNode.Left := node.Left;
FreeAndNil(node);
Result := succesorNode;
end;
end;
end;
function TBSTMap.__removeMin(node: TNode): TNode;
var
rightNode: TNode;
begin
if node.Left = nil then
begin
rightNode := node.Right;
FreeAndNil(node);
Dec(__size);
Result := rightNode;
end
else
begin
node.Left := __removeMin(node.Left);
Result := node;
end;
end;
{ TBSTMap.TNode }
constructor TBSTMap.TNode.Create(newkey: K; newValue: V);
begin
Self.key := newkey;
Self.Value := newValue;
Left := nil;
Right := nil;
end;
end.
|
// RemObjects CS to Pascal 0.1
namespace UT3Bots.UTItems;
interface
uses
System,
System.Collections.Generic,
System.Linq,
System.Text,
UT3Bots.Communications;
type
UTBotSelfState = public class(UTBotState)
private
//Self state variables
var _currentAmmo: Integer;
var _inventory: Dictionary<WeaponType, UTIdentifier>;
assembly or protected
method UpdateState(selfMessage: Message);override;
method AddInventoryItem(msg: Message): UTItem;
method GetInvetoryItemID(&type: WeaponType): UTIdentifier;
public
/// <summary>
/// Checks to see if your bot has a weapon in it's inventory
/// </summary>
/// <param name="type">The weaponType to check for</param>
/// <returns>True if your bot has this weapon</returns>
method HasWeapon(&type: WeaponType): Boolean;
/// <summary>
/// Checks to see if your bot is stood close to the specified location.
/// Useful to see if your bot has reached a Location it was running to.
/// </summary>
/// <param name="location">The location to check</param>
/// <returns>True if your bot is currently stood at this location</returns>
method IsCloseTo(location: UTVector): Boolean;
/// <summary>
/// Checks to see if your bot is stood close to the specified object.
/// Useful to see if your bot has reached a location it was running to.
/// </summary>
/// <param name="toObject">The object to check</param>
/// <returns>True if your bot is currently stood at this location</returns>
method IsCloseTo(toObject: UTObject): Boolean;
constructor(Msg: Message);
/// <summary>
/// Ammo count for your currently selected weapon
/// </summary>
property CurrentAmmo: Integer read get_CurrentAmmo;
method get_CurrentAmmo: Integer;
end;
implementation
method UTBotSelfState.UpdateState(selfMessage: Message);
begin
if ((selfMessage <> nil) and (selfMessage.Info = InfoMessage.SELF_INFO) and (selfMessage.Arguments.Length = 12)) then
begin
self._currentAmmo := Integer.Parse(selfMessage.Arguments[11])
end;
inherited UpdateState(selfMessage)
end;
method UTBotSelfState.AddInventoryItem(msg: Message): UTItem;
begin
var newItem: UTItem := new UTItem(msg);
if newItem.IsItem(ItemType.Weapon) then
begin
if Self._inventory.ContainsKey(WeaponType(newItem.ActualClass)) then
begin
Self._inventory[WeaponType(newItem.ActualClass)] := _id;
end
else
begin
Self._inventory.&Add(WeaponType(newItem.ActualClass), _id);
end;
end;
exit newItem;
end;
method UTBotSelfState.GetInvetoryItemID(&type: WeaponType): UTIdentifier;
begin
Result := Self._inventory[&type]
end;
method UTBotSelfState.HasWeapon(&type: WeaponType): Boolean;
begin
Result := Self._inventory.ContainsKey(&type)
end;
method UTBotSelfState.IsCloseTo(location: UTVector): Boolean;
begin
var dist: Single := Self._location.DistanceFrom(location);
if dist <= 200 then
begin
exit true;
end;
exit false;
end;
method UTBotSelfState.IsCloseTo(toObject: UTObject): Boolean;
begin
var dist: Single := Self._location.DistanceFrom(toObject.Location);
if dist <= 200 then
begin
exit true;
end;
exit false;
end;
constructor UTBotSelfState(Msg: Message);
begin
if ((Msg.Info = InfoMessage.PLAYER_INFO) and (Msg.Arguments.Length = 12)) then
begin
Self._id := new UTIdentifier(Msg.Arguments[0]);
Self._location := UTVector.Parse(Msg.Arguments[1]);
Self._rotation := UTVector.Parse(Msg.Arguments[2]);
Self._velocity := UTVector.Parse(Msg.Arguments[3]);
Self._name := Msg.Arguments[4];
Self._health := Integer.Parse(Msg.Arguments[5]);
Self._armor := Integer.Parse(Msg.Arguments[6]);
Self._weapon := Msg.Arguments[7].GetAsWeaponType();
Self._firingType := FireType((Integer.Parse(Msg.Arguments[8])));
Self._mesh := BotMesh((Integer.Parse(Msg.Arguments[9])));
Self._colour := BotColor((Integer.Parse(Msg.Arguments[10])));
Self._currentAmmo := Integer.Parse(Msg.Arguments[11])
end;
Self._inventory := new Dictionary<WeaponType, UTIdentifier>()
end;
method UTBotSelfState.get_CurrentAmmo: Integer;
begin
Result := Self._currentAmmo;
end;
end.
|
unit uDMPDV;
interface
uses
SysUtils, Classes, DB, ADODB,ComCtrls, ExtCtrls, uFormasPagamento,
DBClient, Provider, Variants, uPreSale, siComp, siLangRT, IniFiles,
Forms, uFilePersistence, uTransferFile, uMsgBox;
const
ATiposPagto: array[1..9] of String = ('Dinheiro', 'Cartão Crédito', 'Outros', 'Cheque', 'Crédito', 'Vale Presente', 'Cartão Débito', 'Cupom', 'Conta Loja');
ITEM_MODE_QTY_BARCODE = 1;
ITEM_MODE_QTY_MODEL = 2;
type
TECFIDtoIndex = class
ID: Integer;
ECFIndex: String;
ECFTotalizador: String;
end;
TECFTax = TECFIDtoIndex;
TECFPag = class(TECFIDtoIndex)
Bandeira : Integer;
TipoTEF: Integer;
end;
TECFVin = TECFIDtoIndex;
TDMPDV = class(TDataModule)
quPreSaleInfo: TADOQuery;
quPreSaleInfoIDPreSale: TIntegerField;
quPreSaleInfoIDMeioPag: TIntegerField;
quPreSaleInfoIDTouristGroup: TIntegerField;
quPreSaleInfoPreSaleDate: TDateTimeField;
quPreSaleInfoOtherComissionID: TIntegerField;
quPreSaleInfoIDCustomer: TIntegerField;
quPreSaleInfoDeliverTypeID: TIntegerField;
quPreSaleInfoDeliverDate: TDateTimeField;
quPreSaleInfoDeliverAddress: TStringField;
quPreSaleInfoPassportDate: TDateTimeField;
quPreSaleInfoAirLine: TStringField;
quPreSaleInfoCompanyName: TStringField;
quPreSaleInfoCompanyCGC: TStringField;
quPreSaleInfoDepositDate: TDateTimeField;
quPreSaleInfoNote: TStringField;
quPreSaleInfoInvoiceDate: TDateTimeField;
quPreSaleInfoIDInvoice: TIntegerField;
quPreSaleInfoPassport: TStringField;
quPreSaleInfoTicket: TStringField;
quPreSaleInfoMediaID: TIntegerField;
quPreSaleInfoCardNumber: TStringField;
quPreSaleInfoIDStore: TIntegerField;
quPreSaleInfoAddress: TStringField;
quPreSaleInfoLayaway: TBooleanField;
quPreSaleInfoFirstName: TStringField;
quPreSaleInfoLastName: TStringField;
quPreSaleInfoZip: TStringField;
quPreSaleInfoSaleCode: TStringField;
spquPreSaleItem: TADOStoredProc;
spquPreSaleItemModelID: TIntegerField;
spquPreSaleItemModel: TStringField;
spquPreSaleItemDescription: TStringField;
spquPreSaleItemSalePrice: TFloatField;
spquPreSaleItemDiscActual: TFloatField;
spquPreSaleItemDiscount: TFloatField;
spquPreSaleItemIDInventoryMov: TIntegerField;
spquPreSaleItemTotalItem: TFloatField;
spquPreSaleItemSalesPerson: TStringField;
spquPreSaleItemIDComission: TIntegerField;
spquPreSaleItemCostPrice: TFloatField;
spquPreSaleItemExchangeInvoice: TIntegerField;
spquPreSaleItemSuggRetail: TFloatField;
spquPreSaleItemSerialNumber: TBooleanField;
spquPreSaleItemIDUser: TIntegerField;
spquPreSaleItemTax: TFloatField;
spquPreSaleItemSubTotalItem: TFloatField;
spquPreSaleValue: TADOStoredProc;
spquPreSaleValueTaxIsent: TBooleanField;
spquPreSaleValueSubTotal: TFloatField;
spquPreSaleValueItemDiscount: TFloatField;
spquPreSaleValueTax: TFloatField;
spquPreSaleValueTaxPrc: TFloatField;
spquPreSaleValueDiscountPrc: TFloatField;
spquPreSaleValueTotalInvoice: TFloatField;
spquPreSaleValueSpecialPriceID: TIntegerField;
spquPreSaleValueSpecialPrice: TStringField;
spquPreSaleValuenOpenUser: TIntegerField;
spquPreSaleValueShowOpenUser: TIntegerField;
spquPreSaleValueNewSubTotal: TFloatField;
spquPreSaleValueTaxIsemptValue: TFloatField;
spquPreSaleValueSubTotalTaxable: TCurrencyField;
spquPreSaleValueTaxIsemptItemDiscount: TFloatField;
quBarcode: TADOQuery;
dsPreSaleValue: TDataSource;
dsPreSaleItem: TDataSource;
dsPreSaleInfo: TDataSource;
quMeioPag: TADOQuery;
FormasPagamento: TFormasPagamento;
quCustomer: TADODataSet;
dspCustomer: TDataSetProvider;
cdsCustomer: TClientDataSet;
quOtherCommission: TADODataSet;
dspOtherCommission: TDataSetProvider;
cdsOtherCommission: TClientDataSet;
cdsCustomerIDPessoa: TIntegerField;
cdsCustomerPessoa: TStringField;
cdsCustomerPessoaFirstName: TStringField;
cdsCustomerPessoaLastName: TStringField;
cdsCustomerEndereco: TStringField;
cdsCustomerCidade: TStringField;
cdsCustomerCEP: TStringField;
cdsCustomerTelefone: TStringField;
cdsCustomerCPF: TStringField;
cdsOtherCommissionIDPessoa: TIntegerField;
cdsOtherCommissionIDComissionado: TIntegerField;
cdsOtherCommissionPessoa: TStringField;
quSystemUser: TADODataSet;
dspSystemUser: TDataSetProvider;
cdsSystemUser: TClientDataSet;
quModel: TADODataSet;
dspModel: TDataSetProvider;
cdsModel: TClientDataSet;
ADODataSet1: TADODataSet;
DataSetProvider1: TDataSetProvider;
ClientDataSet1: TClientDataSet;
cdsSystemUserIDUser: TIntegerField;
cdsSystemUserSystemUser: TStringField;
cdsSystemUserComissionID: TIntegerField;
quBarcodeSearch: TADODataSet;
dspBarcodeSearch: TDataSetProvider;
cdsBarcodeSearch: TClientDataSet;
quMDescription: TADODataSet;
dspMDescription: TDataSetProvider;
cdsMDescription: TClientDataSet;
quNewCustomer: TADOQuery;
cmdPessoa: TADOCommand;
siLang: TsiLangRT;
quModelAccessory: TADODataSet;
cdsCustomerInscEstadual: TStringField;
cdsCustomerBairro: TStringField;
dspModelAccessory: TDataSetProvider;
cdsModelAccessory: TClientDataSet;
cdsModelAccessoryIDInvAccessory: TIntegerField;
cdsModelAccessoryIDModel: TIntegerField;
cdsModelAccessoryModel: TStringField;
cdsModelAccessoryDescription: TStringField;
cdsModelAccessoryHint: TStringField;
cdsModelAccessoryLargeImage: TStringField;
cdsModelAccessoryPromotionPrice: TBCDField;
cdsModelAccessoryDiscountPerc: TFloatField;
cdsModelAccessorySellingPrice: TBCDField;
dspMeioPag: TDataSetProvider;
cdsMeioPag: TClientDataSet;
cdsMeioPagIDMeioPag: TIntegerField;
cdsMeioPagMeioPag: TStringField;
cdsMeioPagImageIndex: TIntegerField;
cdsMeioPagTipo: TIntegerField;
dspBarcode: TDataSetProvider;
cdsBarcode: TClientDataSet;
quBarcodeIDModel: TIntegerField;
quBarcodeModel: TStringField;
quBarcodeIDBarcode: TStringField;
dspQty: TDataSetProvider;
cdsBarcodeIDModel: TIntegerField;
cdsBarcodeModel: TStringField;
cdsBarcodeIDBarcode: TStringField;
cdsBarcodeSearchIDBarcode: TStringField;
cdsBarcodeSearchIDModel: TIntegerField;
cdsBarcodeSearchModel: TStringField;
tmLoadGlobal: TTimer;
quDiscRange: TADODataSet;
dspDiscRange: TDataSetProvider;
cdsDiscRange: TClientDataSet;
cdsDiscRangeIDTipoComissionado: TIntegerField;
cdsDiscRangeTotVendaMin: TBCDField;
cdsDiscRangePercDiscMax: TBCDField;
cdsSystemUserIDTipoPessoa: TIntegerField;
quInvFeatures: TADODataSet;
dspInvFeatures: TDataSetProvider;
cdsInvFeatures: TClientDataSet;
cdsInvFeaturesIDInvFeatures: TIntegerField;
cdsInvFeaturesIDModel: TIntegerField;
cdsInvFeaturesFeature: TStringField;
quInvTechFeat: TADODataSet;
dspInvTechFeat: TDataSetProvider;
cdsInvTechFeat: TClientDataSet;
cdsInvTechFeatIDInvTechFeatures: TIntegerField;
cdsInvTechFeatIDModel: TIntegerField;
cdsInvTechFeatTechFeature: TStringField;
spquPreSaleItemQty: TFloatField;
quQty: TADODataSet;
cdsQty: TClientDataSet;
quInvDepartment: TADODataSet;
quInvModelDepartment: TADODataSet;
quInvModelDepartmentModelID: TIntegerField;
quInvModelDepartmentIDDepartment: TIntegerField;
quInvModelDepartmentDepartment: TStringField;
dspInvDepartment: TDataSetProvider;
dspInvModelDepartment: TDataSetProvider;
cdsInvDepartment: TClientDataSet;
cdsInvModelDepartment: TClientDataSet;
cdsInvDepartmentIDDepartment: TIntegerField;
cdsInvDepartmentDepartment: TStringField;
cdsInvModelDepartmentModelID: TIntegerField;
cdsInvModelDepartmentIDDepartment: TIntegerField;
cdsInvModelDepartmentDepartment: TStringField;
quTotalMeioPag: TADOQuery;
quTotalDeposited: TADODataSet;
tmrSaveFilesToServer: TTimer;
spquPreSaleValueInvoiceDiscount: TCurrencyField;
quQtyName: TStringField;
quQtyQtyOnPreSale: TBCDField;
quQtyQtyOnHand: TBCDField;
quQtyQtyOnOrder: TBCDField;
quQtyQtyOnRepair: TBCDField;
quQtyStoreID: TIntegerField;
quQtyQtyOnPrePurchase: TBCDField;
quQtyCurrentCost: TBCDField;
quQtyFloatPercent: TIntegerField;
quQtyIDModel: TIntegerField;
cdsQtyName: TStringField;
cdsQtyQtyOnPreSale: TBCDField;
cdsQtyQtyOnHand: TBCDField;
cdsQtyQtyOnOrder: TBCDField;
cdsQtyQtyOnRepair: TBCDField;
cdsQtyStoreID: TIntegerField;
cdsQtyQtyOnPrePurchase: TBCDField;
cdsQtyCurrentCost: TBCDField;
cdsQtyFloatPercent: TIntegerField;
cdsQtyIDModel: TIntegerField;
dspInvSerial: TDataSetProvider;
quInvSerial: TADODataSet;
cdsInvSerial: TClientDataSet;
quInvSerialStoreID: TIntegerField;
quInvSerialModelID: TIntegerField;
quInvSerialSerial: TStringField;
cdsInvSerialStoreID: TIntegerField;
cdsInvSerialModelID: TIntegerField;
cdsInvSerialSerial: TStringField;
dspStoreTablePrice: TDataSetProvider;
quStoreTablePrice: TADODataSet;
cdsStoreTablePrice: TClientDataSet;
dspModelTablePrice: TDataSetProvider;
quModelTablePrice: TADODataSet;
cdsModelTablePrice: TClientDataSet;
quStoreTablePriceIDStore: TIntegerField;
quStoreTablePriceIDModel: TIntegerField;
quStoreTablePriceIDDescriptionPrice: TIntegerField;
quStoreTablePriceIDVendor: TIntegerField;
quStoreTablePriceSuggPrice: TBCDField;
quStoreTablePriceSalePrice: TBCDField;
cdsStoreTablePriceIDStore: TIntegerField;
cdsStoreTablePriceIDModel: TIntegerField;
cdsStoreTablePriceIDDescriptionPrice: TIntegerField;
cdsStoreTablePriceIDVendor: TIntegerField;
cdsStoreTablePriceSuggPrice: TBCDField;
cdsStoreTablePriceSalePrice: TBCDField;
quModelTablePriceIDModel: TIntegerField;
quModelTablePriceIDDescriptionPrice: TIntegerField;
quModelTablePriceIDVendor: TIntegerField;
quModelTablePriceSuggPrice: TBCDField;
quModelTablePriceSalePrice: TBCDField;
cdsModelTablePriceIDModel: TIntegerField;
cdsModelTablePriceIDDescriptionPrice: TIntegerField;
cdsModelTablePriceIDVendor: TIntegerField;
cdsModelTablePriceSuggPrice: TBCDField;
cdsModelTablePriceSalePrice: TBCDField;
quModelTablePriceDescriptionPrice: TStringField;
quModelTablePriceVendor: TStringField;
cdsModelTablePriceDescriptionPrice: TStringField;
cdsModelTablePriceVendor: TStringField;
quStoreTablePriceDescriptionPrice: TStringField;
quStoreTablePriceVendor: TStringField;
cdsStoreTablePriceDescriptionPrice: TStringField;
cdsStoreTablePriceVendor: TStringField;
dspDocumentType: TDataSetProvider;
quDocumentType: TADODataSet;
cdsDocumentType: TClientDataSet;
quDocumentTypeIDDocumentType: TIntegerField;
quDocumentTypeDocumentType: TStringField;
quDocumentTypeDefaultType: TBooleanField;
cdsDocumentTypeIDDocumentType: TIntegerField;
cdsDocumentTypeDocumentType: TStringField;
cdsDocumentTypeDefaultType: TBooleanField;
cdsModelIDModel: TIntegerField;
cdsModelModel: TStringField;
cdsModelDescription: TStringField;
cdsModelReplacementCost: TBCDField;
cdsModelPeso: TBCDField;
cdsModelSuggRetail: TBCDField;
cdsModelAvgCost: TBCDField;
cdsModelLargeImage: TStringField;
cdsModelLargeImage2: TStringField;
cdsModelPromotionPrice: TBCDField;
cdsModelAskUserOnSale: TBooleanField;
cdsModelDiscountPerc: TFloatField;
cdsModelCustomSalePrice: TBooleanField;
cdsModelStoreSellingPrice: TBCDField;
cdsModelTabGroup: TStringField;
cdsModelUnidade: TStringField;
cdsModelSigla: TStringField;
cdsModelFabricante: TStringField;
cdsModelSizeName: TStringField;
cdsModelCodSize: TStringField;
cdsModelColor: TStringField;
cdsModelCodColor: TStringField;
cdsModelRequestCustomer: TBooleanField;
cdsModelPuppyTracker: TBooleanField;
cdsModelVendorCostM: TBCDField;
cdsModelVendorCostI: TBCDField;
cdsModelInvSellingPriceM: TBCDField;
cdsModelInvSellingPriceI: TBCDField;
cdsModelIDTaxCategory: TIntegerField;
cdsModelIDDepartment: TIntegerField;
cdsModelFornecedor: TStringField;
cdsModelCaseQty: TBCDField;
cdsModelSerialNumber: TBooleanField;
cdsModelUseDocumentOnSale: TBooleanField;
cdsModelUseScale: TBooleanField;
cdsModelSellingPrice: TCurrencyField;
cdsModelInvSellingPrice: TCurrencyField;
cdsModelVendorCost: TCurrencyField;
cdsMDescriptionIDModel: TIntegerField;
cdsMDescriptionModel: TStringField;
cdsMDescriptionDescription: TStringField;
cdsMDescriptionReplacementCost: TBCDField;
cdsMDescriptionPeso: TBCDField;
cdsMDescriptionSuggRetail: TBCDField;
cdsMDescriptionAvgCost: TBCDField;
cdsMDescriptionLargeImage: TStringField;
cdsMDescriptionLargeImage2: TStringField;
cdsMDescriptionPromotionPrice: TBCDField;
cdsMDescriptionAskUserOnSale: TBooleanField;
cdsMDescriptionDiscountPerc: TFloatField;
cdsMDescriptionCustomSalePrice: TBooleanField;
cdsMDescriptionStoreSellingPrice: TBCDField;
cdsMDescriptionTabGroup: TStringField;
cdsMDescriptionUnidade: TStringField;
cdsMDescriptionSigla: TStringField;
cdsMDescriptionFabricante: TStringField;
cdsMDescriptionSizeName: TStringField;
cdsMDescriptionCodSize: TStringField;
cdsMDescriptionColor: TStringField;
cdsMDescriptionCodColor: TStringField;
cdsMDescriptionRequestCustomer: TBooleanField;
cdsMDescriptionPuppyTracker: TBooleanField;
cdsMDescriptionVendorCostM: TBCDField;
cdsMDescriptionVendorCostI: TBCDField;
cdsMDescriptionInvSellingPriceM: TBCDField;
cdsMDescriptionInvSellingPriceI: TBCDField;
cdsMDescriptionIDTaxCategory: TIntegerField;
cdsMDescriptionIDDepartment: TIntegerField;
cdsMDescriptionFornecedor: TStringField;
cdsMDescriptionCaseQty: TBCDField;
cdsMDescriptionSerialNumber: TBooleanField;
cdsMDescriptionUseDocumentOnSale: TBooleanField;
cdsMDescriptionUseScale: TBooleanField;
cdsMDescriptionSellingPrice: TCurrencyField;
cdsMDescriptionInvSellingPrice: TCurrencyField;
cdsMDescriptionVendorCost: TCurrencyField;
quMeioPagMinSale: TADOQuery;
dspMeioPagMinSale: TDataSetProvider;
cdsMeioPagMinSale: TClientDataSet;
cdsMeioPagMinSaleIDMeioPag: TIntegerField;
cdsMeioPagMinSaleDifDay: TIntegerField;
cdsMeioPagMinSaleTotalSale: TBCDField;
cdsMeioPagRequireCustomer: TBooleanField;
cdsModelIndicadorProducao: TStringField;
cdsModelIndicadorAT: TStringField;
cdsModelSituacaoTributaria: TIntegerField;
cdsModelDescSituTribut: TStringField;
cdsMDescriptionIndicadorProducao: TStringField;
cdsMDescriptionIndicadorAT: TStringField;
cdsMDescriptionSituacaoTributaria: TIntegerField;
cdsMDescriptionDescSituTribut: TStringField;
cdsQtySold: TClientDataSet;
cdsQtySoldIDModel: TIntegerField;
cdsQtySoldQty: TBCDField;
cdsQtySoldSaleDate: TDateTimeField;
quBarcodeCaseQty: TFloatField;
cdsBarcodeCaseQty: TFloatField;
cdsBarcodeSearchCaseQty: TFloatField;
cdsCustomerStoreAccountLimit: TBCDField;
cdsCustomerNonpayer: TBooleanField;
cdsMeioPagValidateNonpayer: TBooleanField;
procedure DataModuleCreate(Sender: TObject);
procedure DataModuleDestroy(Sender: TObject);
procedure cdsModelCalcFields(DataSet: TDataSet);
procedure cdsMDescriptionCalcFields(DataSet: TDataSet);
procedure cdsMDescriptionBeforeOpen(DataSet: TDataSet);
procedure cdsModelAccessoryBeforeOpen(DataSet: TDataSet);
procedure tmLoadGlobalTimer(Sender: TObject);
procedure tmrSaveFilesToServerTimer(Sender: TObject);
procedure cdsInvSerialBeforeOpen(DataSet: TDataSet);
private
ECFTaxList,
ECFPagList,
ECFVinList: TStringList;
FTransferFile: TTransferFile;
FServerActive: Boolean;
FCanTransferFile: Boolean;
FSellNegative: Boolean;
procedure PreencheFormaPagamento;
procedure UnLoadECFTaxList;
procedure UnLoadECFPagList;
procedure UnLoadECFVinList;
procedure InitGlobalTXT;
procedure ServerStatus(Online: Boolean);
public
DefaultMeioPag : TMeioPagamento;
FLastQtyUpdate : TDateTime;
property ServerActive: Boolean read FServerActive write FServerActive;
property CanTransferFile: Boolean read FCanTransferFile write FCanTransferFile;
property TransferFile: TTransferFile read FTransferFile;
property SellNegative: Boolean read FSellNegative write FSellNegative;
function ValidadeBarcode(iSearchItemMode : Integer; Barcode: String; var Cost,
Selling, StorePrice: Currency; var IDModel : Integer;
var Desc, Model, Tax, ImagePath : String;
var AskPrice : Boolean; var PuppyTracker: Boolean;
var RequestCustomer: Boolean; var CaseQty: Double;
var PrcPartDiscount: Currency;
var IDDepartment: Integer;
var AskSalesPerson : Boolean;
var HasSerialNumber : Boolean;
var AskDocument : Boolean;
var UseScale : Boolean;
var TotParcial : String;
var Unidade : String): Boolean;
function TestInvoiceDiscRange(AIDCommissionType: Integer;
AInvoiceValue, ADiscount: Currency): Boolean;
procedure AbreTabelas;
function GetECFTaxIndex(IDTaxCategory: Integer): String;
procedure SetECFTaxIndex(IDTaxCategory: Integer; Value: String);
function GetCodFiscal(IDMeioPag: Integer): String;
procedure SetECFCodFiscal(IDMeioPag: Integer; Value: String);
function GetECFVinIndex(IDMeioPag: Integer): String;
procedure SetECFVinIndex(IDMeioPag: Integer; Value: String);
function GetBandeira(IDMeioPag: Integer): Integer;
procedure SetECFBandeira(IDMeioPag: Integer; Value: Integer);
function GetTipoTEF(IDMeioPag: Integer): Integer;
procedure SetECFTipoTEF(IDMeioPag: Integer; Value: Integer);
procedure LoadECFPagList;
procedure LoadECFTaxList;
procedure LoadECFVinList;
procedure LoadECFTEFList(ECFIni: TIniFile);
procedure OpenSuggestions(IDModel:Integer);
procedure CloseSuggestions;
procedure OpenQuantity(IDModel:Integer; AFilter : String);
procedure CloseQuantity;
procedure OpenInvSerial(IDModel:Integer);
procedure CloseInvSerial;
procedure OpenTablePrice(IDStore, IDModel: Integer);
procedure CloseTablePrice;
function AddCustomer(Customer:TCustomerInfo):Integer;
function SelectModelDepartment(const AIDModel: Integer;
var AIDDepartment: Integer): Boolean;
procedure SaveFilesToServer(AllLastFiles: Boolean = False);
function GetTotalCashSale(IDCashRegMov : Integer) : Currency;
function GetTotalCashInRegister : Currency;
function IsMinPayValue(AIDPaymentType: Integer; AValue: Real): boolean;
function AjustaPreco(Qtde, PrecoBalanca, PrecoUnit: real): Real;
function TruncarDecimal(Valor: Real; Decimal: integer): Double;
procedure AddQtySold(AIDModel : Integer; AQty: Double);
procedure SaveQtySold;
function GetQtySold(AIDModel : Integer) : Double;
//PAF
function GetTotalizadorParcial(IDTaxCategory : Integer):String;
function GetECFTotParcial(Aliquota: String): String;
end;
var
DMPDV: TDMPDV;
implementation
uses uDM, uSystemConst, uSQLFunctions, uDMGlobal, uFrmImport, uDateTimeFunctions,
uFrmAskDepartment, uFileFunctions;
{$R *.dfm}
function TDMPDV.ValidadeBarcode(iSearchItemMode : Integer;
Barcode: String; var Cost, Selling, StorePrice: Currency;
var IDModel : Integer;
var Desc, Model, Tax, ImagePath : String;
var AskPrice : Boolean; var PuppyTracker: Boolean;
var RequestCustomer: Boolean; var CaseQty: Double;
var PrcPartDiscount: Currency;
var IDDepartment: Integer;
var AskSalesPerson : Boolean;
var HasSerialNumber : Boolean;
var AskDocument : Boolean;
var UseScale : Boolean;
var TotParcial : String;
var Unidade : String): Boolean;
var
sWhere, sOriginalWhere : String;
sModel: String;
begin
Result := False;
if Trim(Barcode) = '' then
Exit;
try
sModel := UpperCase(Trim(Barcode));
if iSearchItemMode = ITEM_MODE_QTY_BARCODE then
begin
if DM.PersistenceType = ptDB then
cdsBarcode.Close;
cdsBarcode.Filtered := False;
sWhere := 'IDBarcode = ' + QuotedStr(sModel);
case DM.PersistenceType of
ptDB:
begin
quBarcode.SQL.Text := ChangeWhereClause(quBarcode.SQL.Text, sWhere, True);
cdsBarcode.Open;
end;
ptTXT:
begin
cdsBarcode.Filter := sWhere;
cdsBarcode.Filtered := True;
end;
end;
if not cdsBarcode.IsEmpty then
sModel := cdsBarcodeIDModel.AsString
else
Exit;
sWhere := 'IDModel = ' + QuotedStr(sModel);
end //End Search Barcode
else
sWhere := 'Model = ' + QuotedStr(sModel);
cdsModel.Filtered := False;
if (DM.PersistenceType = ptDB) then
sWhere := sWhere + ' AND TC.OperationType = 1 ' +
' AND TC.SaleTaxType = 2 ';
case DM.PersistenceType of
ptDB:
begin
//Voltar com o Where Original no final da consulta
sWhere := sWhere + Format(' AND S.IDStore = %D ', [DM.fStore.ID]);
sOriginalWhere := ' M.Desativado = 0 AND M.Hidden = 0 AND ' +
'M.ModelType IN ('+QuotedStr('S')+', '+QuotedStr('R')+', '+QuotedStr('V')+', '+QuotedStr('C')+','+QuotedStr('K')+' ) ' +
Format('AND S.IDStore = %D ', [DM.fStore.ID]);
cdsModel.Close;
quModel.CommandText := ChangeWhereClause(quModel.CommandText, sWhere, True);
cdsModel.Open;
end;
ptTXT:
begin
cdsModel.Filter := sWhere;
cdsModel.Filtered := True;
end;
end;
if cdsModel.IsEmpty then
Exit;
IDModel := cdsModel.FieldByName('IDModel').AsInteger;
Cost := cdsModel.FieldByName('VendorCost').AsCurrency;
Desc := cdsModel.FieldByName('Description').AsString;
Model := cdsModel.FieldByName('Model').AsString;
Tax := GetECFTaxIndex(cdsModel.FieldByName('IDTaxCategory').AsInteger);
AskPrice := cdsModel.FieldByName('CustomSalePrice').AsBoolean;
ImagePath := cdsModel.FieldByName('LargeImage').AsString;
RequestCustomer := cdsModel.FieldByName('RequestCustomer').AsBoolean;
PuppyTracker := cdsModel.FieldByName('PuppyTracker').AsBoolean;
CaseQty := cdsModel.FieldByName('CaseQty').AsFloat;
PrcPartDiscount := cdsModel.FieldByName('DiscountPerc').AsCurrency;
IDDepartment := cdsModel.FieldByName('IDDepartment').AsInteger;
AskSalesPerson := cdsModel.FieldByName('AskUserOnSale').AsBoolean;
HasSerialNumber := cdsModel.FieldByName('SerialNumber').AsBoolean;
AskDocument := cdsModel.FieldByName('UseDocumentOnSale').AsBoolean;
UseScale := cdsModel.FieldByName('UseScale').AsBoolean;
TotParcial := GetTotalizadorParcial(cdsModel.FieldByName('IDTaxCategory').AsInteger);
Unidade := cdsModel.FieldByName('Sigla').AsString;
CaseQty := cdsBarcodeCaseQty.AsFloat;
if cdsModel.FieldByName('PromotionPrice').AsCurrency <> 0 then
Selling := cdsModel.FieldByName('PromotionPrice').AsCurrency
else
Selling := cdsModel.FieldByName('SellingPrice').AsCurrency;
StorePrice := cdsModel.FieldByName('StoreSellingPrice').AsCurrency;
//Open Qty for Store
//DM.fPOS.GetQty(IDModel, DM.fStore.ID, fOnHand, fOnPreSale, fOnPrePurchase);
//Verifica se o Model esta deletado e Restaura
if DM.PersistenceType = ptDB then
DM.ModelRestored(IDModel);
//cancelar os pagamentos pre-datados caso haja mudanca
//CancelPreDatar;
Result := True;
finally
if DM.PersistenceType = ptDB then
begin
cdsBarcode.Close;
cdsModel.Close;
quModel.CommandText := ChangeWhereClause(quModel.CommandText, sOriginalWhere, True);
end;
cdsBarcode.Filter := '';
cdsModel.Filter := '';
cdsBarcode.Filtered := False;
cdsModel.Filtered := False;
end;
end;
function TDMPDV.GetECFTaxIndex(IDTaxCategory: Integer): String;
var
Indice: Integer;
begin
Result := '';
Indice := ECFTaxList.IndexOf(IntToStr(IDTaxCategory));
if Indice >= 0 then
Result := TECFTax(ECFTaxList.Objects[Indice]).ECFIndex;
end;
function TDMPDV.GetCodFiscal(IDMeioPag: Integer): String;
var
Indice: Integer;
begin
Result := '';
Indice := ECFPagList.IndexOf(IntToStr(IDMeioPag));
if Indice >= 0 then
Result := TECFPag(ECFPagList.Objects[Indice]).ECFIndex;
end;
function TDMPDV.GetECFVinIndex(IDMeioPag: Integer): String;
var
Indice: Integer;
begin
Result := '';
Indice := ECFVinList.IndexOf(IntToStr(IDMeioPag));
if Indice >= 0 then
Result := TECFVin(ECFVinList.Objects[Indice]).ECFIndex;
end;
function TDMPDV.GetBandeira(IDMeioPag: Integer): Integer;
var
Indice: Integer;
begin
Result := 0;
Indice := ECFPagList.IndexOf(IntToStr(IDMeioPag));
if Indice >= 0 then
Result := TECFPag(ECFPagList.Objects[Indice]).Bandeira;
end;
function TDMPDV.GetTipoTEF(IDMeioPag: Integer): Integer;
var
Indice: Integer;
begin
Result := 0;
Indice := ECFPagList.IndexOf(IntToStr(IDMeioPag));
if Indice >= 0 then
Result := TECFPag(ECFPagList.Objects[Indice]).TipoTEF;
end;
procedure TDMPDV.PreencheFormaPagamento;
var
I : Integer;
begin
FormasPagamento.Clear;
DefaultMeioPag := nil;
DM.PrepareCDS(cdsMeioPag, 'MeioPag');
try
for I:= Low(ATiposPagto) to High(ATiposPagto) do
begin
cdsMeioPag.Filtered := False;
cdsMeioPag.Filter := Format('Tipo = %D', [I]);
cdsMeioPag.Filtered := True;
if not cdsMeioPag.IsEmpty then
with FormasPagamento.Add(I, ATiposPagto[I]) do
while not cdsMeioPag.Eof do
begin
Add(
cdsMeioPag.FieldByName('IDMeioPag').AsInteger,
cdsMeioPag.FieldByName('ImageIndex').AsInteger,
GetCodFiscal(cdsMeioPag.FieldByName('IDMeioPag').AsInteger),
Copy(cdsMeioPag.FieldByName('MeioPag').AsString, 1, 16),
cdsMeioPag.FieldByName('MeioPag').AsString,
cdsMeioPag.FieldByName('RequireCustomer').AsBoolean,
cdsMeioPag.FieldByName('ValidateNonpayer').AsBoolean
);
if (DefaultMeioPag = nil) and (cdsMeioPag.FieldByName('IDMeioPag').AsInteger = PAY_TYPE_CASH) then
DefaultMeioPag := MeiosPagamento[Count -1];
cdsMeioPag.Next;
end;
end;
finally
cdsMeioPag.Filtered := False;
cdsMeioPag.Filter := '';
end;
end;
procedure TDMPDV.DataModuleCreate(Sender: TObject);
var
sOriginalWhere: String;
begin
ECFTaxList := TStringList.Create;
ECFPagList := TStringList.Create;
ECFVinList := TStringList.Create;
LoadECFTaxList;
LoadECFPagList;
LoadECFVinList;
AbreTabelas;
PreencheFormaPagamento;
FTransferFile := TTransferFile.Create;
FTransferFile.OnServerStatus := ServerStatus;
FServerActive := True;
if DM.PersistenceType = ptTXT then
begin
SaveFilesToServer(True);
FCanTransferFile := True;
tmrSaveFilesToServer.Interval := DM.fCashRegister.SrvRefreshInSecond * 1000;
tmrSaveFilesToServer.Enabled := True;
end;
if DM.PersistenceType = ptDB then
begin
sOriginalWhere := ' M.Desativado = 0 AND M.Hidden = 0 AND ' +
'M.ModelType IN ('+QuotedStr('S')+', '+QuotedStr('R')+', '+QuotedStr('V')+', '+QuotedStr('C')+','+QuotedStr('K')+' ) ' +
Format('AND S.IDStore = %D ', [DM.fStore.ID]);
quModel.CommandText := ChangeWhereClause(quModel.CommandText, sOriginalWhere, True);
end;
FSellNegative := DM.fSystem.SrvParam[PARAM_SALEONNEGATIVE];
//pega a data do arquivo de qty
if (DM.fCashRegister.BlockNegativeSale) and (DM.PersistenceType = ptTXT) then
if FileExists(ExtractFilePath(Application.ExeName) + MIRROR_DIR + 'Quantity.xml') then
begin
FLastQtyUpdate := FileDateTime(ExtractFilePath(Application.ExeName) + MIRROR_DIR + 'Quantity.xml');
cdsQtySold.CreateDataSet;
if FileExists(ExtractFilePath(Application.ExeName) + MIRROR_DIR + 'QtySold.xml') then
begin
DM.PrepareCDS(cdsQtySold, 'QtySold', 'IDModel', False);
cdsQtySold.Filtered := False;
cdsQtySold.Filter := 'SaleDate < ' + QuotedStr(FormatDateTime('ddddd hh:mm', FLastQtyUpdate));
cdsQtySold.Filtered := True;
cdsQtySold.First;
while not cdsQtySold.EOF do
begin
cdsQtySold.Edit;
cdsQtySold.Delete;
end;
cdsQtySold.Filtered := False;
cdsQtySold.Filter := '';
end;
end;
end;
procedure TDMPDV.ServerStatus(Online : Boolean);
begin
FServerActive := Online;
end;
function TDMPDV.AddCustomer(Customer: TCustomerInfo): Integer;
begin
case DM.PersistenceType of
ptDB:
begin
Result := DM.GetNextID(MR_PESSOA_ID);
// Criar rotina para inserir no Dataset e no texto
with cmdPessoa do
begin
Parameters.ParamByName('IDPessoa').Value := Result;
Parameters.ParamByName('IDTipoPessoa').Value := 1;
Parameters.ParamByName('IDStore').Value := DM.fStore.ID;
Parameters.ParamByName('IDTipoPessoaRoot').Value := 1;
Parameters.ParamByName('IDUser').Value := DM.fUser.ID;
Parameters.ParamByName('Pessoa').Value := Customer.FirstName + ' ' + Customer.LastName;
Parameters.ParamByName('PessoaFirstName').Value := Customer.FirstName;
Parameters.ParamByName('PessoaLastName').Value := Customer.LastName;
Parameters.ParamByName('Endereco').Value := Customer.Endereco;
Parameters.ParamByName('Cidade').Value := Customer.Cidade;
Parameters.ParamByName('CEP').Value := Customer.Zip;
Parameters.ParamByName('Telefone').Value := Customer.Telefone;
Parameters.ParamByName('Juridico').Value := Customer.Juridico;
Parameters.ParamByName('CPF').Value := Customer.CPF;
Parameters.ParamByName('Bairro').Value := Customer.Bairro;
Parameters.ParamByName('PhoneAreaCode').Value := Customer.TelDDD;
Parameters.ParamByName('CellAreaCode').Value := Customer.CelDDD;
Parameters.ParamByName('Cellular').Value := Customer.Celelular;
Parameters.ParamByName('Email').Value := Customer.Email;
Parameters.ParamByName('HomePage').Value := Customer.WebSite;
Parameters.ParamByName('Identidade').Value := Customer.Identidate;
Parameters.ParamByName('OrgaoEmissor').Value := Customer.OrgEmiss;
if Customer.ExpDate <> 0 then
Parameters.ParamByName('DataExpedicao').Value := Customer.ExpDate;
if Customer.BirthDate <> 0 then
Parameters.ParamByName('Nascimento').Value := Customer.BirthDate;
Parameters.ParamByName('CustomerCard').Value := Customer.CustCard;
Parameters.ParamByName('CartMotorista').Value := Customer.CMotorista;
Parameters.ParamByName('NomeJuridico').Value := Customer.NomeJuridico;
Parameters.ParamByName('InscEstadual').Value := Customer.InscEstadual;
Parameters.ParamByName('InscMunicipal').Value := Customer.InscMunicipal;
Parameters.ParamByName('Contatos').Value := Customer.Contato;
Parameters.ParamByName('OBS').Value := Customer.OBS;
Parameters.ParamByName('CreationDate').Value := Now;
Execute;
end;
end;
ptTXT:
Result := 1;
else
Result := 1;
end;
end;
procedure TDMPDV.LoadECFTaxList;
var
ECFIni: TIniFile;
stlTax: TStringList;
ECFTaxTemp: TECFTax;
I: Integer;
begin
UnLoadECFTaxList;
ECFIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + ECF_CONFIGS);
try
stlTax := TStringList.Create;
try
stlTax.Duplicates := dupIgnore;
ECFIni.ReadSection('TAX', stlTax);
for I := 0 to stlTax.Count - 1 do
begin
ECFTaxTemp := TECFTax.Create;
ECFTaxTemp.ID := StrToIntDef(stlTax[I], 0);
ECFTaxTemp.ECFIndex := ECFIni.ReadString('TAX', stlTax[I], '');
ECFTaxList.AddObject(stlTax[I], ECFTaxTemp);
end;
finally
stlTax.Free;
end;
finally
ECFIni.Free;
end;
end;
procedure TDMPDV.LoadECFVinList;
var
ECFIni: TIniFile;
stlVin: TStringList;
ECFVinTemp: TECFVin;
I: Integer;
begin
UnLoadECFVinList;
ECFIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + ECF_CONFIGS);
try
stlVin := TStringList.Create;
try
stlVin.Duplicates := dupIgnore;
ECFIni.ReadSection('VINC', stlVin);
for I := 0 to stlVin.Count - 1 do
begin
ECFVinTemp := TECFVin.Create;
ECFVinTemp.ID := StrToIntDef(stlVin[I], 0);
ECFVinTemp.ECFIndex := ECFIni.ReadString('VINC', stlVin[I], '');
ECFVinList.AddObject(stlVin[I], ECFVinTemp);
end;
finally
stlVin.Free;
end;
finally
ECFIni.Free;
end;
end;
procedure TDMPDV.LoadECFPagList;
var
ECFIni: TIniFile;
stlPag, stlBand: TStringList;
ECFPagTemp: TECFPag;
I, idx: Integer;
begin
UnLoadECFPagList;
ECFIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + ECF_CONFIGS);
try
stlPag := TStringList.Create;
try
stlPag.Duplicates := dupIgnore;
ECFIni.ReadSection('PAYMENTS', stlPag);
for I := 0 to stlPag.Count - 1 do
begin
ECFPagTemp := TECFPag.Create;
ECFPagTemp.ID := StrToIntDef(stlPag[I], 0);
ECFPagTemp.ECFIndex := ECFIni.ReadString('PAYMENTS', stlPag[I], '');
ECFPagTemp.Bandeira := ECFIni.ReadInteger('BANDEIRA', stlPag[I], 0);
ECFPagList.AddObject(stlPag[I], ECFPagTemp);
end;
stlBand := TStringList.Create;
try
ECFIni.ReadSection('BANDEIRA', stlBand);
for I := 0 to stlBand.Count - 1 do
begin
idx := stlPag.IndexOf(stlBand[I]);
if (idx <> -1) then
ECFPagTemp := TECFPag(stlPag.Objects[idx])
else
begin
ECFPagTemp := TECFPag.Create;
ECFPagTemp.ID := StrToIntDef(stlBand[I], 0);
ECFPagList.AddObject(stlBand[I], ECFPagTemp);
end;
ECFPagTemp.Bandeira := ECFIni.ReadInteger('BANDEIRA', stlBand[I], 0);
end;
finally
stlBand.Free;
end;
LoadECFTEFList(ECFIni);
finally
stlPag.Free;
end;
finally
ECFIni.Free;
end;
end;
procedure TDMPDV.LoadECFTEFList(ECFIni: TIniFile);
var
stlTipoTEF: TStringList;
ECFPagTemp: TECFPag;
I, idx: Integer;
begin
stlTipoTEF := TStringList.Create;
try
ECFIni.ReadSection('TIPOTEF', stlTipoTEF);
for I := 0 to stlTipoTEF.Count - 1 do
begin
idx := ECFPagList.IndexOf(stlTipoTEF[I]);
if (idx <> -1) then
ECFPagTemp := TECFPag(ECFPagList.Objects[idx])
else
begin
ECFPagTemp := TECFPag.Create;
ECFPagTemp.ID := StrToIntDef(stlTipoTEF[I], 0);
ECFPagList.AddObject(stlTipoTEF[I], ECFPagTemp);
end;
ECFPagTemp.TipoTEF := ECFIni.ReadInteger('TIPOTEF', stlTipoTEF[I], 0);
end;
finally
stlTipoTEF.Free;
end;
end;
procedure TDMPDV.DataModuleDestroy(Sender: TObject);
begin
UnLoadECFTaxList;
UnLoadECFPagList;
UnLoadECFVinList;
ECFTaxList.Free;
ECFPagList.Free;
FTransferFile.Free;
end;
procedure TDMPDV.UnLoadECFTaxList;
var
I: Integer;
ECFTaxTemp: TECFTax;
begin
for I := 0 to ECFTaxList.Count - 1 do
begin
ECFTaxTemp := TECFTax(ECFTaxList.Objects[I]);
FreeAndNil(ECFTaxTemp);
end;
ECFTaxList.Clear;
end;
procedure TDMPDV.UnLoadECFPagList;
var
I: Integer;
ECFVinTemp: TECFVin;
begin
for I := 0 to ECFVinList.Count - 1 do
begin
ECFVinTemp := TECFVin(ECFVinList.Objects[I]);
FreeAndNil(ECFVinTemp);
end;
ECFVinList.Clear;
end;
procedure TDMPDV.UnLoadECFVinList;
var
I: Integer;
ECFVinTemp: TECFVin;
begin
for I := 0 to ECFVinList.Count - 1 do
begin
ECFVinTemp := TECFVin(ECFVinList.Objects[I]);
FreeAndNil(ECFVinTemp);
end;
ECFVinList.Clear;
end;
procedure TDMPDV.SetECFTaxIndex(IDTaxCategory: Integer; Value: String);
var
ECFIni: TIniFile;
begin
ECFIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + ECF_CONFIGS);
try
ECFIni.WriteString('TAX', IntToStr(IDTaxCategory), Value);
finally
ECFIni.Free;
end;
end;
procedure TDMPDV.SetECFBandeira(IDMeioPag: Integer; Value: Integer);
var
ECFIni: TIniFile;
begin
ECFIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + ECF_CONFIGS);
try
ECFIni.WriteInteger('BANDEIRA', IntToStr(IDMeioPag), Value);
finally
ECFIni.Free;
end;
end;
procedure TDMPDV.SetECFCodFiscal(IDMeioPag: Integer; Value: String);
var
ECFIni: TIniFile;
begin
ECFIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + ECF_CONFIGS);
try
ECFIni.WriteString('PAYMENTS', IntToStr(IDMeioPag), Value);
finally
ECFIni.Free;
end;
end;
procedure TDMPDV.SetECFVinIndex(IDMeioPag: Integer; Value: String);
var
ECFIni: TIniFile;
begin
ECFIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + ECF_CONFIGS);
try
ECFIni.WriteString('VINC', IntToStr(IDMeioPag), Value);
finally
ECFIni.Free;
end;
end;
procedure TDMPDV.SetECFTipoTEF(IDMeioPag, Value: Integer);
var
ECFIni: TIniFile;
begin
ECFIni := TIniFile.Create(ExtractFilePath(Application.ExeName) + ECF_CONFIGS);
try
ECFIni.WriteInteger('TIPOTEF', IntToStr(IDMeioPag), Value);
finally
ECFIni.Free;
end;
end;
procedure TDMPDV.cdsModelCalcFields(DataSet: TDataSet);
begin
if cdsModel.FieldByName('InvSellingPriceI').AsCurrency <> 0 then
begin
cdsModel.FieldByName('SellingPrice').AsCurrency := cdsModel.FieldByName('InvSellingPriceI').AsCurrency;
cdsModel.FieldByName('InvSellingPrice').AsCurrency := cdsModel.FieldByName('InvSellingPriceI').AsCurrency;
end
else
begin
cdsModel.FieldByName('SellingPrice').AsCurrency := cdsModel.FieldByName('InvSellingPriceM').AsCurrency;
cdsModel.FieldByName('InvSellingPrice').AsCurrency := cdsModel.FieldByName('InvSellingPriceM').AsCurrency
end;
if cdsModel.FieldByName('VendorCostI').AsCurrency <> 0 then
cdsModel.FieldByName('VendorCost').AsCurrency := cdsModel.FieldByName('VendorCostI').AsCurrency
else
cdsModel.FieldByName('VendorCost').AsCurrency := cdsModel.FieldByName('VendorCostM').AsCurrency;
case cdsModelSituacaoTributaria.AsInteger of
0,1 : cdsModelDescSituTribut.AsString := 'Tributável';
2 : cdsModelDescSituTribut.AsString := 'Não Tributável';
3 : cdsModelDescSituTribut.AsString := 'Substit. Tributária';
4 : cdsModelDescSituTribut.AsString := 'Isento';
5 : cdsModelDescSituTribut.AsString := 'ISS';
end;
end;
procedure TDMPDV.cdsMDescriptionCalcFields(DataSet: TDataSet);
begin
if cdsMDescription.FieldByName('InvSellingPriceI').AsCurrency <> 0 then
begin
cdsMDescription.FieldByName('SellingPrice').AsCurrency := cdsMDescription.FieldByName('InvSellingPriceI').AsCurrency;
cdsMDescription.FieldByName('InvSellingPrice').AsCurrency := cdsMDescription.FieldByName('InvSellingPriceI').AsCurrency;
end
else
begin
cdsMDescription.FieldByName('SellingPrice').AsCurrency := cdsMDescription.FieldByName('InvSellingPriceM').AsCurrency;
cdsMDescription.FieldByName('InvSellingPrice').AsCurrency := cdsMDescription.FieldByName('InvSellingPriceM').AsCurrency
end;
if cdsMDescription.FieldByName('VendorCostI').AsCurrency <> 0 then
cdsMDescription.FieldByName('VendorCost').AsCurrency := cdsMDescription.FieldByName('VendorCostI').AsCurrency
else
cdsMDescription.FieldByName('VendorCost').AsCurrency := cdsMDescription.FieldByName('VendorCostM').AsCurrency;
case cdsMDescriptionSituacaoTributaria.AsInteger of
0,1 : cdsMDescriptionDescSituTribut.AsString := 'Tributável';
2 : cdsMDescriptionDescSituTribut.AsString := 'Não Tributável';
3 : cdsMDescriptionDescSituTribut.AsString := 'Substit. Tributária';
4 : cdsMDescriptionDescSituTribut.AsString := 'Isento';
5 : cdsMDescriptionDescSituTribut.AsString := 'ISS';
end;
end;
procedure TDMPDV.cdsMDescriptionBeforeOpen(DataSet: TDataSet);
begin
if DM.PersistenceType = ptDB then
cdsMDescription.Params.ParamByName('IDStore').Value := DM.fStore.ID;
end;
procedure TDMPDV.cdsModelAccessoryBeforeOpen(DataSet: TDataSet);
begin
if DM.PersistenceType = ptDB then
cdsModelAccessory.Params.ParamByName('IDStore').Value := DM.fStore.ID;
end;
procedure TDMPDV.CloseSuggestions;
begin
if DM.PersistenceType = ptDB then
with cdsModelAccessory do
if Active then
Close;
end;
procedure TDMPDV.OpenSuggestions(IDModel: Integer);
begin
with cdsModelAccessory do
begin
case DM.PersistenceType of
ptDB:
begin
if not Active then
begin
cdsModelAccessory.Params.ParamByName('IDModel').Value := IDModel;
Open;
end;
end;
ptTXT:
begin
cdsModelAccessory.Filtered := False;
cdsModelAccessory.Filter := Format('IDModel = %D', [IDModel]);
cdsModelAccessory.Filtered := True;
end;
end;
end;
end;
procedure TDMPDV.CloseInvSerial;
begin
with cdsInvSerial do
begin
case DM.PersistenceType of
ptDB:
begin
if Active then
Close;
end;
ptTXT:
begin
Filtered := False;
Filter := '';
end;
end;
end;
end;
procedure TDMPDV.OpenInvSerial(IDModel: Integer);
begin
with cdsInvSerial do
begin
case DM.PersistenceType of
ptDB:
begin
if not Active then
begin
Params.ParamByName('ModelID').Value := IDModel;
Open;
end;
end;
ptTXT:
begin
Filtered := False;
Filter := Format('ModelID = %D AND StoreID = %D', [IDModel, DM.fStore.ID]);
Filtered := True;
end;
end;
end;
end;
procedure TDMPDV.AbreTabelas;
begin
if DM.PersistenceType = ptDB then
Exit;
with TFrmImport.Create(Self) do
UpdatePOS;
end;
procedure TDMPDV.CloseQuantity;
begin
if DM.PersistenceType = ptDB then
with cdsQty do
if Active then
Close;
end;
procedure TDMPDV.OpenQuantity(IDModel: Integer; AFilter : String);
begin
with cdsQty do
begin
FetchParams;
if not Active then
begin
if DM.PersistenceType = ptDB then
Params.ParambyName('ModelID').Value := IDModel;
DM.PrepareCDS(cdsQty, 'Quantity', 'Name', True);
end;
Filtered := False;
Filter := Format('IDModel = %D', [IDModel]);
if AFilter <> '' then
Filter := Filter + ' AND ' + AFilter;
Filtered := True;
end;
end;
procedure TDMPDV.InitGlobalTXT;
begin
if (DM.PersistenceType = ptTXT) and (DM.fCashRegister.RefreshGlobal<>0) then
begin
tmLoadGlobal.Interval := DM.fCashRegister.RefreshGlobal*60000;
tmLoadGlobal.Enabled := True;
end;
end;
procedure TDMPDV.tmLoadGlobalTimer(Sender: TObject);
begin
{
with TFrmImport.Create(Self) do
UpdatePOS;
}
end;
function TDMPDV.TestInvoiceDiscRange(AIDCommissionType: Integer; AInvoiceValue, ADiscount: Currency): Boolean;
begin
try
if DM.PersistenceType = ptDB then
cdsDiscRange.Open;
cdsDiscRange.Filtered := False;
if cdsDiscRange.IsEmpty then
begin
Result := True;
Exit;
end;
cdsDiscRange.Filter := Format('IDTipoComissionado = %D and TotVendaMin <= %9.2f', [AIDCommissionType, AInvoiceValue]);
cdsDiscRange.Filtered := True;
cdsDiscRange.Last;
Result := cdsDiscRangePercDiscMax.AsCurrency >= ADiscount;
finally
cdsDiscRange.Filter := '';
cdsDiscRange.Filtered := False;
if DM.PersistenceType = ptDB then
cdsDiscRange.Close;
end;
end;
function TDMPDV.SelectModelDepartment(const AIDModel: Integer; var AIDDepartment: Integer): Boolean;
begin
try
try
if DM.PersistenceType = ptDB then
cdsInvModelDepartment.Open;
cdsInvModelDepartment.Filter := Format('ModelID = %D', [AIDModel]);
cdsInvModelDepartment.Filtered := True;
if cdsInvModelDepartment.IsEmpty then
Result := True
else
if cdsInvModelDepartment.RecordCount = 1 then
begin
AIDDepartment := cdsInvModelDepartmentIDDepartment.AsInteger;
Result := True;
end
else
begin
with TFrmAskDepartment.Create(self) do
try
Result := Start(AIDDepartment);
finally
Free;
end;
end;
finally
cdsInvModelDepartment.Filter := '';
cdsInvModelDepartment.Filtered := False;
if DM.PersistenceType = ptDB then
cdsInvModelDepartment.Close;
end;
except
Result := False;
end;
end;
procedure TDMPDV.SaveFilesToServer(AllLastFiles: Boolean = False);
begin
if DM.PersistenceType = ptTXT then
begin
FTransferFile.RemoteWorkingDir := DM.fCashRegister.RemoteWorkingDir;
FTransferFile.LocalWorkingDir := DM.fCashRegister.LocalWorkingDir;
if AllLastFiles then
begin
if DM.fCashRegister.RecentClosedCash <> '' then
FTransferFile.FileList := DM.fCashRegister.RecentClosedCash + ';' + DM.fCashRegister.LastSalesFiles
else
FTransferFile.FileList := DM.fCashRegister.LastSalesFiles
end
else
FTransferFile.FileList := DM.fCashRegister.SalesFileName;
FTransferFile.IDCashReg := DM.fCashRegister.IDDefault;
FTransferFile.Execute;
end;
end;
procedure TDMPDV.tmrSaveFilesToServerTimer(Sender: TObject);
begin
if FCanTransferFile then
SaveFilesToServer;
end;
procedure TDMPDV.cdsInvSerialBeforeOpen(DataSet: TDataSet);
begin
if DM.PersistenceType = ptDB then
cdsInvSerial.Params.ParamByName('StoreID').Value := DM.fStore.ID;
end;
procedure TDMPDV.CloseTablePrice;
begin
case DM.PersistenceType of
ptDB:
begin
if cdsStoreTablePrice.Active then
cdsStoreTablePrice.Close;
if cdsModelTablePrice.Active then
cdsModelTablePrice.Close;
end;
ptTXT:
begin
cdsStoreTablePrice.Filtered := False;
cdsStoreTablePrice.Filter := '';
cdsModelTablePrice.Filtered := False;
cdsModelTablePrice.Filter := '';
end;
end;
end;
procedure TDMPDV.OpenTablePrice(IDStore, IDModel: Integer);
begin
case DM.PersistenceType of
ptDB:
begin
if not cdsStoreTablePrice.Active then
begin
cdsStoreTablePrice.FetchParams;
cdsStoreTablePrice.Params.ParamByName('IDStore').Value := IDStore;
cdsStoreTablePrice.Params.ParamByName('IDModel').Value := IDModel;
cdsStoreTablePrice.Open;
end;
if not cdsModelTablePrice.Active then
begin
cdsModelTablePrice.FetchParams;
cdsModelTablePrice.Params.ParamByName('IDModel').Value := IDModel;
cdsModelTablePrice.Open;
end;
end;
ptTXT:
begin
cdsStoreTablePrice.Filtered := False;
cdsStoreTablePrice.Filter := Format('IDStore = %D AND IDModel = %D', [IDStore, IDModel]);
cdsStoreTablePrice.Filtered := True;
cdsModelTablePrice.Filtered := False;
cdsModelTablePrice.Filter := Format('IDModel = %D', [IDModel]);
cdsModelTablePrice.Filtered := True;
end;
end;
end;
function TDMPDV.GetTotalCashInRegister: Currency;
begin
Result := DM.fSystem.SrvParam[PARAM_MAXCASHALLOWED];
end;
function TDMPDV.GetTotalCashSale(IDCashRegMov : Integer): Currency;
begin
Result := DM.fPOS.GetTotalCashWithdraw(IDCashRegMov)
end;
function TDMPDV.IsMinPayValue(AIDPaymentType: Integer; AValue: Real): boolean;
begin
Result := True;
with cdsMeioPagMinSale do
try
Filtered := False;
Filter := 'IDMeioPag = ' + IntToStr(AIDPaymentType);
Filtered := True;
if not IsEmpty then
Result := AValue >= FieldByName('TotalSale').AsCurrency;
finally
Filtered := False;
end;
end;
function TDMPDV.AjustaPreco(Qtde, PrecoBalanca, PrecoUnit: real): Real;
var
PrecoECF, QtdeECF: real;
sQTD: String;
begin
sQTD := FormatFloat('0000.000', Qtde);
QtdeECF := TruncarDecimal(StrToFloat(sQTD), 3);
Qtde := TruncarDecimal(Qtde, 3);
if QtdeECF <> Qtde then
PrecoECF := QtdeECF * PrecoUnit
else
PrecoECF := Qtde * PrecoUnit;
PrecoECF := TruncarDecimal(PrecoECF, 2);
if PrecoBalanca <> PrecoECF then
Result := PrecoECF
else
Result := PrecoBalanca;
end;
function TDMPDV.TruncarDecimal(Valor: Real; Decimal: integer): Double;
var
aux: string;
bNeg : Boolean;
begin
bNeg := False;
if Valor < 0 then
bNeg := True;
valor := Abs(valor);
valor := valor * 100000;
aux := FormatFloat('00000000000000000000',valor);
aux := copy( aux, 1, 15) + copy( aux, 16, Decimal);
case Decimal of
2: valor := strToFloat(aux) / 100;
3: valor := strToFloat(aux) / 1000;
4: valor := strToFloat(aux) / 10000;
5: valor := strToFloat(aux) / 100000;
end;
if bNeg then
valor := valor * -1;
result := Valor;
end;
function TDMPDV.GetTotalizadorParcial(IDTaxCategory: Integer): String;
var
Indice: Integer;
begin
Result := '';
if DM.fCashRegister.GeneratePAFSintegra then
begin
Indice := ECFTaxList.IndexOf(IntToStr(IDTaxCategory));
if Indice >= 0 then
begin
if TECFTax(ECFTaxList.Objects[Indice]).ECFTotalizador = '' then
TECFTax(ECFTaxList.Objects[Indice]).ECFTotalizador := GetECFTotParcial(Trim(TECFTax(ECFTaxList.Objects[Indice]).ECFIndex));
Result := Trim(TECFTax(ECFTaxList.Objects[Indice]).ECFTotalizador);
end;
end;
end;
function TDMPDV.GetECFTotParcial(Aliquota: String): String;
var
sAliquotas, sTemp, sTax : String;
i, iPosIni, iPosEnd, iCopy : Integer;
begin
//PAF
sAliquotas := '';
iPosIni := 1;
iPosEnd := 4;
iCopy := 5;
sTax := '0000';
if DM.fPrintReceipt.ECFPrinterName = 'DarumaTermica' then
begin
iPosIni := 2;
iPosEnd := 5;
iCopy := 6;
sTax := '00000';
end;
if Copy(Aliquota,1,1)[1] in ['I', 'F', 'N'] then
Result := Aliquota
else
begin
sAliquotas := DM.fModuloFiscal.TotParciais;
i := 0;
while Length(sAliquotas) > 0 do
begin
sTemp := Copy(sAliquotas, 1, iPosEnd);
if (sTemp <> sTax) then
begin
if Length(Aliquota) = 4 then
begin
if Aliquota = Copy(sTemp, iPosIni, iPosEnd) then
begin
Result := FormatFloat('00', i+1) + 'T' + Aliquota;
Exit;
end;
end
else if StrToInt(Aliquota) = i+1 then
begin
Result := FormatFloat('00',i+1) + 'T' + Copy(sTemp, iPosIni, iPosEnd);
Exit;
end;
inc(i);
end
else
Break;
sAliquotas := Copy(sAliquotas, iCopy, Length(sAliquotas));
end;
end;
end;
procedure TDMPDV.AddQtySold(AIDModel: Integer; AQty: Double);
begin
if DM.fCashRegister.BlockNegativeSale and (DM.PersistenceType = ptTXT) then
begin
cdsQtySold.Append;
cdsQtySoldIDModel.AsInteger := AIDModel;
cdsQtySoldQty.AsFloat := AQty;
cdsQtySoldSaleDate.AsDateTime := Now;
cdsQtySold.Post;
end;
end;
procedure TDMPDV.SaveQtySold;
begin
if DM.fCashRegister.BlockNegativeSale and (DM.PersistenceType = ptTXT) then
cdsQtySold.SaveToFile(ExtractFilePath(Application.ExeName) + MIRROR_DIR + 'QtySold.xml');
end;
function TDMPDV.GetQtySold(AIDModel: Integer): Double;
begin
Result := 0;
if DM.fCashRegister.BlockNegativeSale and (DM.PersistenceType = ptTXT) then
begin
with cdsQtySold do
begin
Filtered := False;
Filter := Format('IDModel = %D', [AIDModel]);
Filtered := True;
First;
while not EOF do
begin
Result := Result + cdsQtySoldQty.AsFloat;
Next;
end;
Filtered := False;
Filter := '';
end;
end;
end;
end.
|
(* Axes, Armour & Ale - Roguelike for Linux and Windows.
@author (Chris Hawkins)
*)
unit main;
{$mode objfpc}{$H+}
{$IfOpt D+}
{$Define DEBUG}
{$EndIf}
interface
uses
Classes, Forms, ComCtrls, Graphics, SysUtils, map, player,
globalutils, Controls, LCLType, ui, items, player_inventory;
type
{ TGameWindow }
TGameWindow = class(TForm)
StatusBar1: TStatusBar;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: word);
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: integer);
procedure FormPaint(Sender: TObject);
(* New game setup *)
procedure newGame;
(* Continue previous saved game *)
procedure continueGame;
(* Confirm quit game *)
procedure confirmQuit;
(* Free memory *)
procedure freeMemory;
private
public
end;
var
GameWindow: TGameWindow;
(* Display is drawn on tempScreen before being copied to canvas *)
tempScreen, inventoryScreen, RIPscreen: TBitmap;
(* 0 = titlescreen, 1 = game running, 2 = inventory screen, 3 = Quit menu, 4 = Game Over *)
gameState: byte;
(* Screen to display *)
currentScreen: TBitmap;
implementation
uses
entities, fov;
{$R *.lfm}
{ TGameWindow }
procedure TGameWindow.FormCreate(Sender: TObject);
begin
gameState := 0;
tempScreen := TBitmap.Create;
tempScreen.Height := 578;
tempScreen.Width := 835;
inventoryScreen := TBitmap.Create;
inventoryScreen.Height := 578;
inventoryScreen.Width := 835;
RIPscreen := TBitmap.Create;
RIPscreen.Height := 578;
RIPscreen.Width := 835;
currentScreen := tempScreen;
Randomize;
if (ParamCount = 2) then
begin
if (ParamStr(1) = '--seed') then
RandSeed := StrToInt(ParamStr(2))
else
begin
(* Set random seed *)
{$IFDEF Linux}
RandSeed := RandSeed shl 8;
{$ENDIF}
{$IFDEF Windows}
RandSeed := ((RandSeed shl 8) or GetProcessID);
{$ENDIF}
end;
end;
StatusBar1.SimpleText := 'Version ' + globalutils.VERSION;
(* Check for previous save file *)
if FileExists(GetUserDir + globalutils.saveFile) then
ui.titleScreen(1)
else
ui.titleScreen(0);
end;
procedure TGameWindow.FormDestroy(Sender: TObject);
begin
(* Don't try to save game from title screen *)
if (gameState = 1) then
begin
globalutils.saveGame;
freeMemory;
end;
tempScreen.Free;
inventoryScreen.Free;
RIPscreen.Free;
{$IFDEF Linux}
WriteLn('Axes, Armour & Ale - (c) Chris Hawkins');
{$ENDIF}
Application.Terminate;
end;
procedure gameLoop;
var
i: smallint;
begin
(* Check for player death at start of game loop *)
if (entityList[0].currentHP <= 0) then
begin
player.gameOver;
Exit;
end;
(* move NPC's *)
entities.NPCgameLoop;
(* Redraw Field of View after entities move *)
fov.fieldOfView(entityList[0].posX, entityList[0].posY, entityList[0].visionRange, 1);
(* Draw all visible items *)
for i := 1 to items.itemAmount do
if (map.canSee(items.itemList[i].posX, items.itemList[i].posY) = True) then
begin
items.itemList[i].inView := True;
items.redrawItems;
(* Display a message if this is the first time seeing this item *)
if (items.itemList[i].discovered = False) then
begin
ui.displayMessage('You see a ' + items.itemList[i].itemName);
items.itemList[i].discovered := True;
end;
end
else
begin
items.itemList[i].inView := False;
map.drawTile(itemList[i].posX, itemList[i].posY, 0);
end;
(* Redraw NPC's *)
entities.redrawNPC;
(* Update health display to show damage *)
ui.updateHealth;
if (entityList[0].currentHP <= 0) then
(* Clear Look / Info box *)
ui.displayLook(1, 'none', '', 0, 0);
(* Redraw Player *)
drawToBuffer(map.mapToScreen(entities.entityList[0].posX),
map.mapToScreen(entities.entityList[0].posY),
entities.playerGlyph);
(* Process status effects *)
player.processStatus;
(* Check for player death at end of game loop *)
if (entityList[0].currentHP <= 0) then
begin
player.gameOver;
Exit;
end;
end;
procedure TGameWindow.FormKeyDown(Sender: TObject; var Key: word);
begin
if (gameState = 1) then
begin // beginning of game input
case Key of
VK_LEFT, VK_NUMPAD4, VK_H:
begin
player.movePlayer(2);
gameLoop;
Invalidate;
end;
VK_RIGHT, VK_NUMPAD6, VK_L:
begin
player.movePlayer(4);
gameLoop;
Invalidate;
end;
VK_UP, VK_NUMPAD8, VK_K:
begin
player.movePlayer(1);
gameLoop;
Invalidate;
end;
VK_DOWN, VK_NUMPAD2, VK_J:
begin
player.movePlayer(3);
gameLoop;
Invalidate;
end;
VK_NUMPAD9, VK_U:
begin
player.movePlayer(5);
gameLoop;
Invalidate;
end;
VK_NUMPAD3, VK_N:
begin
player.movePlayer(6);
gameLoop;
Invalidate;
end;
VK_NUMPAD1, VK_B:
begin
player.movePlayer(7);
gameLoop;
Invalidate;
end;
VK_NUMPAD7, VK_Y:
begin
player.movePlayer(8);
gameLoop;
Invalidate;
end;
VK_G, VK_OEM_COMMA: // Get item
begin
player.pickUp;
gameLoop;
Invalidate;
end;
VK_D: // Drop item
begin
currentScreen := inventoryScreen;
gameState := 2;
player_inventory.drop(10);
Invalidate;
end;
VK_Q: // Quaff item
begin
currentScreen := inventoryScreen;
gameState := 2;
player_inventory.quaff(10);
Invalidate;
end;
VK_W: // Wear / Wield item
begin
currentScreen := inventoryScreen;
gameState := 2;
player_inventory.wield(10);
Invalidate;
end;
VK_I: // Show inventory
begin
player_inventory.showInventory;
Invalidate;
end;
VK_ESCAPE: // Quit game
begin
gameState := 3;
confirmQuit;
end;
end;
end // end of game input
else if (gameState = 0) then
begin // beginning of Title menu
case Key of
VK_N: newGame;
VK_L: continueGame;
VK_Q: Close();
end; // end of title menu screen
end
else if (gameState = 2) then
begin // beginning of inventory menu
case Key of
VK_ESCAPE: // Exit
begin
player_inventory.menu(0);
Invalidate;
end;
VK_D: // Drop
begin
player_inventory.menu(1);
Invalidate;
end;
VK_Q: // Quaff
begin
player_inventory.menu(12);
Invalidate;
end;
VK_W: // Wear / Wield
begin
player_inventory.menu(13);
Invalidate;
end;
VK_0:
begin
player_inventory.menu(2);
Invalidate;
end;
VK_1:
begin
player_inventory.menu(3);
Invalidate;
end;
VK_2:
begin
player_inventory.menu(4);
Invalidate;
end;
VK_3:
begin
player_inventory.menu(5);
Invalidate;
end;
VK_4:
begin
player_inventory.menu(6);
Invalidate;
end;
VK_5:
begin
player_inventory.menu(7);
Invalidate;
end;
VK_6:
begin
player_inventory.menu(8);
Invalidate;
end;
VK_7:
begin
player_inventory.menu(9);
Invalidate;
end;
VK_8:
begin
player_inventory.menu(10);
Invalidate;
end;
VK_9:
begin
player_inventory.menu(11);
Invalidate;
end;
end; // end of inventory menu
end
else if (gameState = 3) then // Quit menu
begin
case Key of
VK_Q:
begin
globalutils.saveGame;
gameState := 0;
freeMemory;
Close();
end;
VK_X:
begin
freeMemory;
globalutils.saveGame;
gameState := 0;
ui.clearLog;
ui.titleScreen(1);
Invalidate;
end;
VK_ESCAPE:
begin
gameState := 1;
ui.rewriteTopMessage;
Invalidate;
end;
end;
end
else if (gameState = 4) then // Game Over menu
begin
case Key of
VK_Q:
begin
gameState := 0;
freeMemory;
Close();
end;
VK_X:
begin
freeMemory;
gameState := 0;
ui.clearLog;
ui.titleScreen(0);
currentScreen := tempScreen;
Invalidate;
end;
end;
end;
end;
(* Capture mouse position for the Look command *)
procedure TGameWindow.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: integer);
begin
if (X >= 1) and (X <= 686) and (Y >= 1) and (Y <= 400) then
begin
(* Check for entity *)
if (map.isOccupied(map.screenToMap(x), map.screenToMap(y)) = True) then
begin
(* Add check if they are visible *)
if (isCreatureVisible(screenToMap(x), screenToMap(y)) = True) then
begin
(* Send entity name, current HP and max HP to UI display *)
ui.displayLook(1, getCreatureName(screenToMap(x), screenToMap(y)), '',
getCreatureHP(screenToMap(x), screenToMap(y)),
getCreatureMaxHP(screenToMap(x), screenToMap(y)));
Invalidate;
end;
end
(* Check for item *)
else if (items.containsItem(map.screenToMap(x), map.screenToMap(y)) = True) then
begin
ui.displayLook(2, getItemName(map.screenToMap(x), map.screenToMap(y)),
getItemDescription(map.screenToMap(x), map.screenToMap(y)), 0, 0);
Invalidate;
end
else
begin
(* Clear UI display *)
ui.displayLook(1, 'none', '', 0, 0);
Invalidate;
end;
end;
end;
procedure TGameWindow.FormPaint(Sender: TObject);
begin
Canvas.Draw(0, 0, currentScreen);
end;
procedure TGameWindow.newGame;
begin
{$IfDef DEBUG}
{$IfDef Linux}
writeln('Debugging info...');
writeln('Random seed = ' + IntToStr(RandSeed));
{$EndIf}
{$EndIf}
gameState := 1;
killer := 'empty';
playerTurn := 0;
map.mapType := 0;
map.setupMap;
map.setupTiles;
entities.setupEntities;
items.setupItems;
(* Clear the screen *)
tempScreen.Canvas.Brush.Color := globalutils.BACKGROUNDCOLOUR;
tempScreen.Canvas.FillRect(0, 0, tempScreen.Width, tempScreen.Height);
(* Spawn game entities *)
entities.spawnNPCs;
(* Drop items *)
items.initialiseItems;
(* Draw sidepanel *)
ui.drawSidepanel;
(* Setup players starting equipment *)
player.createEquipment;
ui.displayMessage('Welcome message to be added here...');
gameLoop;
Canvas.Draw(0, 0, tempScreen);
end;
procedure TGameWindow.continueGame;
begin
gameState := 1;
globalutils.loadGame;
killer := 'empty';
(* Clear the screen *)
tempScreen.Canvas.Brush.Color := globalutils.BACKGROUNDCOLOUR;
tempScreen.Canvas.FillRect(0, 0, tempScreen.Width, tempScreen.Height);
map.setupTiles;
map.loadMap;
(* Add entities to the screen *)
entities.setupEntities;
entities.redrawNPC;
(* Add items to the screen *)
items.setupItems;
items.redrawItems;
(* Draw sidepanel *)
ui.drawSidepanel;
(* Check for equipped items *)
player_inventory.loadEquippedItems;
(* Setup player vision *)
fov.fieldOfView(entities.entityList[0].posX, entities.entityList[0].posY,
entities.entityList[0].visionRange, 1);
ui.displayMessage('Welcome message to be added here...');
gameLoop;
Canvas.Draw(0, 0, tempScreen);
end;
procedure TGameWindow.confirmQuit;
begin
ui.exitPrompt;
Invalidate;
end;
procedure TGameWindow.freeMemory;
begin
(* Map tiles *)
map.caveFloorHi.Free;
map.caveFloorDef.Free;
map.caveWallHi.Free;
map.caveWallDef.Free;
map.blueDungeonFloorDef.Free;
map.blueDungeonFloorHi.Free;
map.blueDungeonWallDef.Free;
map.blueDungeonWallHi.Free;
map.caveWall2Def.Free;
map.caveWall2Hi.Free;
map.caveWall3Def.Free;
map.caveWall3Hi.Free;
map.downStairs.Free;
map.upStairs.Free;
map.bmDungeon3Def.Free;
map.bmDungeon3Hi.Free;
map.bmDungeon5Def.Free;
map.bmDungeon5Hi.Free;
map.bmDungeon6Def.Free;
map.bmDungeon6Hi.Free;
map.bmDungeon7Def.Free;
map.bmDungeon7Hi.Free;
map.bmDungeon9Def.Free;
map.bmDungeon9Hi.Free;
map.bmDungeon10Def.Free;
map.bmDungeon10Hi.Free;
map.bmDungeon11Def.Free;
map.bmDungeon11Hi.Free;
map.bmDungeon12Def.Free;
map.bmDungeon12Hi.Free;
map.bmDungeon13Def.Free;
map.bmDungeon13Hi.Free;
map.bmDungeon14Def.Free;
map.bmDungeon14Hi.Free;
map.greyFloorHi.Free;
map.greyFloorDef.Free;
map.bmDungeonBLHi.Free;
map.bmDungeonBLDef.Free;
map.bmDungeonBRHi.Free;
map.bmDungeonBRDef.Free;
map.bmDungeonTLDef.Free;
map.bmDungeonTLHi.Free;
map.bmDungeonTRDef.Free;
map.bmDungeonTRHi.Free;
map.blankTile.Free;
cave1Def.Free;
cave1Hi.Free;
cave4Def.Free;
cave4Hi.Free;
cave5Def.Free;
cave5Hi.Free;
cave7Def.Free;
cave7Hi.Free;
cave16Def.Free;
cave16Hi.Free;
cave17Def.Free;
cave17Hi.Free;
cave20Def.Free;
cave20Hi.Free;
cave21Def.Free;
cave21Hi.Free;
cave23Def.Free;
cave23Hi.Free;
cave28Def.Free;
cave28Hi.Free;
cave29Def.Free;
cave29Hi.Free;
cave31Def.Free;
cave31Hi.Free;
cave64Def.Free;
cave64Hi.Free;
cave65Def.Free;
cave65Hi.Free;
cave68Def.Free;
cave68Hi.Free;
cave69Def.Free;
cave69Hi.Free;
cave71Def.Free;
cave71Hi.Free;
cave80Def.Free;
cave80Hi.Free;
cave81Def.Free;
cave81Hi.Free;
cave84Def.Free;
cave84Hi.Free;
cave85Def.Free;
cave85Hi.Free;
cave87Def.Free;
cave87Hi.Free;
cave92Def.Free;
cave92Hi.Free;
cave93Def.Free;
cave93Hi.Free;
cave95Def.Free;
cave95Hi.Free;
cave112Def.Free;
cave112Hi.Free;
cave113Def.Free;
cave113Hi.Free;
cave116Def.Free;
cave116Hi.Free;
cave117Def.Free;
cave117Hi.Free;
cave119Def.Free;
cave119Hi.Free;
cave124Def.Free;
cave124Hi.Free;
cave125Def.Free;
cave125Hi.Free;
cave127Def.Free;
cave127Hi.Free;
cave193Def.Free;
cave193Hi.Free;
cave197Def.Free;
cave197Hi.Free;
cave199Def.Free;
cave199Hi.Free;
cave209Def.Free;
cave209Hi.Free;
cave213Def.Free;
cave213Hi.Free;
cave215Def.Free;
cave215Hi.Free;
cave221Def.Free;
cave221Hi.Free;
cave223Def.Free;
cave223Hi.Free;
cave241Def.Free;
cave241Hi.Free;
cave245Def.Free;
cave245Hi.Free;
cave247Def.Free;
cave247Hi.Free;
cave253Def.Free;
cave253Hi.Free;
cave255Def.Free;
cave255Hi.Free;
(* Item sprites *)
items.aleTankard.Free;
items.wineFlask.Free;
items.crudeDagger.Free;
items.leatherArmour1.Free;
items.clothArmour.Free;
items.woodenClub.Free;
(* Entity sprites *)
entities.playerGlyph.Free;
entities.caveRatGlyph.Free;
entities.hyenaGlyph.Free;
entities.caveBearGlyph.Free;
entities.barrelGlyph.Free;
entities.greenFungusGlyph.Free;
end;
end.
|
(*
Category: SWAG Title: BITWISE TRANSLATIONS ROUTINES
Original name: 0020.PAS
Description: ROMAN2.PAS
Author: SWAG SUPPORT TEAM
Date: 05-28-93 13:53
*)
{
>Anyone know of how to make a Program that will convert any
>Integer entered into roman numeral Format?
}
Program Roman_Numeral_Test;
Type
st_4 = String[4];
st_15 = String[15];
star_4 = Array[0..3] of st_4;
star_10 = Array[0..9] of st_4;
Const
Wunz : star_10 = ('', 'I', 'II', 'III', 'IV',
'V', 'VI', 'VII', 'VIII', 'IX');
Tenz : star_10 = ('', 'X', 'XX', 'XXX', 'XL',
'L', 'LX', 'LXX', 'LXXX', 'XC');
Hunz : star_10 = ('', 'C', 'CC', 'CCC', 'CD',
'D', 'DC', 'DCC', 'DCCC', 'CM');
Thouz : star_4 = ('', 'M', 'MM', 'MMM');
Function Dec2Roman(wo_in : Word) : st_15;
begin
Dec2Roman := Thouz[(wo_in div 1000)] +
Hunz[((wo_in mod 1000) div 100)] +
Tenz[(((wo_in mod 1000) mod 100) div 10)] +
Wunz[(((wo_in mod 1000) mod 100) mod 10)]
end;
Var
wo_Temp : Word;
begin
Writeln;
Write(' Enter number to be converted to roman-numeral equivalent: ');
readln(wo_Temp);
if (wo_Temp > 3999) then
wo_Temp := 3999;
Writeln;
Writeln(' Roman-numeral equivalent of ', wo_Temp, ' = ', Dec2Roman(wo_Temp))
end.
|
//*******************************************************//
// //
// DelphiFlash.com //
// Copyright (c) 2004-2008 FeatherySoft, Inc. //
// info@delphiflash.com //
// //
//*******************************************************//
// Description: Level of Flash-objects
// Last update: 12 mar 2008
{$I defines.inc}
//{$Q-}
unit FlashObjects;
interface
uses Windows, Classes, Contnrs, Graphics, SysUtils,
{$IFDEF VARIANTS}
Variants,
{$ENDIF}
{$IFDEF DelphiJPEG}
JPEG,
{$ENDIF}
SWFConst, SWFObjects, SWFStreams, SWFTools,
SoundReader, ImageReader, FLV;
type
TFlashMovie = class;
TFlashObject = class (TBasedSWFObject)
private
FOwner: TFlashMovie;
procedure SetOwner(Value: TFlashMovie);
protected
procedure ChangeOwner; virtual;
public
constructor Create(owner: TFlashMovie);
function LibraryLevel: Byte; override;
property Owner: TFlashMovie read FOwner write SetOwner;
end;
TFlashIDObject = class (TFlashObject)
private
FCharacterId: Word;
protected
function GetCharacterId: Word; virtual;
procedure SetCharacterId(ID: Word); virtual;
public
procedure Assign(Source: TBasedSWFObject); override;
property CharacterId: Word read GetCharacterId write SetCharacterId;
end;
TFlashSound = class (TFlashIDObject)
private
// Data: TStream;
DataBlockSize: LongInt;
DataLen: LongInt;
DataPos: LongInt;
DataStart: LongInt;
FAutoLoop: Boolean;
fBitsPerSample: Byte;
FDuration: Double;
FMP3Info: TMP3Info;
FrameSize: Word;
FrameWriten: LongInt;
FrecomendSampleCount: Word;
FSampleCount: dword;
FSamplesPerSec: Word;
FsndFormat: Byte;
FsndRate: Byte;
FStartFrame: Word;
FStereo: Boolean;
F_16Bit: Boolean;
FWaveCompressBits: byte;
FWaveReader: TWaveReader;
procedure SetWaveCompressBits(const Value: byte);
function GetWaveReader: TWaveReader;
procedure SetWaveReader(const Value: TWaveReader);
protected
isMultWriten: Byte;
MP3SeekStart: Word;
SamplesWriten: LongInt;
SeekSamples: LongInt;
wSampleCount: Word;
wFrameCount: Integer; // count of need MP3 frame write
WritenCount: Word;
FileName: string;
SelfDestroy: boolean;
procedure ParseWaveInfo;
property WaveReader: TWaveReader read GetWaveReader write SetWaveReader;
public
constructor Create(owner: TFlashMovie; fn: string = '');
destructor Destroy; override;
procedure Assign(Source: TBasedSWFObject); override;
procedure FillHeader(SH: TSWFSoundStreamHead; fps: single);
procedure LoadSound(fn: string);
procedure LoadFromMemory(Src: TMemoryStream; isMP3: boolean);
function MinVersion: Byte; override;
function StartSound: TSWFStartSound;
procedure WriteSoundBlock(BE: TBitsEngine);
procedure WriteSoundData(sender: TSWFObject; BE: TBitsEngine);
procedure WriteToStream(be: TBitsEngine); override;
property AutoLoop: Boolean read FAutoLoop write FAutoLoop;
property Duration: Double read FDuration write FDuration;
property MP3Info: TMP3Info read FMP3Info write FMP3Info;
property recomendSampleCount: Word read FrecomendSampleCount write FrecomendSampleCount;
property SampleCount: dword read FSampleCount write FSampleCount;
property SamplesPerSec: Word read FSamplesPerSec;
property sndFormat: Byte read FsndFormat write FsndFormat;
property sndRate: Byte read FsndRate write FsndRate;
property StartFrame: Word read FStartFrame write FStartFrame;
property Stereo: Boolean read FStereo write FStereo;
property _16Bit: Boolean read F_16Bit write F_16Bit;
property WaveCompressBits: byte read FWaveCompressBits write SetWaveCompressBits;
end;
// =================== TFlashImage ========================
TFlashImage = class;
TLoadCustomImageProc = procedure (sender: TFlashImage; FileName: string);
TLoadCustomImageEvent = procedure (sender: TFlashImage; FileName: string; var Default: boolean) of object;
TImageDataState = (dsNoInit, dsMemory, dsMemoryBMP, dsInitJPEG, dsMemoryJPEG, dsFileJPEG);
TFlashImage = class (TFlashIDObject)
private
FAlphaData: TMemoryStream;
FAsJPEG: Boolean;
FBMPStorage: TBMPReader;
FColorCount: Integer;
FConvertProgressiveJPEG: Boolean;
FData: TStream;
FDataState: TImageDataState;
FFileName: string;
FHasUseAlpha: Boolean;
FHeight: Word;
FSaveWidth: Word;
FWidth: Word;
SWFBMPType: Byte;
procedure SetAsJPEG(const Value: Boolean);
function GetAlphaData: TMemoryStream;
function GetAlphaPixel(X, Y: Integer): Byte;
function GetBMPStorage: TBMPReader;
function GetData: TStream;
function GetHeight: Word;
function GetWidth: Word;
procedure LoadAlphaDataFromBMPReader(BMP: TBMPReader);
procedure SetAlphaPixel(X, Y: Integer; Value: Byte);
procedure SetConvertProgressiveJPEG(Value: Boolean);
procedure SetData(Value: TStream);
procedure SetFileName(value: string);
protected
procedure GetBMPInfo;
public
constructor Create(owner: TFlashMovie; fn: string = '');
destructor Destroy; override;
procedure Assign(Source: TBasedSWFObject); override;
procedure CopyToStream(S: TStream);
procedure LoadAlphaDataFromFile(fn: string);
procedure LoadAlphaDataFromHandle(HBMP: HBitmap);
procedure LoadAlphaDataFromStream(S: TStream);
procedure LoadDataFromFile(fn: string);
procedure LoadDataFromHandle(HBMP: HBitmap);
procedure LoadDataFromNativeStream(S: TStream; JPG: boolean; Width, Height: integer); overload;
procedure LoadDataFromNativeStream(S: TStream; JPG: boolean; Width, Height: integer; BMPType, ColorCount: byte; HasAlpha: boolean); overload;
procedure LoadDataFromStream(S: TStream);
procedure MakeAlphaLayer(Alpha: byte = $FF);
procedure MakeDataFromBMP;
procedure FillBitsLossless(BL: TSWFDefineBitsLossless);
function MinVersion: Byte; override;
procedure SetAlphaColor(Color: recRGBA);
procedure SetAlphaIndex(Index, Alpha: byte);
procedure WriteAlphaData(sender: TSWFObject; BE: TBitsEngine);
procedure WriteData(sender: TSWFObject; BE: TBitsEngine);
procedure WriteToStream(be: TBitsEngine); override;
property AlphaData: TMemoryStream read GetAlphaData;
property AlphaPixel[X, Y: Integer]: Byte read GetAlphaPixel write SetAlphaPixel;
property AsJPEG: Boolean read FAsJPEG write SetAsJPEG;
property BMPStorage: TBMPReader read GetBMPStorage;
property ColorCount: Integer read FColorCount;
property ConvertProgressiveJPEG: Boolean read FConvertProgressiveJPEG write SetConvertProgressiveJPEG;
property Data: TStream read GetData write SetData;
property DataState: TImageDataState read FDataState;
property FileName: string read FFileName write SetFileName;
property HasUseAlpha: Boolean read FHasUseAlpha write FHasUseAlpha;
property Height: Word read GetHeight;
property SaveWidth: Word read FSaveWidth;
property Width: Word read GetWidth;
end;
// =================== TFlashActionScript ========================
TFlashActionScript = class (TFlashObject)
private
FActionList: TSWFActionList;
FSelfDestroy: Boolean;
protected
function GetAction(index: integer): TSWFAction;
public
constructor Create(owner: TFlashMovie; A: TSWFActionList = nil);
destructor Destroy; override;
procedure Add;
procedure Add2;
procedure AsciiToChar;
procedure Assign(Source: TBasedSWFObject); override;
procedure BitAnd;
procedure BitLShift;
procedure BitOr;
procedure BitRShift;
procedure BitURShift;
procedure BitXor;
function ByteCode(const str: string): TSWFActionByteCode; overload;
function ByteCode(const AB: array of byte): TSWFActionByteCode; overload;
function ByteCode(Data: Pointer; Size: longint): TSWFActionByteCode; overload;
procedure Call;
procedure CallFunction;
procedure CallMethod;
procedure CastOp;
procedure CharToAscii;
procedure CloneSprite;
{$IFDEF ASCompiler}
function Compile(src: TStrings): boolean; overload;
function Compile(src: TStream): boolean; overload;
function Compile(src: ansistring): boolean; overload;
function Compile(FileName: string; unicode: boolean): boolean; overload;
{$ENDIF}
function ConstantPool(Consts: array of string): TSWFActionConstantPool; overload;
function ConstantPool(Consts: TStrings): TSWFActionConstantPool; overload;
procedure Decrement;
function DefineFunction(Name: string; Params: array of string): TSWFActionDefineFunction; overload;
function DefineFunction(Name: string; Params: TStrings): TSWFActionDefineFunction; overload;
function DefineFunction2(Name: string; Params: array of string; RegistersAllocate: byte): TSWFActionDefineFunction2; overload;
function DefineFunction2(Name: string; Params: TStrings; RegistersAllocate: byte): TSWFActionDefineFunction2; overload;
procedure DefineLocal;
procedure DefineLocal2;
procedure Delete;
procedure Delete2;
procedure Divide;
procedure EndDrag;
procedure Enumerate;
procedure Enumerate2;
procedure Equals;
procedure Equals2;
procedure Extends;
procedure FSCommand(command, param: string);
procedure FSCommand2(Args: TStrings); overload; // for Flash Lite
procedure FSCommand2(Args: string); overload;
procedure FSCommand2(const Args: array of Variant); overload;
procedure GetMember;
procedure GetProperty; overload;
procedure GetProperty(targ: string; id: byte); overload;
procedure GetTime;
procedure GetUrl(const Url, Target: string);
procedure GetUrl2(TargetFlag, VariablesFlag: boolean; SendMethod: byte);
procedure GetVariable; overload;
procedure GetVariable(VarName: string); overload;
procedure GotoAndPlay(_Label: string); overload;
procedure GotoAndPlay(Frame: Word); overload;
procedure GotoAndStop(_Label: string); overload;
procedure GotoAndStop(Frame: Word); overload;
procedure GotoFrame(N: word);
procedure GotoFrame2(Play: boolean; SceneBias: word = 0);
procedure GoToLabel(FrameLabel: string);
procedure Greater;
procedure ImplementsOp;
procedure Increment;
procedure InitArray;
procedure InitObject;
procedure InstanceOf;
function Jump: TSWFActionJump;
procedure Less;
procedure Less2;
function LoadMovie(URL, Target: string; IsBrowserTarget: boolean = false; Method: byte = svmNone): TSWFActionGetUrl2;
function LoadMovieNum(URL: string; Level: word; Method: byte = svmNone): TSWFActionGetUrl2;
function LoadVariables(URL, Target: string; Method: byte = svmNone): TSWFActionGetUrl2;
function LoadVariablesNum(URL: string; Level: word; Method: byte = svmNone): TSWFActionGetUrl2;
procedure MBAsciiToChar;
procedure MBCharToAscii;
procedure MBStringExtract;
procedure MBStringLength;
function MinVersion: Byte; override;
procedure Modulo;
procedure Multiply;
procedure NewMethod;
procedure NewObject;
procedure NextFrame;
procedure Operation(op: string);
procedure Play;
procedure Pop;
procedure PreviousFrame;
function Push(const Args: array of Variant): TSWFActionPush; overload;
function Push(const Args: array of Variant; const Types: array of TSWFValueType): TSWFActionPush; overload;
function Push(Value: Variant): TSWFActionPush; overload;
procedure PushConstant(Value: word); overload;
procedure PushConstant(const Args: array of word); overload;
procedure PushDuplicate;
procedure PushRegister(const Args: array of Word); overload;
procedure PushRegister(Value: Word); overload;
procedure Random; overload;
procedure Random(max: dword); overload;
procedure Random(min, max: dword); overload;
procedure RandomNumber;
procedure RemoveSprite;
procedure Return;
procedure SetArray(const name: string; const Args: array of Variant; inSprite: boolean = false);
function SetMarker(M: TSWFOffsetMarker = nil; ToBack: boolean = false): TSWFOffsetMarker;
procedure SetMember;
procedure SetProperty; overload;
procedure SetProperty(targ: string; id: byte); overload;
procedure SetTarget(TargetName: string);
procedure SetTarget2;
procedure SetVar(VarName: string; Value: Variant; inSprite: boolean = false);
procedure SetVariable;
procedure StackSwap;
procedure StartDrag;
procedure Stop;
procedure StopSounds;
procedure StoreRegister(Num: byte);
procedure StrictEquals;
procedure StringAdd;
procedure StringEquals;
procedure StringExtract;
procedure StringGreater;
procedure StringLength;
procedure StringLess;
procedure Subtract;
procedure TargetPath;
procedure Throw;
procedure ToggleQuality;
procedure ToInteger;
procedure ToNumber;
procedure ToString;
procedure Trace;
procedure TypeOf;
procedure WaitForFrame(Frame: Word; SkipCount: Byte);
procedure WaitForFrame2;
procedure WriteToStream(be: TBitsEngine); override;
procedure _And;
function _If: TSWFActionIf;
procedure _Not;
procedure _Or;
function _Try: TSWFActionTry;
function _With: TSWFActionWith;
property Action[index: integer]: TSWFAction read GetAction;
property ActionList: TSWFActionList read FActionList;
property SelfDestroy: Boolean read FSelfDestroy write FSelfDestroy;
end;
TFlashVisualObject = class (TFlashIDObject)
private
FIgnoreMovieSettings: Boolean;
function GetMultCoord: Byte;
protected
fXCenter: LongInt;
fYCenter: LongInt;
public
procedure Assign(Source: TBasedSWFObject); override;
property IgnoreMovieSettings: Boolean read FIgnoreMovieSettings write FIgnoreMovieSettings;
property MultCoord: Byte read GetMultCoord;
end;
// ================= Shapes ==================================
TFlashEdges = class (TObject)
private
FCurrentPos: TPoint;
FIgnoreMovieSettings: Boolean;
FLastStart: TPoint;
ListEdges: TObjectList;
Owner: TFlashMovie;
FOptimizeMode: boolean;
function FindLastChangeStyle: TSWFStyleChangeRecord;
function GetMultCoord: Byte;
function hasAddMoveTo(DX, DY: integer): boolean;
public
constructor Create(List: TObjectList);
destructor Destroy; override;
function AddChangeStyle: TSWFStyleChangeRecord;
procedure CloseAllConturs;
procedure CloseShape;
procedure CopyFrom(Source: TFlashEdges);
function CurveDelta(ControlX, ControlY, AnchorX, AnchorY: longint): TSWFCurvedEdgeRecord;
function CurveTo(ControlX, ControlY, AnchorX, AnchorY: longint): TSWFCurvedEdgeRecord;
function EndEdges: TSWFEndShapeRecord;
function GetBoundsRect: TRect;
function isClockWise: boolean;
function LineDelta(DX, DY: longint): TSWFStraightEdgeRecord;
function LineTo(X, Y: longint): TSWFStraightEdgeRecord; overload;
function LineTo(P: TPoint): TSWFStraightEdgeRecord; overload;
procedure MakeArc(XC, YC: longInt; RadiusX, RadiusY: longint; StartAngle, EndAngle: single; closed: boolean = true; clockwise: boolean = true); overload;
procedure MakeArc(XC, YC: longInt; Radius: longint; StartAngle, EndAngle: single; closed: boolean = true); overload;
procedure MakeCubicBezier(P1, P2, P3: TPoint; parts: byte = 4);
procedure MakeDiamond(W, H: longint);
procedure MakeEllipse(W, H: longint);
procedure MakeMirror(Horz, Vert: boolean);
procedure MakePie(Radius: longint; StartAngle, EndAngle: single); overload;
procedure MakePie(RadiusX, RadiusY: longint; StartAngle, EndAngle: single; clockwise: boolean = true); overload;
procedure MakePolyBezier(AP: array of TPoint; Start: TPoint);
procedure MakePolyline(AP: array of TPoint);
procedure MakeRectangle(W, H: longint);
procedure MakeRoundRect(W, H, R: longint); overload;
procedure MakeRoundRect(W, H, RX, RY: longint); overload;
procedure MakeStar(X, Y, R1, R2: longint; NumPoint: word; curve: boolean = false);
function MoveDelta(X, Y: longint): TSWFStyleChangeRecord;
function MoveTo(X, Y: longint): TSWFStyleChangeRecord;
procedure OffsetEdges(DX, DY: LongInt; UseSysCoord: boolean = true);
function StartNewStyle: TSWFStyleChangeRecord; overload;
function StartNewStyle(MoveToX, MoveToY: longint): TSWFStyleChangeRecord; overload;
property CurrentPos: TPoint read FCurrentPos;
property IgnoreMovieSettings: Boolean read FIgnoreMovieSettings write FIgnoreMovieSettings;
property LastStart: TPoint read FLastStart;
property MultCoord: Byte read GetMultCoord;
property OptimizeMode: boolean read FOptimizeMode write FOptimizeMode;
end;
TFlashLineStyle = class (TObject)
private
Items: TList;
function GetCount: Byte;
function GetLen(Index: Integer): Byte;
procedure SetCount(Value: Byte);
procedure SetLen(Index: Integer; Value: Byte);
public
constructor Create;
destructor Destroy; override;
procedure SetStyle(A: array of byte);
property Count: Byte read GetCount write SetCount;
property Len[Index: Integer]: Byte read GetLen write SetLen; default;
end;
TFlashShape = class (TFlashVisualObject)
private
EdgesStore: TObjectList;
FBounds: TSWFRect;
FEdges: TFlashEdges;
FExtLineStyle: TFlashLineStyle;
FExtLineTransparent: boolean;
FFillStyleLeft: Word;
FFillStyleRight: Word;
FHasExtLineStyle: Boolean;
FillStyles: TObjectList;
FLineStyleNum: Word;
FLineBgColor: TSWFRGBA;
FStyleChangeMode: TStyleChangeMode;
hasAlpha: Boolean;
hasUseAdvancedStyles: boolean;
LineStyles: TObjectList;
function FindLastChangeStyle: TSWFStyleChangeRecord;
function GetCenterX: LongInt;
function GetCenterY: LongInt;
function GetExtLineStyle: TFlashLineStyle;
function GetLineBgColor: TSWFRGBA;
function GetHeight(inTwips: boolean = true): LongInt;
function GetWidth(inTwips: boolean = true): LongInt;
function GetXMax: Integer;
function GetXMin: Integer;
function GetYMax: Integer;
function GetYMin: Integer;
procedure SetCenterX(X: LongInt);
procedure SetCenterY(Y: LongInt);
procedure SetFillStyleLeft(n: Word);
procedure SetFillStyleRight(n: Word);
procedure SetLineStyleNum(n: Word);
procedure SetXMax(Value: Integer);
procedure SetXMin(Value: Integer);
procedure SetYMax(Value: Integer);
procedure SetYMin(Value: Integer);
protected
procedure ChangeOwner; override;
function GetListEdges: TObjectList;
public
constructor Create(owner: TFlashMovie);
destructor Destroy; override;
function AddFillStyle(fill: TSWFFillStyle): TSWFFillStyle;
function AddLineStyle(outline: TSWFLineStyle = nil): TSWFLineStyle;
function AddChangeStyle: TSWFStyleChangeRecord;
procedure Assign(Source: TBasedSWFObject); override;
procedure CalcBounds;
procedure MakeMirror(Horz, Vert: boolean);
function MinVersion: Byte; override;
function SetImageFill(img: TFlashImage; mode: TFillImageMode; ScaleX: single = 1; ScaleY: single = 1):
TSWFImageFill;
function SetLinearGradient(Gradient: array of recRGBA; angle: single = 0): TSWFGradientFill; overload;
function SetLinearGradient(Gradient: array of TSWFGradientRec; angle: single = 0): TSWFGradientFill; overload;
function SetLinearGradient(C1, C2: recRGBA; angle: single = 0): TSWFGradientFill; overload;
function SetLineStyle(width: word; c: recRGB): TSWFLineStyle; overload;
function SetLineStyle(width: word; c: recRGBA): TSWFLineStyle; overload;
function SetAdvancedLineStyle(width: word; c: recRGBA; CapStyle: byte = 0; JoinStyle: byte = 0): TSWFLineStyle2;
function SetRadialGradient(Gradient: array of recRGBA; Xc, Yc: byte): TSWFGradientFill; overload;
function SetRadialGradient(C1, C2: recRGBA; Xc, Yc: byte): TSWFGradientFill; overload;
function SetFocalGradient(Gradient: array of recRGBA; FocalPoint: single;
InterpolationMode: TSWFInterpolationMode; SpreadMode: TSWFSpreadMode): TSWFFocalGradientFill; overload;
function SetFocalGradient(Color1, Color2: recRGBA; FocalPoint: single;
InterpolationMode: TSWFInterpolationMode; SpreadMode: TSWFSpreadMode): TSWFGradientFill; overload;
procedure SetShapeBound(XMin, YMin, XMax, YMax: integer);
function SetSolidColor(r, g, b, a: byte): TSWFColorFill; overload;
function SetSolidColor(c: recRGB): TSWFColorFill; overload;
function SetSolidColor(c: recRGBA): TSWFColorFill; overload;
procedure WriteToStream(be: TBitsEngine); override;
property Bounds: TSWFRect read FBounds;
property Edges: TFlashEdges read FEdges;
property ExtLineStyle: TFlashLineStyle read GetExtLineStyle;
property ExtLineTransparent: boolean read FExtLineTransparent write FExtLineTransparent;
property FillStyleLeft: Word read FFillStyleLeft write SetFillStyleLeft;
property FillStyleNum: Word read FFillStyleRight write SetFillStyleRight;
property FillStyleRight: Word read FFillStyleRight write SetFillStyleRight;
property HasExtLineStyle: Boolean read FHasExtLineStyle write FHasExtLineStyle;
property LineStyleNum: Word read FLineStyleNum write SetLineStyleNum;
property LineBgColor: TSWFRGBA read GetLineBgColor;
property StyleChangeMode: TStyleChangeMode read FStyleChangeMode write FStyleChangeMode;
property XCenter: LongInt read GetCenterX write SetCenterX;
property XMax: Integer read GetXMax write SetXMax;
property XMin: Integer read GetXMin write SetXMin;
property YCenter: LongInt read GetCenterY write SetCenterY;
property YMax: Integer read GetYMax write SetYMax;
property YMin: Integer read GetYMin write SetYMin;
end;
TFlashMorphShape = class (TFlashVisualObject)
private
FEndEdges: TFlashEdges;
FFillStyleLeft: Word;
FLineStyleNum: Word;
fMorphShape: TSWFDefineMorphShape;
FStartEdges: TFlashEdges;
ListEdges: TObjectList;
function EndHeight: LongInt;
function EndWidth: LongInt;
function FindLastChangeStyle: TSWFStyleChangeRecord;
function GetCenterX: LongInt;
function GetCenterY: LongInt;
procedure SetCenterX(X: LongInt);
procedure SetCenterY(Y: LongInt);
procedure SetFillStyleLeft(n: Word);
procedure SetLineStyleNum(n: Word);
function StartHeight: LongInt;
function StartWidth: LongInt;
protected
hasUseAdvancedStyles: boolean;
procedure ChangeOwner; override;
procedure SetCharacterId(id: word); override;
public
constructor Create(owner: TFlashMovie);
destructor Destroy; override;
procedure AddFillStyle(fill: TSWFMorphFillStyle);
function AddLineStyle(outline: TSWFMorphLineStyle = nil): TSWFMorphLineStyle;
procedure Assign(Source: TBasedSWFObject); override;
function MinVersion: Byte; override;
procedure SetEndBound(XMin, YMin, XMax, YMax: integer);
function SetImageFill(img: TFlashImage; mode: TFillImageMode; StartScaleX: single = 1; StartScaleY: single = 1;
EndScaleX: single = 1; EndScaleY: single = 1): TSWFMorphImageFill;
function SetLinearGradient(StartGradient, EndGradient: array of recRGBA; StartAngle: single = 0; EndAngle: single = 0):
TSWFMorphGradientFill; overload;
function SetLinearGradient(Gradient: array of TSWFMorphGradientRec; StartAngle: single = 0; EndAngle: single = 0):
TSWFMorphGradientFill; overload;
function SetLinearGradient(StartC1, StartC2, EndC1, EndC2: recRGBA; StartAngle: single = 0; EndAngle: single = 0):
TSWFMorphGradientFill; overload;
function SetLineStyle(StartWidth, EndWidth: word; StartColor, EndColor: recRGBA): TSWFMorphLineStyle;
function SetAdvancedLineStyle(StartWidth, EndWidth: word; StartColor, EndColor: recRGBA;
StartCapStyle: byte = 0; EndCapStyle: byte = 0;
JoinStyle: byte = 0): TSWFMorphLineStyle2;
function SetRadialGradient(StartGradient, EndGradient: array of recRGBA; StartXc, StartYc, EndXc, EndYc: byte):
TSWFMorphGradientFill; overload;
function SetRadialGradient(StartC1, StartC2, EndC1, EndC2: recRGBA; StartXc, StartYc, EndXc, EndYc: byte):
TSWFMorphGradientFill; overload;
function SetSolidColor(StartC, EndC: recRGBA): TSWFMorphColorFill;
procedure SetStartBound(XMin, YMin, XMax, YMax: integer);
procedure WriteToStream(be: TBitsEngine); override;
property EndEdges: TFlashEdges read FEndEdges;
property FillStyleLeft: Word read FFillStyleLeft write SetFillStyleLeft;
property FillStyleNum: Word read FFillStyleLeft write SetFillStyleleft;
property LineStyleNum: Word read FLineStyleNum write SetLineStyleNum;
property StartEdges: TFlashEdges read FStartEdges;
property XCenter: LongInt read GetCenterX write SetCenterX;
property YCenter: LongInt read GetCenterY write SetCenterY;
end;
TFlashPlaceObject = class (TFlashObject)
private
tmpActionList: TSWFActionList;
fActions: TFlashActionScript;
FVisualObject: TFlashVisualObject;
PlaceObject: TSWFPlaceObject3;
function GetBevelFilter: TSWFBevelFilter;
function GetBlurFilter: TSWFBlurFilter;
function GetCharacterID: Word; virtual;
function GetClipDepth: Word;
function GetColorTransform: TSWFColorTransform;
function GetColorMatrixFilter: TSWFColorMatrixFilter;
function GetConvolutionFilter: TSWFConvolutionFilter;
function GetDepth: Word;
function GetGradientBevelFilter: TSWFGradientBevelFilter;
function GetGradientGlowFilter: TSWFGradientGlowFilter;
function GetGlowFilter: TSWFGlowFilter;
function GetMatrix: TSWFMatrix;
function GetName: string;
function GetRatio: Word;
function GetRemoveDepth: Boolean;
function GetShadowFilter: TSWFDropShadowFilter;
function GetTranslateX: LongInt;
function GetTranslateY: LongInt;
procedure SetCharacterID(Value: Word);
procedure SetClipDepth(Value: Word);
procedure SetDepth(Value: Word);
procedure SetName(n: string);
procedure SetRatio(Value: Word);
procedure SetRemoveDepth(v: Boolean);
procedure SetTranslateX(Value: LongInt);
procedure SetTranslateY(Value: LongInt);
function GetBlendMode: TSWFBlendMode;
procedure SetBlendMode(const Value: TSWFBlendMode);
function GetFilterList: TSWFFilterList;
function GetUseBitmapCaching: Boolean;
procedure SetUseBitmapCaching(const Value: Boolean);
public
constructor Create(owner: TFlashMovie; VObject: TFlashVisualObject; depth: word); virtual;
destructor Destroy; override;
procedure Assign(Source: TBasedSWFObject); override;
function AddActionEvent(FE: TSWFClipEvents): TSWFClipActionRecord;
{$IFDEF ASCompiler}
function CompileEvent(src: TStrings): boolean; overload;
function CompileEvent(src: TStream): boolean; overload;
function CompileEvent(src: string): boolean; overload;
function CompileEvent(FileName: string; unicode: boolean): boolean; overload;
{$ENDIF}
function FindActionEvent(FE: TSWFClipEvent; CreateNoExist: boolean = true): TSWFClipActionRecord;
procedure InitColorTransform(hasADD: boolean; addR, addG, addB, addA: Smallint; hasMULT: boolean; multR, multG, multB,
multA: Smallint; hasAlpha: boolean);
function FindFilter(fid: TSWFFilterID): TSWFFilter;
function MinVersion: Byte; override;
function OnClick: TFlashActionScript;
function OnConstruct: TFlashActionScript;
function OnData: TFlashActionScript;
function OnDragOut: TFlashActionScript;
function OnDragOver: TFlashActionScript;
function OnEnterFrame: TFlashActionScript;
function OnInitialize: TFlashActionScript;
function OnKeyDown: TFlashActionScript;
function OnKeyPress(Key: byte = 0): TFlashActionScript;
function OnKeyUp: TFlashActionScript;
function OnLoad: TFlashActionScript;
function OnMouseDown: TFlashActionScript;
function OnMouseMove: TFlashActionScript;
function OnMouseUp: TFlashActionScript;
function OnPress: TFlashActionScript;
function OnRelease: TFlashActionScript;
function OnReleaseOutside: TFlashActionScript;
function OnRollOut: TFlashActionScript;
function OnRollOver: TFlashActionScript;
function OnUnload: TFlashActionScript;
procedure SetPosition(X, Y: longint);
procedure SetRotate(angle: single);
procedure SetScale(ScaleX, ScaleY: single);
procedure SetSkew(SkewX, SkewY: single);
procedure SetTranslate(X, Y: longint);
procedure WriteToStream(be: TBitsEngine); override;
property AdjustColor: TSWFColorMatrixFilter read GetColorMatrixFilter;
property Bevel: TSWFBevelFilter read GetBevelFilter;
property BlendMode: TSWFBlendMode read GetBlendMode write SetBlendMode;
property Blur: TSWFBlurFilter read GetBlurFilter;
property CharacterID: Word read GetCharacterID write SetCharacterID;
property ClipDepth: Word read GetClipDepth write SetClipDepth;
property ColorTransform: TSWFColorTransform read GetColorTransform;
property ColorMatrix: TSWFColorMatrixFilter read GetColorMatrixFilter;
property Convolution: TSWFConvolutionFilter read GetConvolutionFilter;
property Depth: Word read GetDepth write SetDepth;
property FilterList: TSWFFilterList read GetFilterList;
property GradientBevel: TSWFGradientBevelFilter read GetGradientBevelFilter;
property GradientGlow: TSWFGradientGlowFilter read GetGradientGlowFilter;
property Glow: TSWFGlowFilter read GetGlowFilter;
property Matrix: TSWFMatrix read GetMatrix;
property Name: string read GetName write SetName;
property Ratio: Word read GetRatio write SetRatio;
property RemoveDepth: Boolean read GetRemoveDepth write SetRemoveDepth;
property Shadow: TSWFDropShadowFilter read GetShadowFilter;
property TranslateX: LongInt read GetTranslateX write SetTranslateX;
property TranslateY: LongInt read GetTranslateY write SetTranslateY;
property UseBitmapCaching: Boolean read GetUseBitmapCaching write
SetUseBitmapCaching;
property VisualObject: TFlashVisualObject read FVisualObject write FVisualObject;
end;
TFlashPlaceVideo = class;
// =================== TFlashVideo ========================
TWriteFrameInfo = record
Frame: Word;
ID: Word;
Depth: Word;
end;
TWriteFrame = procedure (be:TBitsEngine; P: TWriteFrameInfo) of object;
TPlaceFrame = procedure (be:TBitsEngine; P: TWriteFrameInfo; Ob: TFlashPlaceObject) of object;
TVideoHeader = record
Signature: array [0..2] of byte;
Version: Byte;
TypeFlag: Byte;
CodecInfo: Byte;
DataOffset: LongInt;
XDim: LongInt;
YDim: LongInt;
Frames: LongInt;
end;
TFlashVideo = class (TFlashVisualObject)
private
FFLV: TFLVData;
FPlaceFrame: TPlaceFrame;
FWriteFrame: TWriteFrame;
function GetHeight: Word;
function GetWidth: Word;
protected
procedure WriteFrame(sender: TSWFObject; BE: TBitsEngine);
public
constructor Create(owner: TFlashMovie; FileName: string); overload;
constructor Create(owner: TFlashMovie; Source: TStream); overload;
destructor Destroy; override;
procedure Assign(Source: TBasedSWFObject); override;
function MinVersion: Byte; override;
procedure WriteToStream(be: TBitsEngine); override;
property FLV: TFLVData read FFLV;
property Height: Word read GetHeight;
property OnPlaceFrame: TPlaceFrame read FPlaceFrame write FPlaceFrame;
property OnWriteFrame: TWriteFrame read FWriteFrame write FWriteFrame;
property Width: Word read GetWidth;
end;
// ============= TFlashSprite ======================
TFlashSprite = class (TFlashVisualObject)
private
FBackgroundSound: TFlashSound;
FCurrentFrameNum: Integer;
FEnableBGSound: Boolean;
FFrameActions: TFlashActionScript;
FFrameLabel: string;
FInitActions: TFlashActionScript;
FMaxDepth: word;
FSprite: TSWFDefineSprite;
FVideoList: TObjectList;
function GetBackgrondSound: TFlashSound;
function GetFrameActions: TFlashActionScript;
function GetFrameCount: Word;
function GetInitActions: TFlashActionScript;
function GetObjectList: TObjectList;
function GetVideoList(Index: Integer): TFlashPlaceVideo;
function GetVideoListCount: Integer;
procedure SetCurrentFrameNum(Value: Integer);
procedure SetFrameCount(Value: Word);
protected
CurrentFramePosIndex: LongInt;
procedure AddFlashObject(Obj: TBasedSWFObject);
procedure SetCharacterId(id: word); override;
public
constructor Create(owner: TFlashMovie); virtual;
destructor Destroy; override;
procedure Assign(Source: TBasedSWFObject); override;
function MinVersion: Byte; override;
function PlaceMorphShape(MS: TFlashMorphShape; Depth, NumFrame: word): TFlashPlaceObject;
function PlaceObject(shape: TFlashVisualObject; depth: word): TFlashPlaceObject; overload;
function PlaceObject(shape, mask: TFlashVisualObject; depth: word): TFlashPlaceObject; overload;
function PlaceObject(depth: word): TFlashPlaceObject; overload;
function PlaceVideo(F: TFlashVideo; depth: word): TFlashPlaceVideo;
procedure RemoveObject(depth: word; shape: TFlashVisualObject = nil);
procedure ShowFrame(c: word = 1);
function StartSound(snd: TFlashSound): TSWFStartSound; overload;
function StartSound(ID: word): TSWFStartSound; overload;
procedure StoreFrameActions;
procedure WriteToStream(be: TBitsEngine); override;
property BackgroundSound: TFlashSound read GetBackgrondSound;
property CurrentFrameNum: Integer read FCurrentFrameNum write SetCurrentFrameNum;
property EnableBGSound: Boolean read FEnableBGSound write FEnableBGSound;
property FrameActions: TFlashActionScript read GetFrameActions;
property FrameCount: Word read GetFrameCount write SetFrameCount;
property FrameLabel: string read FFrameLabel write FFrameLabel;
property InitActions: TFlashActionScript read GetInitActions;
property ObjectList: TObjectList read GetObjectList;
property Sprite: TSWFDefineSprite read FSprite;
property MaxDepth: word read FMaxDepth;
property VideoList[Index: Integer]: TFlashPlaceVideo read GetVideoList;
property VideoListCount: Integer read GetVideoListCount;
end;
TFlashMovieClip = TFlashSprite;
TFlashPlaceVideo = class (TFlashPlaceObject)
private
FAutoReplay: Boolean;
FEnableSound: Boolean;
FPlaceFrame: TPlaceFrame;
FSpriteParent: TFlashSprite;
FStartFrame: Word;
FWriteFrame: TWriteFrame;
SndBitRate: LongWord;
SndCount: LongWord;
SndLatency: Word;
SndSampleCount: LongWord;
SndSeekSample: LongWord;
function GetCharacterID: Word; override;
function GetVideo: TFlashVideo;
procedure SetEnableSound(Value: Boolean);
public
constructor Create(owner: TFlashMovie; video: TFlashVisualObject; depth: word); override;
destructor Destroy; override;
procedure Assign(Source: TBasedSWFObject); override;
function MinVersion: Byte; override;
procedure WriteToStream(be: TBitsEngine; Frame:Word);
property AutoReplay: Boolean read FAutoReplay write FAutoReplay;
property CharacterID: Word read GetCharacterID;
property EnableSound: Boolean read FEnableSound write SetEnableSound;
property OnPlaceFrame: TPlaceFrame read FPlaceFrame write FPlaceFrame;
property OnWriteFrame: TWriteFrame read FWriteFrame write FWriteFrame;
property SpriteParent: TFlashSprite read FSpriteParent write FSpriteParent;
property StartFrame: Word read FStartFrame write FStartFrame;
property Video: TFlashVideo read GetVideo;
end;
// ================= Text =========================
TFlashChar = class (TObject)
private
FCode: Word;
FEdges: TFlashEdges;
FGlyphAdvance: Integer;
FIsUsed: boolean;
FKerning: TSWFKerningRecord;
FListEdges: TObjectList;
FShapeInit: Boolean;
FWide: Boolean;
FWideCode: Word;
function GetIsWide: Boolean;
procedure SetCode(W: Word);
public
constructor Create(code: word; wide: boolean);
destructor Destroy; override;
procedure Assign(Source: TObject);
property Code: Word read FCode write SetCode;
property Edges: TFlashEdges read FEdges;
property GlyphAdvance: Integer read FGlyphAdvance write FGlyphAdvance;
property IsUsed: boolean read FIsUsed write FIsUsed;
property isWide: Boolean read FWide;
property Kerning: TSWFKerningRecord read FKerning write FKerning;
property ListEdges: TObjectList read FListEdges;
property ShapeInit: Boolean read FShapeInit write FShapeInit;
property WideCode: Word read FWideCode;
end;
TFontUsing = set of (fuStaticText, fuDynamicText);
TFlashFont = class (TFlashIDObject)
private
FAscent: Word;
FAsDevice: Boolean;
FBold: Boolean;
FCharList: TObjectList;
FDescent: Word;
FEncodingType: Byte;
FFontCharset: Byte;
FFontInfo: TLogFont;
FHasLayout: Boolean;
FIncludeKerning: Boolean;
FItalic: Boolean;
FLanguageCode: Byte;
FLeading: Word;
FName: string;
FSize: Word;
FSmallText: Boolean;
FUsing: TFontUsing;
FWideCodes: Boolean;
function GetAntiAlias: Boolean;
function GetCharInfo(Code: Integer): TFlashChar;
function GetCharInfoInd(Index: Integer): TFlashChar;
function GetCharList: TObjectList;
function GetSize: word;
function GetWideCodes: Boolean;
procedure SetAntiAlias(Value: Boolean);
procedure SetFontCharset(Value: Byte);
procedure SetFontInfo(Info: TLogFont);
procedure SetHasLayout(v: Boolean);
procedure SetSize(value: word);
public
constructor Create(owner: TFlashMovie); overload;
constructor Create(owner: TFlashMovie; asDevice: boolean; Name: string; bold, italic: boolean; size: word); overload;
destructor Destroy; override;
procedure AddChars(s: ansistring); overload;
procedure AddChars(chset: TCharSets); overload;
{$IFNDEF VER130}
procedure AddChars(s: WideString); overload;
{$ENDIF}
procedure AddChars(min, max: word); overload;
procedure AddCharsW(s: WideString);
function AddEmpty(Ch: word): Boolean;
procedure Assign(Source: TBasedSWFObject); override;
function CalcMetric(V: longint): LongInt;
procedure FillCharsInfo;
function GetTextExtentPoint(s: string): TSize; overload;
{$IFNDEF VER130}
function GetTextExtentPoint(s: WideString): TSize; overload;
{$ENDIF}
function GetTextExtentPointW(s: WideString): TSize;
procedure LoadFromSWFObject(Src: TSWFDefineFont2);
procedure LoadFromSWFFile(FileName: string);
procedure LoadFromSWFStream(src: TStream);
function MinVersion: Byte; override;
procedure WriteToStream(be: TBitsEngine); override;
property AntiAlias: Boolean read GetAntiAlias write SetAntiAlias;
property Ascent: Word read FAscent write FAscent;
property AsDevice: Boolean read FAsDevice write FAsDevice;
property Bold: Boolean read FBold write FBold;
property CharInfo[Code: Integer]: TFlashChar read GetCharInfo;
property CharInfoInd[Index: Integer]: TFlashChar read GetCharInfoInd;
property CharList: TObjectList read GetCharList;
property Descent: Word read FDescent write FDescent;
property EncodingType: Byte read FEncodingType write FEncodingType;
property FontCharset: Byte read FFontCharset write SetFontCharset;
property FontInfo: TLogFont read FFontInfo write SetFontInfo;
property FontUsing: TFontUsing read FUsing write FUsing;
property IncludeKerning: Boolean read FIncludeKerning write FIncludeKerning;
property Italic: Boolean read FItalic write FItalic;
property LanguageCode: Byte read FLanguageCode write FLanguageCode;
property Layout: Boolean read FHasLayout write SetHasLayout;
property Leading: Word read FLeading write FLeading;
property Name: string read FName write FName;
property Size: Word read GetSize write SetSize;
property SmallText: Boolean read FSmallText write FSmallText;
property WideCodes: Boolean read GetWideCodes;
end;
TFlashCustomData = class (TFlashObject)
private
FData: TMemoryStream;
FTagID: Integer;
FWriteHeader: Boolean;
public
constructor Create(owner: TFlashMovie; FileName:string = ''); overload;
constructor Create(owner: TFlashMovie; S: TStream; Size: longint = 0); overload;
destructor Destroy; override;
procedure Assign(Source: TBasedSWFObject); override;
function MinVersion: Byte; override;
procedure WriteToStream(be: TBitsEngine); override;
property Data: TMemoryStream read FData;
property TagID: Integer read FTagID write FTagID;
property WriteHeader: Boolean read FWriteHeader write FWriteHeader;
end;
// ******************* TFlashText ***********************
TFlashText = class (TFlashVisualObject)
private
FAlign: TSWFTextAlign;
FAutoSize: Boolean;
FBorder: Boolean;
FBounds: TSWFRect;
FCharSpacing: Integer;
FColor: TSWFRGBA;
FDynamicText: Boolean;
FFont: TFlashFont;
FHasLayout: Boolean;
FHTML: Boolean;
FIndent: Integer;
FLeading: Integer;
FLeftMargin: Integer;
FMatrix: TSWFMatrix;
FMaxLength: Integer;
FMultiline: Boolean;
FNoSelect: Boolean;
FPassword: Boolean;
FPtAnchor: TPoint;
FReadOnly: Boolean;
FRightMargin: Integer;
FText: AnsiString;
FTextHeight: Word;
FUseOutlines: Boolean;
FVarName: AnsiString;
FWideText: WideString;
FWordWrap: Boolean;
HasColor: Boolean;
HasMaxLen: Boolean;
InitAsPoint: Boolean;
function GetCharSpacing: Integer;
function GetColor: TSWFRGBA;
function GetDynamicText: Boolean;
function GetIndent: Integer;
function GetLeading: Integer;
function GetLeftMargin: Integer;
function GetMatrix: TSWFMatrix;
function GetRightMargin: Integer;
function GetTextHeight: Word;
procedure InitVar(s: string); overload;
{$IFNDEF VER130}
procedure InitVar(S: WideString); overload;
{$ENDIF}
procedure InitVarW(S: WideString);
procedure SetAlign(Value: TSWFTextAlign);
procedure SetCharSpacing(Value: Integer);
procedure SetDynamicText(Value: Boolean);
procedure SetFont(F: TFlashFont);
procedure SetHasLayout(Value: Boolean);
procedure SetHTML(Value: Boolean);
procedure SetIndent(Value: Integer);
procedure SetLeading(Value: Integer);
procedure SetLeftMargin(Value: Integer);
procedure SetMaxLength(Value: Integer);
procedure SetRightMargin(Value: Integer);
procedure SetText(Value: AnsiString);
procedure SetTextHeight(Value: Word);
procedure SetUseOutlines(Value: Boolean);
procedure SetWideText(Value: WideString);
protected
procedure SetBounds(R: TRect);
property HasLayout: Boolean read FHasLayout write SetHasLayout;
public
constructor Create(owner: TFlashMovie; s: ansistring); overload;
constructor Create(owner: TFlashMovie; s: ansistring; c: recRGBA; f: TFlashFont; P: TPoint; Align: byte); overload;
constructor Create(owner: TFlashMovie; s: ansistring; c: recRGBA; f: TFlashFont; R: TRect); overload;
{$IFNDEF VER130}
constructor Create(owner: TFlashMovie; s: WideString; c: recRGBA; f: TFlashFont; P: TPoint; Align: byte); overload;
constructor Create(owner: TFlashMovie; s: WideString; c: recRGBA; f: TFlashFont; R: TRect); overload;
{$ENDIF}
constructor CreateW(owner: TFlashMovie; s: WideString; c: recRGBA; f: TFlashFont; P: TPoint; Align: byte); overload;
constructor CreateW(owner: TFlashMovie; s: WideString; c: recRGBA; f: TFlashFont; R: TRect); overload;
destructor Destroy; override;
procedure Assign(Source: TBasedSWFObject); override;
function GetTextExtentPoint: TSize;
function MinVersion: Byte; override;
procedure WriteToStream(be: TBitsEngine); override;
property Align: TSWFTextAlign read FAlign write SetAlign;
property AutoSize: Boolean read FAutoSize write FAutoSize;
property Border: Boolean read FBorder write FBorder;
property Bounds: TSWFRect read FBounds;
property CharSpacing: Integer read GetCharSpacing write SetCharSpacing;
property Color: TSWFRGBA read GetColor;
property DynamicText: Boolean read GetDynamicText write SetDynamicText;
property Font: TFlashFont read FFont write SetFont;
property HTML: Boolean read FHTML write SetHTML;
property Indent: Integer read GetIndent write SetIndent;
property Leading: Integer read GetLeading write SetLeading;
property LeftMargin: Integer read GetLeftMargin write SetLeftMargin;
property Matrix: TSWFMatrix read GetMatrix;
property MaxLength: Integer read FMaxLength write SetMaxLength;
property Multiline: Boolean read FMultiline write FMultiline;
property NoSelect: Boolean read FNoSelect write FNoSelect;
property Password: Boolean read FPassword write FPassword;
property ReadOnly: Boolean read FReadOnly write FReadOnly;
property RightMargin: Integer read GetRightMargin write SetRightMargin;
property Text: AnsiString read FText write SetText;
property TextHeight: Word read GetTextHeight write SetTextHeight;
property UseOutlines: Boolean read FUseOutlines write SetUseOutlines;
property VarName: AnsiString read FVarName write FVarName;
property WideText: WideString read FWideText write SetWideText;
property WordWrap: Boolean read FWordWrap write FWordWrap;
end;
//================== TFlashButton =======================
TFlashButtonEvent = (beRollOver, beRollOut, bePress, beRelease,
beDragOver, beDragOut, beReleaseOutside, beMenuDragOver, beMenuDragOut);
TFlashButtonEvents = set of TFlashButtonEvent;
TFlashButton = class (TFlashVisualObject)
private
advMode: Boolean;
fButton: TSWFBasedButton;
fButtonSound: TSWFDefineButtonSound;
fFlashActionList: TFlashActionScript;
function GetButton: TSWFDefineButton;
function GetButton2: TSWFDefineButton2;
protected
procedure SetCharacterId(v: word); override;
public
constructor Create(owner: TFlashMovie; hasmenu: boolean = false; advMode: boolean = true);
destructor Destroy; override;
function Actions: TFlashActionScript;
function AddCondAction(FE: TFlashButtonEvents): TSWFButtonCondAction;
function AddRecord(Shape: TFlashVisualObject; BS: TSWFButtonStates; depth: word = 1): TSWFButtonRecord; overload;
function AddRecord(Sprite: TFlashSprite; BS: TSWFButtonStates; depth: word = 1): TSWFButtonRecord; overload;
function AddRecord(ID: Word; BS: TSWFButtonStates; depth: word = 1): TSWFButtonRecord; overload;
procedure Assign(Source: TBasedSWFObject); override;
{$IFDEF ASCompiler}
function CompileEvent(src: TStrings): boolean; overload;
function CompileEvent(src: TStream): boolean; overload;
function CompileEvent(src: string): boolean; overload;
function CompileEvent(FileName: string; unicode: boolean): boolean; overload;
{$ENDIF}
function FindActionEvent(FE: TFlashButtonEvent; CreateNoExist: boolean = true): TSWFActionList;
function MinVersion: Byte; override;
function OnClickActions: TFlashActionScript;
function OnDragOutActions: TFlashActionScript;
function OnDragOverActions: TFlashActionScript;
function OnMenuDragOutActions: TFlashActionScript;
function OnMenuDragOverActions: TFlashActionScript;
function OnPressActions: TFlashActionScript;
function OnReleaseActions: TFlashActionScript;
function OnReleaseOutsideActions: TFlashActionScript;
function OnRollOutActions: TFlashActionScript;
function OnRollOverActions: TFlashActionScript;
function SndPress: TSWFStartSound;
function SndRelease: TSWFStartSound;
function SndRollOut: TSWFStartSound;
function SndRollOver: TSWFStartSound;
procedure WriteToStream(be: TBitsEngine); override;
end;
TFlashCanvas = class;
TSpriteManagerType = (csDefault, csMetaFile, csClipp, csWorldTransform, csPath, csText, csDC);
TGDIDrawMode = (dmNormal, dmPath);
// ---------------- TMetaFont ----------------------
// TMetaFont = class (TObject)
// protected
// FFlashFont: TFlashFont;
// FFMFont: TFont;
// FFontPresent: Boolean;
// FInfo: TExtLogFontW;
// FMColor: recRGBA;
// FTextMetric: TTextMetricW;
// public
// procedure GetMetrixFont;
// procedure ReadFontParam(Ft: TLogFontW);
// procedure WriteFontParam(Ft: TFlashFont);
// property FlashFont: TFlashFont read FFlashFont write FFlashFont;
// property FMFont: TFont read FFMFont write FFMFont;
// property FontPresent: Boolean write FFontPresent;
// property Info: TExtLogFontW read FInfo write FInfo;
// end;
// ================ Flash CANVAS ===================
TFSpriteCanvas = class (TFlashSprite)
private
FType: TSpriteManagerType;
FParent: TFSpriteCanvas;
FXForm: XForm;
PlaceParam: TFlashPlaceObject;
public
constructor Create(owner: TFlashMovie); override;
property Parent: TFSpriteCanvas read FParent write FParent;
end;
TRenderOptions = set of (roUseBuffer, roHiQualityBuffer, roOptimization);
TFlashCanvas = class(TCanvas)
private
BeginPath: TPoint;
BgColor: COLORREF;
// BkColor,
TextColor: COLORREF;
FTextMetricSize: integer;
FTextMetric: POutlineTextmetricW;
FontScale: single;
LogFontInfo: TLogFont;
PrevFont: TFlashFont;
ClockWs: Boolean;
// CurDepth: Word;
CurrentRec: DWord;
PreviusBrush,
CurrentBrush: longint;
CurrentFont: longint;
CurrentPen: longint;// TCurrentPen;
CurShape: Word;
FCWorldTransform: TXForm;
HasWorldTransform: boolean;
DPI: Word;
isEMFPlus: boolean;
FEmbeddedFont: Boolean;
// FMetaFont: TMetaFont;
FOwner: TFlashMovie;
FTextJustification: TPoint;
HTables: TObjectList;
// LastBgColor: COLORREF;
// LastBrStyle: Cardinal;
LastCommand: Cardinal;
LastMoveToXY: TPoint;
// MainSprite: TFlashSprite;
// MetaEnableFlag: Byte;
MetaHandle: THandle;
PolyFillMode: byte;
PrivateTransform: TXForm;
SetIgnoreMovieSettingsFlag: Boolean;
ShapeLineTo, Sh: TFlashShape;
FRootSprite: TFlashSprite;
FActiveSprite: TFSpriteCanvas;
MetafileSprite: TFSpriteCanvas;
MustCreateWorldTransform: boolean;
pathConturCount: integer;
pathShape: TFlashShape;
IsUsesPathShape: boolean;
ClippSprite: TFSpriteCanvas;
ClipperSprite: TFlashSprite;
ClippedSprite: TFSpriteCanvas;
// ClipperShape: TFlashShape;
TextAlign: DWord;
// TextBKMode: Cardinal;
BgTransparent: boolean;
RootScaleX, RootScaleY: Double;
ViewportExt: TRect;
WindowExt: TRect;
hasInitViewportOrg,
hasInitViewport: boolean;
hasInitWindowOrg,
hasInitWindow: boolean;
MapMode: integer;
// GlobalOffset: TPoint;
BufferBMP: TBMPReader;
LastEMFR: PEnhMetaRecord;
DrawMode: TGDIDrawMode;
MetafileRect: TRect;
FRenderOptions: TRenderOptions;
UseBMPRender: boolean;
StretchedBMPRender: boolean;
EnableTransparentFill: boolean;
ListMFRecords: TObjectList;
function GetActiveSprite: TFSpriteCanvas;
function AddActiveSprite(ftype: TSpriteManagerType): TFSpriteCanvas;
procedure CloseActiveSprite;
function GetPathShape: TFlashShape;
protected
procedure MakeTextOut(WText: WideString; Point0: TPoint; Bounds, ClippRect:
TRect; TextWidth: Integer; fOptions: word; PAWidth: Pointer; WCount:
integer; iGraphicsMode: DWord);
function PlaceROP(BMP: TBMPReader; Bounds: TRect; ROP: DWord; Color: Cardinal): TFlashPlaceObject;
function GetFlashROP(ROP: DWord): TSWFBlendMode;
function GetCopyFromRender(R: TRect): TBMPReader;
function GetImageFromRender(R: TRect): TFlashImage;
procedure DoHEADER(EMFR: PEnhMetaHeader);
procedure DoPOLYBEZIER(EMFR: PEMRPOLYBEZIER);
procedure DoPOLYGON(EMFR: PEMRPOLYGON);
procedure DoPOLYLINE(EMFR: PEMRPOLYLINE);
procedure DoPOLYBEZIERTO(EMFR: PEMRPOLYBEZIERTO);
procedure DoPOLYLINETO(EMFR: PEMRPOLYLINETO);
procedure DoPOLYPOLYLINE(EMFR: PEMRPOLYPOLYLINE);
procedure DoPOLYPOLYGON(EMFR: PEMRPOLYPOLYGON);
procedure DoSETWINDOWEXTEX(EMFR: PEMRSETWINDOWEXTEX);
procedure DoSETWINDOWORGEX(EMFR: PEMRSETWINDOWORGEX);
procedure DoSETVIEWPORTEXTEX(EMFR: PEMRSETVIEWPORTEXTEX);
procedure DoSETVIEWPORTORGEX(EMFR: PEMRSETVIEWPORTORGEX);
procedure DoSETBRUSHORGEX(EMFR: PEMRSETBRUSHORGEX);
procedure DoEOF(EMFR: PEMREOF);
procedure DoSETPIXELV(EMFR: PEMRSETPIXELV);
procedure DoSETMAPPERFLAGS(EMFR: PEMRSETMAPPERFLAGS);
procedure DoSETMAPMODE(EMFR: PEMRSETMAPMODE);
procedure DoSETBKMODE(EMFR: PEMRSETBKMODE);
procedure DoSETPOLYFILLMODE(EMFR: PEMRSETPOLYFILLMODE);
procedure DoSETROP2(EMFR: PEMRSETROP2);
procedure DoSETSTRETCHBLTMODE(EMFR: PEMRSETSTRETCHBLTMODE);
procedure DoSETTEXTALIGN(EMFR: PEMRSETTEXTALIGN);
procedure DoSETCOLORADJUSTMENT(EMFR: PEMRSETCOLORADJUSTMENT);
procedure DoSETTEXTCOLOR(EMFR: PEMRSETTEXTCOLOR);
procedure DoSETBKCOLOR(EMFR: PEMRSETBKCOLOR);
procedure DoOFFSETCLIPRGN(EMFR: PEMROFFSETCLIPRGN);
procedure DoMOVETOEX(EMFR: PEMRMOVETOEX);
procedure DoSETMETARGN(EMFR: PEMRSETMETARGN);
procedure DoEXCLUDECLIPRECT(EMFR: PEMREXCLUDECLIPRECT);
procedure DoINTERSECTCLIPRECT(EMFR: PEMRINTERSECTCLIPRECT);
procedure DoSCALEVIEWPORTEXTEX(EMFR: PEMRSCALEVIEWPORTEXTEX);
procedure DoSCALEWINDOWEXTEX(EMFR: PEMRSCALEWINDOWEXTEX);
procedure DoSAVEDC(EMFR: PEMRSAVEDC);
procedure DoRESTOREDC(EMFR: PEMRRESTOREDC);
procedure DoSETWORLDTRANSFORM(EMFR: PEMRSETWORLDTRANSFORM);
procedure DoMODIFYWORLDTRANSFORM(EMFR: PEMRMODIFYWORLDTRANSFORM);
procedure DoSELECTOBJECT(EMFR: PEMRSELECTOBJECT);
procedure DoCREATEPEN(EMFR: PEMRCREATEPEN);
procedure DoCREATEBRUSHINDIRECT(EMFR: PEMRCREATEBRUSHINDIRECT);
procedure DoDELETEOBJECT(EMFR: PEMRDELETEOBJECT);
procedure DoANGLEARC(EMFR: PEMRANGLEARC);
procedure DoELLIPSE(EMFR: PEMRELLIPSE);
procedure DoRECTANGLE(EMFR: PEMRRECTANGLE);
procedure DoROUNDRECT(EMFR: PEMRROUNDRECT);
procedure DoARC(EMFR: PEMRARC);
procedure DoCHORD(EMFR: PEMRCHORD);
procedure DoPIE(EMFR: PEMRPIE);
procedure DoSELECTPALETTE(EMFR: PEMRSELECTPALETTE);
procedure DoCREATEPALETTE(EMFR: PEMRCREATEPALETTE);
procedure DoSETPALETTEENTRIES(EMFR: PEMRSETPALETTEENTRIES);
procedure DoRESIZEPALETTE(EMFR: PEMRRESIZEPALETTE);
procedure DoREALIZEPALETTE(EMFR: PEMRREALIZEPALETTE);
procedure DoEXTFLOODFILL(EMFR: PEMREXTFLOODFILL);
procedure DoLINETO(EMFR: PEMRLINETO);
procedure DoARCTO(EMFR: PEMRARCTO);
procedure DoPOLYDRAW(EMFR: PEMRPOLYDRAW);
procedure DoSETARCDIRECTION(EMFR: PEMRSETARCDIRECTION);
procedure DoSETMITERLIMIT(EMFR: PEMRSETMITERLIMIT);
procedure DoBEGINPATH(EMFR: PEMRBEGINPATH);
procedure DoENDPATH(EMFR: PEMRENDPATH);
procedure DoCLOSEFIGURE(EMFR: PEMRCLOSEFIGURE);
procedure DoFILLPATH(EMFR: PEMRFILLPATH);
procedure DoSTROKEANDFILLPATH(EMFR: PEMRSTROKEANDFILLPATH);
procedure DoSTROKEPATH(EMFR: PEMRSTROKEPATH);
procedure DoFLATTENPATH(EMFR: PEMRFLATTENPATH);
procedure DoWIDENPATH(EMFR: PEMRWIDENPATH);
procedure DoSELECTCLIPPATH(EMFR: PEMRSELECTCLIPPATH);
procedure DoABORTPATH(EMFR: PEMRABORTPATH);
procedure DoGDICOMMENT(EMFR: PEMRGDICOMMENT);
procedure DoFILLRGN(EMFR: PEMRFILLRGN);
procedure DoFRAMERGN(EMFR: PEMRFRAMERGN);
procedure DoINVERTRGN(EMFR: PEMRINVERTRGN);
procedure DoPAINTRGN(EMFR: PEMRPAINTRGN);
procedure DoEXTSELECTCLIPRGN(EMFR: PEMREXTSELECTCLIPRGN);
procedure DoBITBLT(EMFR: PEMRBITBLT);
procedure DoSTRETCHBLT(EMFR: PEMRSTRETCHBLT);
procedure DoMASKBLT(EMFR: PEMRMASKBLT);
procedure DoPLGBLT(EMFR: PEMRPLGBLT);
procedure DoSETDIBITSTODEVICE(EMFR: PEMRSETDIBITSTODEVICE);
procedure DoSTRETCHDIBITS(EMFR: PEMRSTRETCHDIBITS);
procedure DoEXTCREATEFONTINDIRECTW(EMFR: PEMREXTCREATEFONTINDIRECT);
procedure DoEXTTEXTOUTA(EMFR: PEMREXTTEXTOUT);
procedure DoEXTTEXTOUTW(EMFR: PEMREXTTEXTOUT);
procedure DoPOLYBEZIER16(EMFR: PEMRPOLYBEZIER16);
procedure DoPOLYGON16(EMFR: PEMRPOLYGON16);
procedure DoPOLYLINE16(EMFR: PEMRPOLYLINE16);
procedure DoPOLYBEZIERTO16(EMFR: PEMRPOLYBEZIERTO16);
procedure DoPOLYLINETO16(EMFR: PEMRPOLYLINETO16);
procedure DoPOLYPOLYLINE16(EMFR: PEMRPOLYPOLYLINE16);
procedure DoPOLYPOLYGON16(EMFR: PEMRPOLYPOLYGON16);
procedure DoPOLYDRAW16(EMFR: PEMRPOLYDRAW16);
procedure DoCREATEMONOBRUSH(EMFR: PEMRCREATEMONOBRUSH);
procedure DoCREATEDIBPATTERNBRUSHPT(EMFR: PEMRCREATEDIBPATTERNBRUSHPT);
procedure DoEXTCREATEPEN(EMFR: PEMREXTCREATEPEN);
procedure DoPOLYTEXTOUTA(EMFR: PEMRPOLYTEXTOUT);
procedure DoPOLYTEXTOUTW(EMFR: PEMRPOLYTEXTOUT);
procedure DoSETICMMODE(EMFR: PEMRSETICMMODE);
procedure DoCREATECOLORSPACE(EMFR: PEMRSelectColorSpace);
procedure DoSETCOLORSPACE(EMFR: PEMRSelectColorSpace);
procedure DoDELETECOLORSPACE(EMFR: PEMRDELETECOLORSPACE);
procedure DoGLSRECORD(EMFR: PEMRGLSRECORD);
procedure DoGLSBOUNDEDRECORD(EMFR: PEMRGLSBOUNDEDRECORD);
procedure DoPIXELFORMAT(EMFR: PEMRPIXELFORMAT);
procedure DoDRAWESCAPE(EMFR: PEnhMetaRecord);
procedure DoEXTESCAPE(EMFR: PEnhMetaRecord);
procedure DoSTARTDOC(EMFR: PEnhMetaRecord);
procedure DoSMALLTEXTOUT(EMFR: PEnhMetaRecord);
procedure DoFORCEUFIMAPPING(EMFR: PEnhMetaRecord);
procedure DoNAMEDESCAPE(EMFR: PEnhMetaRecord);
procedure DoCOLORCORRECTPALETTE(EMFR: PEnhMetaRecord);
procedure DoSETICMPROFILEA(EMFR: PEnhMetaRecord);
procedure DoSETICMPROFILEW(EMFR: PEnhMetaRecord);
procedure DoALPHABLEND(EMFR: PEMRALPHABLEND);
procedure DoALPHADIBBLEND(EMFR: PEnhMetaRecord);
procedure DoTRANSPARENTBLT(EMFR: PEMRTRANSPARENTBLT);
procedure DoTRANSPARENTDIB(EMFR: PEnhMetaRecord);
procedure DoGRADIENTFILL(EMFR: PEnhMetaRecord);
procedure DoSETLINKEDUFIS(EMFR: PEnhMetaRecord);
procedure DoSETTEXTJUSTIFICATION(EMFR: PEnhMetaRecord);
procedure DoCOLORMATCHTOTARGETW(EMFR: PEnhMetaRecord);
procedure DoCREATECOLORSPACEW(EMFR: PEnhMetaRecord);
procedure DoEnhRecord(EMFR: PEnhMetaRecord);
procedure ShapeSetStyle(ShowOutLine, ShowFill: boolean; fsh: TFlashShape = nil);
procedure CloseHandle;
procedure InitHandle;
procedure SetWTransform(xForm: TxForm; Flag: word);
procedure ReInitViewPort;
function MapPoint(P: TPoint): TPoint; overload;
function MapPoint(P: TSmallPoint): TPoint; overload;
function MapRect(R: TRect): TRect;
function MapLen(L: integer; Vert: boolean): longint;
function GetRootSprite: TFlashSprite;
procedure GetMetrixFont(F: TFont);
property ActiveSprite: TFSpriteCanvas read GetActiveSprite write FActiveSprite;
procedure MakeListMFRecords(MetaHandle: THandle; r: TRect);
procedure ProcessingRecords(MetaHandle: THandle; Width, Height: integer; stretch: boolean);
function IsEmptyMetafile(MetaHandle: THandle = 0): boolean;
procedure Finished;
public
constructor Create(Owner: TFlashMovie);
destructor Destroy; override;
function isNeedBuffer: boolean;
procedure Clear;
procedure DrawMetafile(Dest: TRect; MF: TMetafile; stretch: boolean);
procedure Draw(X, Y: Integer; Graphic: TGraphic);
procedure StretchDraw(const R: TRect; Graphic: TGraphic);
function Place(depth: word; clear: boolean = true; dest: TFlashSprite = nil): TFlashPlaceObject;
property RootSprite: TFlashSprite read GetRootSprite;
property EmbeddedFont: Boolean read FEmbeddedFont write FEmbeddedFont;
property Owner: TFlashMovie read FOwner write FOwner;
property RenderOptions: TRenderOptions read FRenderOptions write FRenderOptions;
end;
// ================ TFlashObjectList ===================
TFlashObjectList = class (TObject)
private
ObjectList: TObjectList;
function GetCount: Word;
protected
function FGetFromID(ID: word): TFlashIDObject;
public
constructor Create;
destructor Destroy; override;
procedure Add(Obj: TFlashIDObject);
property Count: Word read GetCount;
end;
TFlashButtonList = class (TFlashObjectList)
private
function GetButton(Index: word): TFlashButton;
public
function GetFromID(ID: word): TFlashButton;
function Last: TFlashButton;
property Button[Index: word]: TFlashButton read GetButton; default;
end;
TFlashFontList = class (TFlashObjectList)
private
function GetFont(Index: word): TFlashFont;
public
function GetFromID(ID: word): TFlashFont;
function FindByFont(F: TFont; CompareSize: boolean): TFlashFont;
function Last: TFlashFont;
property Font[Index: word]: TFlashFont read GetFont; default;
end;
TFlashImageList = class (TFlashObjectList)
private
function GetImage(Index: word): TFlashImage;
public
function GetFromID(ID: word): TFlashImage;
function Last: TFlashImage;
property Image[Index: word]: TFlashImage read GetImage; default;
end;
TFlashMorphShapeList = class (TFlashObjectList)
private
function GetShape(Index: word): TFlashMorphShape;
public
function GetFromID(ID: word): TFlashMorphShape;
function Last: TFlashMorphShape;
property Shape[Index: word]: TFlashMorphShape read GetShape; default;
end;
TFlashShapeList = class (TFlashObjectList)
private
function GetShape(Index: word): TFlashShape;
public
function GetFromID(ID: word): TFlashShape;
function Last: TFlashShape;
property Shape[Index: word]: TFlashShape read GetShape; default;
end;
TFlashSoundList = class (TFlashObjectList)
private
function GetSound(Index: word): TFlashSound;
public
function GetFromID(ID: word): TFlashSound;
function Last: TFlashSound;
property Sound[Index: word]: TFlashSound read GetSound; default;
end;
TFlashSpriteList = class (TFlashObjectList)
private
function GetSprite(Index: word): TFlashSprite;
public
function GetFromID(ID: word): TFlashSprite;
function Last: TFlashSprite;
property Sprite[Index: word]: TFlashSprite read GetSprite; default;
end;
TFlashTextList = class (TFlashObjectList)
private
function GetText(Index: word): TFlashText;
public
function GetFromID(ID: word): TFlashText;
function Last: TFlashText;
property Text[Index: word]: TFlashText read GetText; default;
end;
TFlashVideoList = class (TFlashObjectList)
private
function GetVideo(Index: word): TFlashVideo;
public
function GetFromID(ID: word): TFlashVideo;
function Last: TFlashVideo;
property Video[Index: word]: TFlashVideo read GetVideo; default;
end;
TExternalIncludeMode = (eimRoot, eimResource, eimNoFrameRoot, eimSprite);
TFlashExternalMovie = class (TFlashIDObject)
private
FIncludeMode: TExternalIncludeMode;
FOnWriteTag: TSWFProcessTagEvent;
FReader: TSWFStreamReader;
FSprite: TFlashSprite;
FRenameFontName: boolean;
public
constructor Create(owner: TFlashMovie; src: string); overload;
constructor Create(owner: TFlashMovie; src: TStream); overload;
destructor Destroy; override;
function IDObjectsCount: Word;
property RenameFontName: boolean read FRenameFontName write FRenameFontName;
procedure Renumber(start: word);
procedure WriteToStream(be: TBitsEngine); override;
property IncludeMode: TExternalIncludeMode read FIncludeMode write FIncludeMode;
property Reader: TSWFStreamReader read FReader;
property Sprite: TFlashSprite read FSprite;
property OnWriteTag: TSWFProcessTagEvent read FOnWriteTag write FOnWriteTag;
end;
// ================ TFlashMovie ========================
TBackgroundMode = (bmNone, bmColor);
TAddObjectMode = (amEnd, amCurrentFrame, amHomeCurrentFrame, amFromStartFrame);
TFlashFilterQuality = (fqLow, fqMedium, fqHigh);
TFlashFilterSettings = class(TObject)
private
FAngle: single;
FBlurX: Integer;
FBlurY: Integer;
FBrightness: Integer;
FContrast: Integer;
FShadowColor: TSWFRGBA;
FDistance: Integer;
FKnockout: Boolean;
FQuality: TFlashFilterQuality;
FGlowColor: TSWFRGBA;
FHideObject: Boolean;
FHue: Integer;
FInner: Boolean;
FOnTop: Boolean;
FSaturation: Integer;
FStrength: word;
public
constructor Create;
destructor Destroy; override;
property Angle: single read FAngle write FAngle;
property BlurX: Integer read FBlurX write FBlurX;
property BlurY: Integer read FBlurY write FBlurY;
property Brightness: Integer read FBrightness write FBrightness;
property Contrast: Integer read FContrast write FContrast;
property ShadowColor: TSWFRGBA read FShadowColor write FShadowColor;
property Distance: Integer read FDistance write FDistance;
property Knockout: Boolean read FKnockout write FKnockout;
property Quality: TFlashFilterQuality read FQuality write FQuality;
property GlowColor: TSWFRGBA read FGlowColor write FGlowColor;
property HideObject: Boolean read FHideObject write FHideObject;
property Hue: Integer read FHue write FHue;
property Inner: Boolean read FInner write FInner;
property OnTop: Boolean read FOnTop write FOnTop;
property Saturation: Integer read FSaturation write FSaturation;
property Strength: word read FStrength write FStrength;
end;
{$IFDEF ASCompiler}
TBaseCompileContext = class(TObject)
private
FMovie: TFlashMovie;
function GetListing: TStream;
public
constructor Create(owner: TFlashMovie); virtual;
procedure LoadClassTable(ClassPath: string); virtual; abstract;
procedure AddIncludePath(IncludePath: string); virtual; abstract;
procedure CompileAction(
ASource: TStream;
ASwfCode: TFlashActionScript); overload; virtual; abstract;
procedure CompileAction(
ASource: TStream;
AFlashButton: TFlashButton); overload; virtual; abstract;
procedure CompileAction(
ASource: TStream;
APlaceObject: TFlashPlaceObject); overload; virtual; abstract;
property Movie: TFlashMovie read FMovie write FMovie;
property Listing: TStream read GetListing;
end;
{$ENDIF}
TFlashMovie = class (TBasedSWFStream)
private
FAddObjectMode: TAddObjectMode;
{$IFDEF ASCompiler}
FSelfDestroyASLog: boolean;
FASCompilerLog: TStream;
FASCompiler: TBaseCompileContext;
FASCompilerOptions: TCompileOptions;
{$ENDIF}
FBackgroundColor: TSWFRGB;
FBackgroundMode: TBackgroundMode;
FBackgroundSound: TFlashSound;
FButtons: TFlashButtonList;
FCanvas: TFlashCanvas;
FCurrentObjID: Word;
FCurrentFrameNum: Integer;
FOnLoadCustomImage: TLoadCustomImageEvent;
FEnableBgSound: Boolean;
FFonts: TFlashFontList;
FFrameActions: TFlashActionScript;
FFrameLabel: string;
FGlobalFilterSettings: TFlashFilterSettings;
FImages: TFlashImageList;
FMaxDepth: word;
FMorphShapes: TFlashMorphShapeList;
FObjectList: TObjectList;
FPassword: string;
FProtect: Boolean;
FShapes: TFlashShapeList;
FSounds: TFlashSoundList;
FSprites: TFlashSpriteList;
FTexts: TFlashTextList;
FFileAttributes: TSWFFileAttributes;
FVideoList: TObjectList;
FVideos: TFlashVideoList;
FMetaData: ansistring;
FUseFileAttributes: boolean;
FCorrectImageFill: boolean;
FFix32bitImage: boolean;
procedure SetCorrectImageFill(const Value: boolean);
procedure SetUseFileAttributes(const Value: boolean);
procedure SetMetadata(const Value: ansistring);
function GetHasMetadata: boolean;
procedure SetHasMetadata(const Value: boolean);
function GetUseNetwork: boolean;
procedure setUseNetwork(const Value: boolean);
{$IFDEF ASCompiler}
function GetASCompilerLog: TStream;
function GetASCompiler: TBaseCompileContext;
procedure SetCompilerOptions(value: TCompileOptions);
{$ENDIF}
function GetBackgrondSound: TFlashSound;
function GetBackgroundColor: TSWFRGB;
function GetButtons: TFlashButtonList;
function GetCanvas: TFlashCanvas;
function GetFonts: TFlashFontList;
function GetFrameActions: TFlashActionScript;
function GetGlobalFilterSettings: TFlashFilterSettings;
function GetImages: TFlashImageList;
function GetMorphShapes: TFlashMorphShapeList;
function GetObjectList: TObjectList;
function GetShapes: TFlashShapeList;
function GetSounds: TFlashSoundList;
function GetSprites: TFlashSpriteList;
function GetTexts: TFlashTextList;
function GetFileAttributes: TSWFFileAttributes;
function GetVideoListCount: Integer;
function GetVideos: TFlashVideoList;
function GetVideoStream(index: LongInt): TFlashPlaceVideo;
procedure SetAddObjectMode(Value: TAddObjectMode);
procedure SetCurrentFrameNum(Value: Integer);
procedure SetObjectList(const Value: TObjectList);
procedure SetPassword(Value: string);
protected
CurrentFramePosIndex: LongInt;
procedure AddFlashObject(Obj: TBasedSWFObject);
procedure DoChangeHeader; override;
procedure ExtMoviePrepare(EM: TFlashExternalMovie; IM: TExternalIncludeMode; autorenum: boolean);
public
constructor Create(XMin, YMin, XMax, YMax: integer; fps: single; sc: TSWFSystemCoord = scTwips); override;
destructor Destroy; override;
function AddArc(XCenter, YCenter, RadiusX, RadiusY: longint; StartAngle, EndAngle: single; closed: boolean = true):
TFlashShape; overload;
function AddArc(XCenter, YCenter, Radius: longint; StartAngle, EndAngle: single; closed: boolean = true): TFlashShape;
overload;
function AddButton(hasmenu: boolean = false; advMode: boolean = true): TFlashButton;
function AddCircle(XCenter, YCenter, Radius: integer): TFlashShape;
function AddCubicBezier(P0, P1, P2, P3: TPoint): TFlashShape;
function AddCurve(P1, P2, P3: TPoint): TFlashShape;
function AddDiamond(XMin, YMin, XMax, YMax: integer): TFlashShape;
function AddDynamicText(varname, init: ansistring; c: recRGBA; f: TFlashFont; R: TRect): TFlashText; overload;
{$IFNDEF VER130}
function AddDynamicText(varname: ansistring; init: WideString; c: recRGBA; f: TFlashFont; R: TRect): TFlashText; overload;
{$ENDIF}
function AddDynamicTextW(varname: ansistring; init: WideString; c: recRGBA; f: TFlashFont; R: TRect): TFlashText;
function AddEllipse(XMin, YMin, XMax, YMax: integer): TFlashShape; overload;
function AddEllipse(R: TRect): TFlashShape; overload;
function AddExternalMovie(src: string; IM: TExternalIncludeMode; autorenum: boolean = true): TFlashExternalMovie;
overload;
function AddExternalMovie(src: TStream; IM: TExternalIncludeMode; autorenum: boolean = true): TFlashExternalMovie;
overload;
function AddFont: TFlashFont; overload;
function AddFont(FontInfo: TFont; device: boolean = true): TFlashFont; overload;
function AddFont(LogFont: TLogFont; device: boolean = true): TFlashFont; overload;
function AddFont(Name: string; bold, italic: boolean; size: integer; device: boolean = true): TFlashFont; overload;
procedure AddIDObject(Obj: TFlashIDObject; SetID: boolean = true);
function AddImage(fn: string = ''): TFlashImage;
function AddLine(X1, Y1, X2, Y2: longint): TFlashShape;
function AddMorphShape(shape: TFlashMorphShape = nil): TFlashMorphShape;
function AddPie(XCenter, YCenter, Radius: longint; StartAngle, EndAngle: single): TFlashShape; overload;
function AddPie(XCenter, YCenter, RadiusX, RadiusY: longint; StartAngle, EndAngle: single): TFlashShape; overload;
function AddPolygon(AP: array of TPoint): TFlashShape;
function AddPolyline(AP: array of TPoint): TFlashShape;
function AddRectangle(XMin, YMin, XMax, YMax: longint): TFlashShape; overload;
function AddRectangle(R: TRect): TFlashShape; overload;
function AddRing(XCenter, YCenter, Radius1, Radius2: integer): TFlashShape;
function AddRoundRect(XMin, YMin, XMax, YMax, Radius: longint): TFlashShape; overload;
function AddRoundRect(R: TRect; Radius: longint): TFlashShape; overload;
function AddShape(shape: TFlashShape = nil): TFlashShape;
function AddShapeImage(fn: string): TFlashShape; overload;
function AddShapeImage(img: TFlashImage): TFlashShape; overload;
function AddSound(fn: string): TFlashSound; overload;
function AddSound(Src: TMemoryStream; isMP3: boolean): TFlashSound; overload;
function AddSprite(VO: TFlashVisualObject = nil): TFlashSprite;
function AddSquare(XMin, YMin, Side: integer): TFlashShape; overload;
function AddSquare(XMin, YMin, XMax, YMax: integer): TFlashShape; overload;
function AddStar(X, Y, R1, R2: longint; NumPoint: word; curve: boolean = false): TFlashShape;
function AddText: TFlashText; overload;
function AddText(s: ansistring; c: recRGBA; f: TFlashFont; P: TPoint; Align: TSWFTextAlign = taLeft): TFlashText; overload;
function AddText(s: ansistring; c: recRGBA; f: TFlashFont; R: TRect): TFlashText; overload;
{$IFNDEF VER130}
function AddText(s: WideString; c: recRGBA; f: TFlashFont; P: TPoint; Align: TSWFTextAlign = taLeft): TFlashText; overload;
function AddText(s: WideString; c: recRGBA; f: TFlashFont; R: TRect): TFlashText; overload;
{$ENDIF}
function AddTextW(s: WideString; c: recRGBA; f: TFlashFont; P: TPoint; Align: TSWFTextAlign = taLeft): TFlashText; overload;
function AddTextW(s: WideString; c: recRGBA; f: TFlashFont; R: TRect): TFlashText; overload;
function AddVideo(FileName: string): TFlashVideo;
function AddVideoFromStream(MS: TMemoryStream): TFlashVideo;
function CalcFramesCount: Word;
procedure Clear;
function ExportAssets(name: string; id: word): TSWFExportAssets; overload;
function ExportAssets(name: string; Sprite: TFlashSprite): TSWFExportAssets; overload;
function FindObjectFromID(ID: word): TFlashIDObject;
function FramePos(num: word): longint; override;
function GetMinVersion: Byte;
function ImportAssets(filename: string): TSWFImportAssets; overload;
function ImportAssets(URL, name: string): TSWFImportAssets; overload;
procedure MakeStream; override;
procedure MoveResource(ToFrame, StartFrom, EndFrom: integer); override;
function PlaceObject(shape, mask: TFlashVisualObject; depth: word): TFlashPlaceObject; overload;
function PlaceObject(shape: TFlashVisualObject; depth: word): TFlashPlaceObject; overload;
function PlaceObject(depth: word): TFlashPlaceObject; overload;
function PlaceVideo(F: TFlashVideo; depth: word): TFlashPlaceVideo;
procedure RemoveObject(depth: word; shape: TFlashVisualObject = nil);
procedure SetTabIndex(Depth, TabIndex: word);
procedure ShowFrame(c: word = 1);
function StartSound(snd: TFlashSound; Loop: word = 1): TSWFStartSound; overload;
function StartSound(ID: word; Loop: word = 1): TSWFStartSound; overload;
procedure StoreFrameActions;
property AddObjectMode: TAddObjectMode read FAddObjectMode write SetAddObjectMode;
{$IFDEF ASCompiler}
property ASCompiler: TBaseCompileContext read GetASCompiler write FASCompiler;
property ASCompilerLog: TStream read GetASCompilerLog write FASCompilerLog;
property ASCompilerOptions: TCompileOptions read FASCompilerOptions write SetCompilerOptions;
{$ENDIF}
property BackgroundColor: TSWFRGB read GetBackgroundColor;
property BackgroundMode: TBackgroundMode read FBackgroundMode write FBackgroundMode;
property BackgroundSound: TFlashSound read GetBackgrondSound;
property Buttons: TFlashButtonList read GetButtons;
property Canvas: TFlashCanvas read GetCanvas;
property CurrentObjID: Word read FCurrentObjID write FCurrentObjID;
property CurrentFrameNum: Integer read FCurrentFrameNum write SetCurrentFrameNum;
property CorrectImageFill: boolean read FCorrectImageFill write SetCorrectImageFill;
property EnableBgSound: Boolean read FEnableBgSound write FEnableBgSound;
property Fix32bitImage: boolean read FFix32bitImage write FFix32bitImage;
property Fonts: TFlashFontList read GetFonts;
property FrameActions: TFlashActionScript read GetFrameActions;
property FrameLabel: string read FFrameLabel write FFrameLabel;
property GlobalFilterSettings: TFlashFilterSettings read GetGlobalFilterSettings;
property HasMetadata: boolean read GetHasMetadata write SetHasMetadata;
property Images: TFlashImageList read GetImages;
property MaxDepth: word read FMaxDepth;
property MetaData: ansistring read FMetaData write SetMetadata;
property MorphShapes: TFlashMorphShapeList read GetMorphShapes;
property ObjectList: TObjectList read GetObjectList write SetObjectList;
property Password: string read FPassword write SetPassword;
property Protect: Boolean read FProtect write FProtect;
property Shapes: TFlashShapeList read GetShapes;
property Sounds: TFlashSoundList read GetSounds;
property Sprites: TFlashSpriteList read GetSprites;
property Texts: TFlashTextList read GetTexts;
property VideoList[index: LongInt]: TFlashPlaceVideo read GetVideoStream;
property VideoListCount: Integer read GetVideoListCount;
property Videos: TFlashVideoList read GetVideos;
property UseFileAttributes: boolean read FUseFileAttributes write SetUseFileAttributes;
property UseNetwork: boolean read GetUseNetwork write SetUseNetwork;
property OnLoadCustomImage: TLoadCustomImageEvent read FOnLoadCustomImage write FOnLoadCustomImage;
end;
var
LoadCustomImageProc: TLoadCustomImageProc = nil;
Procedure CreateEmptySWF(fn: string; bg: recRGB);
implementation
Uses math, ZLib,
{$IFNDEF VER130}
Types,
{$ENDIF}
{$IFDEF ASCompiler}
ActionCompiler,
{$ENDIF}
FontReader;
// EMF+ Metafile optimaztion options
const
ooTransparentRect = 1;
ooStartTransparentFill = 2;
ooEndTransparentFill = 3;
var
PN1: integer = 1;
{
******************************************************* TFlashObject ********************************************************
}
constructor TFlashObject.Create(owner: TFlashMovie);
begin
FOwner := owner;
end;
function TFlashObject.LibraryLevel: Byte;
begin
Result := FlashLevel;
end;
procedure TFlashObject.ChangeOwner;
begin
end;
procedure TFlashObject.SetOwner(Value: TFlashMovie);
begin
FOwner := Value;
ChangeOwner;
end;
{
****************************************************** TFlashIDObject *******************************************************
}
procedure TFlashIDObject.Assign(Source: TBasedSWFObject);
begin
With TFlashIDObject(Source) do
begin
if self.owner = nil then self.owner := owner;
self.CharacterID := CharacterID;
end;
end;
function TFlashIDObject.GetCharacterId: Word;
begin
Result := FCharacterID;
end;
procedure TFlashIDObject.SetCharacterId(ID: Word);
begin
FCharacterID := ID;
end;
{
******************************************************** TFlashSound ********************************************************
}
constructor TFlashSound.Create(owner: TFlashMovie; fn: string = '');
begin
inherited Create(owner);
MP3SeekStart := 0;
FileName := fn;
SelfDestroy := false;
if FileExists(fn) then LoadSound(fn);
WaveCompressBits := 4;
end;
destructor TFlashSound.Destroy;
begin
// if Assigned(Data) and SelfDestroy then FreeAndNil(Data);
if Assigned(FWaveReader) then FreeAndNil(FWaveReader);
inherited;
end;
procedure TFlashSound.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashSound(Source) do
begin
// self.Data := Data;
self.DataBlockSize := DataBlockSize;
self.DataLen := DataLen;
self.DataStart := DataStart;
self.AutoLoop := AutoLoop;
self.fBitsPerSample := fBitsPerSample;
self.Duration := Duration;
self.MP3Info := MP3Info;
self.FrameSize := FrameSize;
self.recomendSampleCount := recomendSampleCount;
self.SampleCount := SampleCount;
self.FSamplesPerSec := SamplesPerSec;
self.sndFormat := sndFormat;
self.sndRate := sndRate;
self.StartFrame := StartFrame;
self.Stereo := Stereo;
self._16Bit := _16Bit;
self.isMultWriten := isMultWriten;
self.MP3SeekStart := MP3SeekStart;
self.SeekSamples := SeekSamples;
self.FWaveCompressBits := WaveCompressBits;
end;
end;
procedure TFlashSound.FillHeader(SH: TSWFSoundStreamHead; fps: single);
begin
SH.StreamSoundCompression := sndFormat;
if (sndFormat = snd_PCM) then
begin
if (WaveCompressBits > 0)
then SH.StreamSoundCompression := snd_ADPCM
else SH.StreamSoundCompression := snd_PCM{_LE};
end
else
SH.StreamSoundCompression := sndFormat;
SH.StreamSoundRate := sndRate;
if (sndFormat = snd_PCM) and (WaveCompressBits = 0)
then SH.StreamSoundSize := _16bit
else SH.StreamSoundSize := true;
SH.StreamSoundType := Stereo;
recomendSampleCount := Trunc(fSamplesPerSec / fps);
// isMultWriten := Round(DataLen / (MP3info.FrameCount * MP3info.FrameLength));
// if sndFormat = snd_MP3 then
// isMultWriten := Round(DataLen / (Duration * MP3info.FrameLength*fSamplesPerSec/MP3Info.FrameSize));
isMultWriten := 1;
SH.StreamSoundSampleCount := recomendSampleCount;
SH.PlaybackSoundRate := SH.StreamSoundRate;
SH.PlaybackSoundSize := SH.StreamSoundSize;
SH.PlaybackSoundType := SH.StreamSoundType;
if sndFormat = snd_MP3 then
SH.LatencySeek := 0; // calc first offset
DataPos := DataStart;
SamplesWriten := 0;
FrameWriten := 0;
SeekSamples := MP3SeekStart;
WritenCount := 0;
Case sndFormat of
snd_PCM, snd_PCM_LE:
DataBlockSize := Trunc(fSamplesPerSec / fps) * (1 + byte(Stereo)) * (1 + byte(_16Bit)) {-
2* byte(Stereo) - 2*byte(_16Bit)};
snd_ADPCM:
begin
DataBlockSize := Trunc(fSamplesPerSec / fps) * (1 + byte(Stereo)) * 2 - 2* byte(Stereo) - 2;
// ADPCMReader := TWaveReader.Create(FileName);
end;
end;
end;
function TFlashSound.GetWaveReader: TWaveReader;
begin
if FWaveReader = nil then FWaveReader := TWaveReader.Create('');
Result := FWaveReader;
end;
procedure TFlashSound.ParseWaveInfo;
begin
Duration := WaveReader.Duration;
Case WaveReader.WaveHeader.WaveFormat of
WAVE_FORMAT_PCM: sndFormat := snd_PCM;
WAVE_FORMAT_ADPCM: sndFormat := snd_ADPCM;
WAVE_FORMAT_MP3,
WAVE_FORMAT_MPEG_L3:
begin
sndFormat := snd_MP3;
MP3Info := WaveReader.MP3Info;
end;
end;
fSamplesPerSec := WaveReader.WaveHeader.SamplesPerSec;
Case WaveReader.WaveHeader.SamplesPerSec div 5000 of
1: sndRate := Snd5k; // 5k
2: sndRate := Snd11k; // 11k
3: sndRate := Snd22k;
4: sndRate := Snd22k; // 22k
8: sndRate := Snd44k;
end;
fBitsPerSample := WaveReader.WaveHeader.BitsPerSample;
if sndFormat = snd_PCM
then _16Bit := not (fBitsPerSample = 8)
else _16Bit := true;
Stereo := WaveReader.WaveHeader.Channels = 2;
DataStart := WaveReader.DataInfo.Start;
DataLen := WaveReader.DataInfo.Len;
DataBlockSize := DataLen;
SampleCount := WaveReader.WaveHeader.Samples;
// if not (sndFormat in [snd_PCM, snd_ADPCM]) then FreeAndNil(FWaveReader);
end;
procedure TFlashSound.LoadSound(fn: string);
begin
FileName := fn;
WaveReader := TWaveReader.Create(fn);
ParseWaveInfo;
end;
procedure TFlashSound.LoadFromMemory(Src: TMemoryStream; isMP3: boolean);
begin
FileName := '';
WaveReader := TWaveReader.CreateFromStream(Src, isMP3);
ParseWaveInfo;
end;
function TFlashSound.MinVersion: Byte;
begin
Case SndFormat of
snd_MP3, snd_PCM_LE: Result := SWFVer4;
snd_Nellymoser: Result := SWFVer6;
snd_NellymoserMono: Result := SWFVer8;
else Result := SWFVer1;
end;
end;
procedure TFlashSound.SetWaveCompressBits(const Value: byte);
begin
if Value > 5 then FWaveCompressBits := 5 else
if Value = 1 then FWaveCompressBits := 0 else
FWaveCompressBits := Value;
end;
procedure TFlashSound.SetWaveReader(const Value: TWaveReader);
begin
if Assigned(FWaveReader) then FreeAndNil(FWaveReader);
FWaveReader := Value;
end;
function TFlashSound.StartSound: TSWFStartSound;
begin
if Owner = nil
then Result := nil
else Result := Owner.StartSound(CharacterId);
end;
procedure TFlashSound.WriteSoundBlock(BE: TBitsEngine);
var
SSB: TSWFSoundStreamBlock;
begin
case sndFormat of
snd_PCM, snd_PCM_LE, snd_ADPCM:
begin
with WaveReader do
if (WaveData.Position < (DataInfo.Start + DataInfo.Len)) or AutoLoop then
begin
SSB := TSWFSoundStreamBlock.Create;
SSB.OnDataWrite := WriteSoundData;
SSB.WriteToStream(BE);
SSB.Free;
end;
end;
snd_MP3:
begin
if Abs(SeekSamples) > MP3Info.SamplesPerFrame then wFrameCount := 0 else
begin
wFrameCount := (SeekSamples + recomendSampleCount) div MP3Info.SamplesPerFrame;
if (WritenCount = 0) and (wFrameCount = 0) then wFrameCount := 1;
end;
inc(WritenCount);
wSampleCount := wFrameCount * MP3Info.SamplesPerFrame;
if WritenCount = 1 then SeekSamples := MP3SeekStart
else
begin
SeekSamples := (WritenCount - 1) * recomendSampleCount - SamplesWriten;
if Abs(SeekSamples) > MP3Info.SamplesPerFrame then
begin
SampleCount := 0;
SeekSamples := 0;
wFrameCount := 0;
end;
end;
if SampleCount = 0 then
begin
be.WriteWord(tagSoundStreamBlock shl 6 + $3f);
Be.WriteDWord(4);
be.Write4byte(0);
end else
begin
SSB := TSWFSoundStreamBlock.Create;
SSB.OnDataWrite := WriteSoundData;
SSB.WriteToStream(BE);
SSB.Free;
end;
inc(SamplesWriten, wSampleCount);
SeekSamples := WritenCount * recomendSampleCount - SamplesWriten;
end;
end;
end;
procedure TFlashSound.WriteSoundData(sender: TSWFObject; BE: TBitsEngine);
begin
if sender is TSWFSoundStreamBlock then
begin
case sndFormat of
snd_PCM:
WaveReader.WriteUncompressBlock(BE, DataBlockSize, WaveCompressBits, AutoLoop);
snd_ADPCM:
WaveReader.WriteBlock(BE, recomendSampleCount, WaveCompressBits, AutoLoop);
snd_MP3:
begin
be.WriteWord(wSampleCount);
be.WriteWord(Word(SeekSamples));
if wFrameCount > 0 then
FrameWriten := WaveReader.WriteMP3Block(BE, FrameWriten, wFrameCount, AutoLoop);
end;
end;
end else
begin
case sndFormat of
snd_PCM, snd_PCM_LE:
begin
WaveReader.WaveData.Position := DataStart;
WaveReader.WriteUncompressBlock(BE, DataLen, WaveCompressBits, false);
end;
snd_ADPCM:
WaveReader.WriteToStream(Be, WaveCompressBits);
snd_MP3:
begin
WaveReader.WaveData.Position := DataStart;
BE.BitsStream.CopyFrom(WaveReader.WaveData, DataLen);
end;
end;
end;
// Case sndFormat of
// snd_PCM, snd_MP3:
// begin
// Data.Position := DataStart;
// BE.BitsStream.CopyFrom(Data, DataLen);
// end
// end;
end;
procedure TFlashSound.WriteToStream(be: TBitsEngine);
begin
With TSWFDefineSound.Create do
begin
SoundId := CharacterId;
if (sndFormat = snd_PCM) and (WaveCompressBits > 0)
then SoundFormat := snd_ADPCM
else SoundFormat := sndFormat;
SoundRate := sndRate;
if (sndFormat = snd_PCM) and (WaveCompressBits = 0)
then SoundSize := _16bit
else SoundSize := true;
SoundType := Stereo;
SoundSampleCount := SampleCount;
SeekSamples := MP3SeekStart;
onDataWrite := WriteSoundData;
WriteToStream(be);
free;
end;
end;
// =============================================================//
// TFlashImage //
// =============================================================//
{
******************************************************** TFlashImage ********************************************************
}
constructor TFlashImage.Create(owner: TFlashMovie; fn: string = '');
begin
inherited Create(owner);
FConvertProgressiveJpeg := true;
if fn <> '' then LoadDataFromFile(fn) else FDataState := dsNoInit;
end;
destructor TFlashImage.Destroy;
begin
if FData <> nil then FData.Free;
if FBMPStorage <> nil then FBMPStorage.Free;
if FAlphaData <> nil then FAlphaData.free;
inherited;
end;
procedure TFlashImage.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashImage(Source) do
begin
self.FColorCount := ColorCount;
self.FHeight := Height;
self.FSaveWidth := SaveWidth;
self.FWidth := Width;
self.FDataState := DataState;
self.SWFBMPType := SWFBMPType;
self.FAsJPEG := AsJPEG;
self.ConvertProgressiveJPEG := ConvertProgressiveJPEG;
self.HasUseAlpha := HasUseAlpha;
case DataState of
dsMemory, dsMemoryBMP,
dsMemoryJPEG:
begin
Data.Position := 0;
self.Data.CopyFrom(Data, Data.Size);
end;
dsFileJPEG: self.Data := Data;
end;
if FBMPStorage <> nil then
self.BMPStorage.LoadFromHandle(BMPStorage.Handle);
end;
end;
procedure TFlashImage.CopyToStream(S: TStream);
begin
if not (DataState = dsNoInit) and (Data.Size > 0) then
begin
Data.Position := 0;
S.CopyFrom(Data, Data.Size);
end;
end;
function TFlashImage.GetAlphaData: TMemoryStream;
begin
if (FAlphaData = nil) and AsJPEG
then FAlphaData := TMemoryStream.Create;
Result := FAlphaData;
end;
function TFlashImage.GetAlphaPixel(X, Y: Integer): Byte;
var
P: PByte;
begin
if AsJPEG then
begin
P := AlphaData.Memory;
inc(P, Y * Width + X);
Result := P^;
end else
if SWFBMPType = BMP_32bitWork then
begin
Result := BMPStorage.Pixels32[Y][X].A;
end else result := $FF;
end;
procedure TFlashImage.GetBMPInfo;
var
addBytes: Byte;
begin
FWidth := BMPStorage.Width;
FHeight := BMPStorage.Height;
FColorCount := 0;
case BMPStorage.Bpp of
1, 4, 8:
begin
SWFBMPType := BMP_8bit;
FColorCount := CountColors(BMPStorage);
addBytes := 4 - Width mod 4;
if addBytes = 4 then addBytes := 0;
FSaveWidth := Width + addBytes;
FHasUseAlpha := BMPStorage.TransparentIndex > -1;
if FHasUseAlpha then
SetAlphaIndex(BMPStorage.TransparentIndex, 0);
end;
16: begin
SWFBMPType := BMP_15bit;
addBytes := Width mod 2;
FSaveWidth := Width + addBytes;
end;
24: begin
SWFBMPType := BMP_24bit;
FSaveWidth := Width;
end;
32: begin
SWFBMPType := BMP_32bitWork;
FSaveWidth := Width;
FHasUseAlpha := true;
end;
end;
FDataState := dsMemoryBMP;
end;
function TFlashImage.GetBMPStorage: TBMPReader;
begin
if not Assigned(FBMPStorage) then FBMPStorage := TBMPReader.Create;
Result := FBMPStorage;
end;
function TFlashImage.GetData: TStream;
begin
if not Assigned(fData) then
begin
if DataState = dsInitJPEG then
begin
FData := TFileStream.Create(FileName, fmOpenRead + fmShareDenyNone);
FDataState := dsFileJPEG;
end else
begin
fData := TMemoryStream.Create;
FDataState := dsMemory;
end;
end;
result := fData;
end;
function TFlashImage.GetHeight: Word;
begin
result := FHeight;
end;
function TFlashImage.GetWidth: Word;
begin
result := FWidth;
end;
procedure TFlashImage.LoadAlphaDataFromBMPReader(BMP: TBMPReader);
var
ilx, ily: Integer;
PB, AB: PByte;
P32: ^TFColorA;
begin
if (BMP.Width = Width) and (BMP.Height = Height) and (BMP.Bpp <= 8) or (BMP.Bpp = 32) then
begin
FHasUseAlpha := true;
if FAlphaData <> nil then FAlphaData.Clear;
if AsJPEG then
begin
AlphaData.SetSize(Width * Height);
AB := AlphaData.Memory;
For ily := Height - 1 downto 0 do
begin
PB := BMP.Scanlines[ily];
if BMP.Bpp = 32 then P32 := Pointer(PB);
For ilx := 0 to Width - 1 do
begin
if BMP.Bpp = 32 then
begin
AB^ := P32^.A;
inc(P32);
end else
if BMP.Bpp = 8 then
begin
AB^ := PB^;
inc(PB);
end else
begin
if (ilx and 1) = 0 then
AB^ := PLine8(PB)^[ilx shr 1] shr 4
else
AB^ := PLine8(PB)^[ilx shr 1] and $F;
end;
inc(AB)
end;
end;
end else
if SWFBMPType = BMP_32bitWork then
begin
SetAlphaChannel(BMPStorage, BMP);
end;
end;
end;
procedure TFlashImage.LoadAlphaDataFromFile(fn: string);
var
FS: TFileStream;
ext: string;
begin
Ext := UpperCase(ExtractFileExt(fn));
if (Ext<>'') and (Ext[1] = '.') then Delete(Ext, 1, 1);
if Ext = 'BMP' then
begin
FS := TFileStream.Create(fn, fmOpenRead + fmShareDenyWrite);
LoadAlphaDataFromStream(FS);
FS.Free;
end
else exception.Create('Image format "'+ext+'" for alpha not supported!');
end;
procedure TFlashImage.LoadAlphaDataFromHandle(HBMP: HBitmap);
var
BMP: TBMPReader;
begin
BMP := TBMPReader.Create;
BMP.LoadFromHandle(HBMP);
LoadAlphaDataFromBMPReader(BMP);
BMP.Free;
end;
procedure TFlashImage.LoadAlphaDataFromStream(S: TStream);
var
BMP: TBMPReader;
begin
BMP := TBMPReader.Create;
BMP.LoadFromStream(S);
LoadAlphaDataFromBMPReader(BMP);
BMP.Free;
end;
procedure TFlashImage.LoadDataFromFile(fn: string);
var
ext: string;
{$IFDEF DelphiJPEG}
JPG: TJPEGImage;
BMP: TBitmap;
{$ENDIF}
DefaultProcess: boolean;
begin
FFileName := fn;
DefaultProcess := true;
if (owner <> nil) and Assigned(owner.FOnLoadCustomImage)
then owner.FOnLoadCustomImage(self, fn, DefaultProcess);
if DefaultProcess then
begin
Ext := UpperCase(ExtractFileExt(fn));
if (Ext<>'') and (Ext[1] = '.') then Delete(Ext, 1, 1);
FAsJPEG := false;
HasUseAlpha := false;
if (Ext = 'JPG') or (Ext = 'JPEG') then
begin
FAsJPEG := true;
GetJPGSize(fn, FWidth, FHeight);
if ConvertProgressiveJPEG and ((Width = 0) or (Height = 0)) then
begin
{$IFDEF DelphiJPEG}
JPG := TJPEGImage.Create;
JPG.LoadFromFile(fn);
if JPG.ProgressiveEncoding then
begin
BMP := TBitmap.Create;
BMP.Assign(JPG);
FWidth:= BMP.Width;
FHeight:= BMP.Height;
JPG.Free;
JPG := TJPEGImage.Create;
JPG.ProgressiveEncoding := false;
JPG.Assign(BMP);
BMP.Free;
Data := TMemoryStream.Create;
JPG.SaveToStream(Data);
FDataState := dsMemoryJPEG;
end;
JPG.Free;
{$ENDIF}
end else
begin
// Data := TFileStream.Create(fn, fmOpenRead + fmShareDenyNone);
FDataState := dsInitJPEG;// dsFileJPEG;
end;
end else
if ext = 'BMP' then
begin
BMPStorage.LoadFromFile(fn);
GetBMPInfo;
FAsJPEG := false;
end else
if (@LoadCustomImageProc<>nil) then
LoadCustomImageProc(self, fn) else
exception.Create('Image format "'+ext+'" not supported!');
end;
end;
procedure TFlashImage.LoadDataFromHandle(HBMP: HBitmap);
begin
BMPStorage.LoadFromHandle(HBMP);
GetBMPInfo;
end;
procedure TFlashImage.LoadDataFromNativeStream(S: TStream; JPG: boolean; Width, Height: integer);
begin
LoadDataFromNativeStream(S, JPG, Width, Height, 0, 0, false);
end;
procedure TFlashImage.LoadDataFromNativeStream(S: TStream; JPG: boolean; Width, Height: integer; BMPType, ColorCount: byte;
HasAlpha: boolean);
begin
Case DataState of
dsFileJPEG: FData.Free;
dsMemory, dsMemoryBMP, dsMemoryJPEG: TMemoryStream(FData).Clear;
end;
FAsJPEG := JPG;
FWidth := Width;
FHeight := Height;
if not AsJPEG then
begin
FSaveWidth := Width;
SWFBMPType := BMPType;
FHasUseAlpha := HasAlpha;
FColorCount := ColorCount;
end;
S.Position := 0;
Data.CopyFrom(S, S.Size);
end;
procedure TFlashImage.LoadDataFromStream(S: TStream);
begin
BMPStorage.LoadFromStream(S);
GetBMPInfo;
FAsJPEG := false;
end;
procedure TFlashImage.MakeAlphaLayer(Alpha: byte = $FF);
var
P: Pointer;
S: LongInt;
begin
if AsJPEG then
begin
S := Width * Height;
GetMem(P, S);
FillChar(P^, S, Alpha);
AlphaData.Position := 0;
AlphaData.Write(P^, S);
AlphaData.Position := 0;
FreeMem(P, S);
end else
if BMPStorage.bpp = 32 then
FillAlpha(BMPStorage, Alpha);
end;
procedure TFlashImage.MakeDataFromBMP;
var
il, il2: Integer;
addBytes, B: Byte;
tmpMemStream, MMem: TMemoryStream;
W: ^Word;
P: PLine8;
CW, NullW: dWord;
pCA: PFColorA;
pC: PFColor;
needFixAlpha: boolean;
begin
if SWFBMPType = 0 then GetBMPInfo;
tmpMemStream := TMemoryStream.Create;
addBytes := SaveWidth - Width;
NullW := 0;
case SWFBMPType of
BMP_8bit: begin
tmpMemStream.SetSize(SaveWidth * Height + (ColorCount * (3 + byte(HasUseAlpha))));
for il:=0 to ColorCount - 1 do
with BMPStorage.Colors[il] do
begin
tmpMemStream.Write(r, 1);
tmpMemStream.Write(g, 1);
tmpMemStream.Write(b, 1);
if HasUseAlpha then tmpMemStream.Write(a, 1);
end;
for il:=Height - 1 downto 0 do
begin
P := BMPStorage.Scanlines[il];
case BMPStorage.Bpp of
8:tmpMemStream.Write(P^, Width);
4:begin
for il2 := 0 to (Width - 1) do
begin
if Odd(il2) then B := P^[il2 div 2] and $F
else B := P^[il2 div 2] shr 4;
tmpMemStream.Write(B, 1);
end;
end;
1:begin
for il2 := 0 to (Width - 1) do
begin
B := (il2 and 7) xor 7;
B := P^[il2 shr 3] and (1 shl B) shr B;
tmpMemStream.Write(B, 1);
end;
end;
end;
if addBytes > 0 then tmpMemStream.Write(NullW, addBytes);
end;
end;
BMP_15bit:begin
tmpMemStream.SetSize(SaveWidth * Height * 2);
for il := Height - 1 downto 0 do
begin
W := BMPStorage.ScanLines[il];
for il2:=0 to Width - 1 do
begin
b := hi(W^);
tmpMemStream.Write(b, 1);
tmpMemStream.Write(W^, 1);
Inc(W);
end;
if addBytes > 0 then tmpMemStream.Write(NullW, addBytes * 2);
end;
end;
BMP_24bit: begin
tmpMemStream.SetSize(SaveWidth * Height * 4);
CW := $FF;
for il := Height - 1 downto 0 do
begin
pC := BMPStorage.Scanlines[il];
for il2:=0 to Width - 1 do
begin
with pC^ do
CW := b shl 24 + g shl 16 + r shl 8 + $FF;
tmpMemStream.Write(CW, 4);
inc(pC);
end;
end;
end;
BMP_32bitWork: begin
needFixAlpha := true;
if (Owner = nil) or Owner.Fix32bitImage then
begin
for il := Height - 1 downto 0 do
begin
pCA := BMPStorage.Scanlines[il];
for il2 := 0 to Width - 1 do
begin
if pCA^.A > 0 then
begin
needFixAlpha := false;
Break;
end;
inc(pCA);
end;
if not needFixAlpha then Break;
end;
end;
HasUseAlpha := true;
tmpMemStream.SetSize(SaveWidth * Height * 4);
for il := Height - 1 downto 0 do
begin
pCA := BMPStorage.Scanlines[il];
for il2 := 0 to Width - 1 do
with pCA^ do
begin
if needFixAlpha then CW := b shl 24 + g shl 16 + r shl 8 + $FF
else
if a = 0 then CW := 0
else
CW := b shl 24 + g shl 16 + r shl 8 + a;
tmpMemStream.Write(CW, 4);
inc(pCA);
end;
end;
end;
end;
tmpMemStream.Position := 0;
MMem := TMemoryStream.Create;
Data := MMem;
with TCompressionStream.Create(clDefault, MMem) do
begin
CopyFrom(tmpMemStream, tmpMemStream.Size);
free;
end;
tmpMemStream.Free;
FDataState := dsMemoryBMP;
end;
procedure TFlashImage.FillBitsLossless(BL: TSWFDefineBitsLossless);
begin
MakeDataFromBMP;
if SWFBMPType = BMP_32bitWork
then BL.BitmapFormat := BMP_32bit
else BL.BitmapFormat := SWFBMPType;
BL.BitmapWidth := Width;//SaveWidth;
BL.BitmapHeight := Height;
if SWFBMPType = BMP_8bit then BL.BitmapColorTableSize := ColorCount - 1;
BL.OnDataWrite := WriteData;
end;
function TFlashImage.MinVersion: Byte;
begin
Result := SWFVer2 + byte(HasUseAlpha);
end;
procedure TFlashImage.SetAlphaColor(Color: recRGBA);
var
il: Integer;
begin
if (FBMPStorage <> nil) and (SWFBMPType = BMP_8bit) then
begin
FHasUseAlpha := true;
For il := 0 to ColorCount - 1 do
With BMPStorage.Colors[il] do
if (R = Color.R) and (G = Color.G) and (B = Color.B) then
begin
A := Color.A;
if A = 0 then
begin
R := 0;
G := 0;
B := 0;
end;
end;
end;
end;
procedure TFlashImage.SetAlphaIndex(Index, Alpha: byte);
begin
if (FBMPStorage <> nil) and (SWFBMPType = BMP_8bit) and (Index < ColorCount) then
with BMPStorage.Colors[Index] do
begin
FHasUseAlpha := true;
a := Alpha;
if A = 0 then
begin
R := 0;
G := 0;
B := 0;
end;
end;
end;
procedure TFlashImage.SetAlphaPixel(X, Y: Integer; Value: Byte);
var
P: ^byte;
begin
if AsJPEG then
begin
P := AlphaData.Memory;
inc(P, Y * Width + X);
P^ := Value;
end else
if SWFBMPType = BMP_32bitWork then
with BMPStorage.Pixels32[Y][X] do
begin
A := Value;
end;
end;
procedure TFlashImage.SetAsJPEG(const Value: Boolean);
{$IFDEF DelphiJPEG}
var
JPG: TJPEGImage;
BMP: TBitMap;
{$ENDIF}
begin
if FAsJPEG = Value then Exit;
if Value and (DataState = dsMemoryBMP) then
begin
{$IFDEF DelphiJPEG}
BMP := TBitMap.Create;
BMP.Width := BMPStorage.Width;
BMP.Height := BMPStorage.Height;
BitBlt(BMP.Canvas.Handle, 0, 0, BMP.Width, BMP.Height, BMPStorage.DC, 0, 0, SRCCOPY);
JPG := TJPEGImage.Create;
JPG.CompressionQuality := 100;
JPG.Assign(BMP);
JPG.Compress;
JPG.SaveToStream(Data);
FDataState := dsMemoryJPEG;
FAsJPEG := true;
BMP.Free;
JPG.Free;
if BMPStorage.Bpp = 32 then
LoadAlphaDataFromBMPReader(BMPStorage);
{$ENDIF}
end else
if not Value and (DataState in [dsInitJPEG, dsMemoryJPEG]) then
begin
{$IFDEF DelphiJPEG}
BMP := TBitMap.Create;
JPG := TJPEGImage.Create;
if DataState = dsMemoryJPEG then
begin
JPG.LoadFromStream(Data);
TMemoryStream(Data).Clear;
end
else JPG.LoadFromFile(FileName);
BMP.Assign(JPG);
BMPStorage.LoadFromHandle(BMP.Handle);
FDataState := dsMemory;
FAsJPEG := false;
BMP.Free;
JPG.Free;
{$ENDIF}
end;
end;
procedure TFlashImage.SetConvertProgressiveJPEG(Value: Boolean);
{$IFDEF DelphiJPEG}
var
JPG: TJPEGImage;
BMP: TBitmap;
{$ENDIF}
begin
if Value and (Value <> FConvertProgressiveJPEG) and (DataState in [dsInitJPEG, dsFileJPEG]) then
begin
{$IFDEF DelphiJPEG}
if DataState = dsInitJPEG then
begin
FData := TFileStream.Create(FileName, fmOpenRead + fmShareDenyNone);
FDataState := dsFileJPEG;
end;
Data.Position := 0;
JPG := TJPEGImage.Create;
JPG.LoadFromStream(Data);
if JPG.ProgressiveEncoding then
begin
BMP := TBitmap.Create;
BMP.Assign(JPG);
JPG.Free;
JPG := TJPEGImage.Create;
JPG.ProgressiveEncoding := false;
JPG.Assign(BMP);
BMP.Free;
Data := TMemoryStream.Create;
JPG.SaveToStream(Data);
FDataState := dsMemoryJPEG;
end;
JPG.Free;
{$ENDIF}
end;
FConvertProgressiveJPEG := Value;
end;
procedure TFlashImage.SetData(Value: TStream);
begin
if Assigned(fData) then fData.Free;
fData := Value;
end;
procedure TFlashImage.SetFileName(value: string);
begin
if FFileName <> value then
LoadDataFromFile(value);
end;
procedure TFlashImage.WriteAlphaData(sender: TSWFObject; BE: TBitsEngine);
begin
AlphaData.Position := 0;
with TCompressionStream.Create(clDefault, BE.BitsStream) do
begin
CopyFrom(AlphaData, AlphaData.Size);
Free;
end;
end;
procedure TFlashImage.WriteData(sender: TSWFObject; BE: TBitsEngine);
var tmpStream: TStream;
begin
if AsJPEG then
begin
if DataState = dsInitJPEG
then tmpStream := TFileStream.Create(FileName, fmOpenRead + fmShareDenyNone)
else tmpStream := Data;
// if not HasUseAlpha then
BE.WriteWord($D9FF);
BE.WriteWord($D8FF);
end else
begin
if (Data.Size = 0) then MakeDataFromBMP;
tmpStream := Data;
end;
tmpStream.Position := 0;
BE.BitsStream.CopyFrom(tmpStream, tmpStream.Size);
if AsJPEG and (DataState = dsInitJPEG) then tmpStream.Free;
end;
procedure TFlashImage.WriteToStream(be: TBitsEngine);
var
ObjJPEG: TSWFDefineBitsJPEG2;
ObjJPEGA: TSWFDefineBitsJPEG3;
ObjLossless: TSWFDefineBitsLossless;
begin
if AsJPEG then
begin
if (FAlphaData = nil) or (AlphaData.Size = 0) then
begin
ObjJPEG := TSWFDefineBitsJPEG2.Create;
ObjJPEG.CharacterID := CharacterID;
ObjJPEG.OnDataWrite := WriteData;
ObjJPEG.WriteToStream(BE);
ObjJPEG.Free;
end
else
begin
ObjJPEGA := TSWFDefineBitsJPEG3.Create;
ObjJPEGA.CharacterID := CharacterID;
ObjJPEGA.OnDataWrite := WriteData;
ObjJPEGA.OnAlphaDataWrite := WriteAlphaData;
ObjJPEGA.WriteToStream(BE);
ObjJPEGA.Free;
end;
end else
begin
if HasUseAlpha then ObjLossless := TSWFDefineBitsLossless2.Create
else ObjLossless := TSWFDefineBitsLossless.Create;
ObjLossless.CharacterID := CharacterID;
if SWFBMPType = BMP_32bitWork
then ObjLossless.BitmapFormat := BMP_32bit
else ObjLossless.BitmapFormat := SWFBMPType;
ObjLossless.BitmapWidth := Width;//SaveWidth;
ObjLossless.BitmapHeight := Height;
if SWFBMPType = BMP_8bit then ObjLossless.BitmapColorTableSize := ColorCount - 1;
ObjLossless.OnDataWrite := WriteData;
ObjLossless.WriteToStream(BE);
ObjLossless.Free;
end;
end;
// =============================================================//
// TFlashActionScript //
// =============================================================//
const
ActionOperation : array [0..8] of pchar = ('+', '-', '*', '/', '&', '|', '!', '++', '--');
{
**************************************************** TFlashActionScript *****************************************************
}
constructor TFlashActionScript.Create(owner: TFlashMovie; A: TSWFActionList);
begin
inherited Create(owner);
selfDestroy := A = nil;
if selfDestroy then fActionList := TSWFActionList.Create
else fActionList := A;
end;
destructor TFlashActionScript.Destroy;
begin
if selfDestroy then fActionList.Free;
inherited ;
end;
procedure TFlashActionScript.Add;
begin
ActionList.Add(TSWFActionAdd.Create);
end;
procedure TFlashActionScript.Add2;
begin
ActionList.Add(TSWFActionAdd2.Create);
end;
procedure TFlashActionScript.AsciiToChar;
begin
ActionList.Add(TSWFActionAsciiToChar.Create);
end;
procedure TFlashActionScript.Assign(Source: TBasedSWFObject);
begin
With TFlashActionScript(Source) do
begin
Self.SelfDestroy := SelfDestroy;
CopyActionList(ActionList, self.ActionList);
end;
end;
procedure TFlashActionScript.BitAnd;
begin
ActionList.Add(TSWFActionBitAnd.Create);
end;
procedure TFlashActionScript.BitLShift;
begin
ActionList.Add(TSWFActionBitLShift.Create);
end;
procedure TFlashActionScript.BitOr;
begin
ActionList.Add(TSWFActionBitOr.Create);
end;
procedure TFlashActionScript.BitRShift;
begin
ActionList.Add(TSWFActionBitRShift.Create);
end;
procedure TFlashActionScript.BitURShift;
begin
ActionList.Add(TSWFActionBitURShift.Create);
end;
procedure TFlashActionScript.BitXor;
begin
ActionList.Add(TSWFActionBitXor.Create);
end;
function TFlashActionScript.ByteCode(const str: string): TSWFActionByteCode;
begin
Result := TSWFActionByteCode.Create;
Result.StrByteCode := str;
ActionList.Add(Result);
end;
function TFlashActionScript.ByteCode(const AB: array of byte): TSWFActionByteCode;
var
P: PByte;
il: Word;
begin
Result := TSWFActionByteCode.Create;
Result.DataSize := High(AB) + 1;
GetMem(P, Result.DataSize);
Result.Data := P;
Result.SelfDestroy := true;
For il := 0 to Result.DataSize - 1 do
begin
P^ := AB[il];
inc(P);
end;
ActionList.Add(Result);
end;
function TFlashActionScript.ByteCode(Data: Pointer; Size: longint): TSWFActionByteCode;
begin
Result := TSWFActionByteCode.Create;
Result.Data := Data;
Result.DataSize := Size;
ActionList.Add(Result);
end;
procedure TFlashActionScript.Call;
begin
ActionList.Add(TSWFActionCall.Create);
end;
procedure TFlashActionScript.CallFunction;
begin
ActionList.Add(TSWFActionCallFunction.Create);
end;
procedure TFlashActionScript.CallMethod;
begin
ActionList.Add(TSWFActionCallMethod.Create);
end;
procedure TFlashActionScript.CastOp;
begin
ActionList.Add(TSWFActionCastOp.Create);
end;
procedure TFlashActionScript.CharToAscii;
begin
ActionList.Add(TSWFActionCharToAscii.Create);
end;
procedure TFlashActionScript.CloneSprite;
begin
ActionList.Add(TSWFActionCloneSprite.Create);
end;
{$IFDEF ASCompiler}
function TFlashActionScript.Compile(src: TStrings): boolean;
var S: TMemoryStream;
begin
S := TMemoryStream.Create;
src.SaveToStream(S);
Result := Compile(S);
S.Free;
end;
function TFlashActionScript.Compile(src: TStream): boolean;
begin
try
src.Position := 0;
owner.ASCompiler.CompileAction(src, self);
Result := true;
except
on E: Exception do
begin
owner.ASCompilerLog.Write(PChar(E.Message)^, Length(E.Message));
Result := false;
end;
end;
end;
function TFlashActionScript.Compile(src: ansistring): boolean;
var S: TMemoryStream;
P: Pointer;
begin
S := TMemoryStream.Create;
P := @src[1];
S.Write(P^, length(src));
Result := Compile(S);
S.Free;
end;
function TFlashActionScript.Compile(FileName: string; unicode: boolean): boolean;
var F: TFileStream;
begin
F := TFileStream.Create(Filename, fmOpenRead);
/// if unicode - todo
Result := Compile(F);
F.free;
end;
{$ENDIF}
function TFlashActionScript.ConstantPool(Consts: array of string): TSWFActionConstantPool;
var
il: Word;
begin
Result := TSWFActionConstantPool.Create;
if (High(Consts) - Low(Consts) + 1) > 0 then
For il:=Low(Consts) to High(Consts) do Result.ConstantPool.Add(Consts[il]);
ActionList.Add(Result);
end;
function TFlashActionScript.ConstantPool(Consts: TStrings): TSWFActionConstantPool;
begin
Result := TSWFActionConstantPool.Create;
if Assigned(Consts) and (Consts.Count > 0) then
Result.ConstantPool.AddStrings(Consts);
ActionList.Add(Result);
end;
procedure TFlashActionScript.Decrement;
begin
ActionList.Add(TSWFActionDecrement.Create);
end;
function TFlashActionScript.DefineFunction(Name: string; Params: array of string): TSWFActionDefineFunction;
var
il: Word;
begin
Result := TSWFActionDefineFunction.Create;
Result.FunctionName := Name;
if (High(Params) - Low(Params) + 1) > 0 then
For il:=Low(Params) to High(Params) do Result.Params.Add(Params[il]);
ActionList.Add(Result);
end;
function TFlashActionScript.DefineFunction(Name: string; Params: TStrings): TSWFActionDefineFunction;
begin
Result := TSWFActionDefineFunction.Create;
Result.FunctionName := Name;
if (Params <> nil) and (Params.Count > 0) then
Result.Params.AddStrings(Params);
ActionList.Add(Result);
end;
function TFlashActionScript.DefineFunction2(Name: string; Params: array of string; RegistersAllocate: byte):
TSWFActionDefineFunction2;
var
il: Word;
begin
Result := TSWFActionDefineFunction2.Create;
Result.FunctionName := Name;
if (High(Params) - Low(Params) + 1) > 0 then
For il:=Low(Params) to High(Params) do Result.Parameters.Add(Params[il]);
Result.RegisterCount := RegistersAllocate;
ActionList.Add(Result);
end;
function TFlashActionScript.DefineFunction2(Name: string; Params: TStrings; RegistersAllocate: byte):
TSWFActionDefineFunction2;
begin
Result := TSWFActionDefineFunction2.Create;
Result.FunctionName := Name;
if (Params <> nil) and (Params.Count > 0) then
Result.Parameters.AddStrings(Params);
Result.RegisterCount := RegistersAllocate;
ActionList.Add(Result);
end;
procedure TFlashActionScript.DefineLocal;
begin
ActionList.Add(TSWFActionDefineLocal.Create);
end;
procedure TFlashActionScript.DefineLocal2;
begin
ActionList.Add(TSWFActionDefineLocal2.Create);
end;
procedure TFlashActionScript.Delete;
begin
ActionList.Add(TSWFActionDelete.Create);
end;
procedure TFlashActionScript.Delete2;
begin
ActionList.Add(TSWFActionDelete2.Create);
end;
procedure TFlashActionScript.Divide;
begin
ActionList.Add(TSWFActionDivide.Create);
end;
procedure TFlashActionScript.EndDrag;
begin
ActionList.Add(TSWFActionEndDrag.Create);
end;
procedure TFlashActionScript.Enumerate;
begin
ActionList.Add(TSWFActionEnumerate.Create);
end;
procedure TFlashActionScript.Enumerate2;
begin
ActionList.Add(TSWFActionEnumerate2.Create);
end;
procedure TFlashActionScript.Equals;
begin
ActionList.Add(TSWFActionEquals.Create);
end;
procedure TFlashActionScript.Equals2;
begin
ActionList.Add(TSWFActionEquals2.Create);
end;
procedure TFlashActionScript.Extends;
begin
ActionList.Add(TSWFActionExtends.Create);
end;
procedure TFlashActionScript.FSCommand(command, param: string);
begin
GetUrl('FSCommand:'+command, param);
end;
procedure TFlashActionScript.FSCommand2(Args: TStrings);
var il: integer;
begin
if Args.Count > 0 then
for il := Args.Count - 1 downto 0 do Push(Args[il]);
Push(IntToStr(Args.Count));
ActionList.Add(TSWFActionFSCommand2.Create);
end;
procedure TFlashActionScript.FSCommand2(Args: string);
var sl: TStringlist;
begin
while 0 < Pos(' ', Args) do System.Delete(Args, Pos(' ', Args), 1);
sl := TStringlist.Create;
sl.CommaText := Args;
FSCommand2(sl);
sl.Free;
end;
procedure TFlashActionScript.FSCommand2(const Args: array of Variant);
var il: integer;
begin
if (High(Args) - Low(Args) + 1) > 0 then
begin
For il:=High(Args) downto Low(Args) do Push([Args[il]], [vtString]);
Push(IntToStr(High(Args) - Low(Args) + 1));
ActionList.Add(TSWFActionFSCommand2.Create);
end;
end;
function TFlashActionScript.GetAction(index: integer): TSWFAction;
begin
Result := TSWFAction(fActionList[index]);
end;
procedure TFlashActionScript.GetMember;
begin
ActionList.Add(TSWFActionGetMember.Create);
end;
procedure TFlashActionScript.GetProperty;
begin
ActionList.Add(TSWFActionGetProperty.Create);
end;
procedure TFlashActionScript.GetProperty(targ: string; id: byte);
begin
Push([targ, id]);
GetProperty;
end;
procedure TFlashActionScript.GetTime;
begin
ActionList.Add(TSWFActionGetTime.Create);
end;
procedure TFlashActionScript.GetUrl(const Url, Target: string);
var
AUrl: TSWFActionGetUrl;
begin
AUrl := TSWFActionGetUrl.Create;
AUrl.URL := Url;
AUrl.Target := Target;
ActionList.Add(AUrl);
end;
procedure TFlashActionScript.GetUrl2(TargetFlag, VariablesFlag: boolean; SendMethod: byte);
var
AUrl: TSWFActionGetUrl2;
begin
AUrl := TSWFActionGetUrl2.Create;
AUrl.LoadTargetFlag := TargetFlag;
AUrl.LoadVariablesFlag := VariablesFlag;
AUrl.SendVarsMethod := SendMethod;
ActionList.Add(AUrl);
end;
procedure TFlashActionScript.GetVariable;
begin
ActionList.Add(TSWFActionGetVariable.Create);
end;
procedure TFlashActionScript.GetVariable(VarName: string);
begin
Push(VarName);
GetVariable;
end;
procedure TFlashActionScript.GotoAndPlay(_Label: string);
begin
Push(_Label);
GotoFrame2(true);
end;
procedure TFlashActionScript.GotoAndPlay(Frame: Word);
begin
Push(Frame);
GotoFrame2(true);
end;
procedure TFlashActionScript.GotoAndStop(_Label: string);
begin
Push(_Label);
GotoFrame2(false);
end;
procedure TFlashActionScript.GotoAndStop(Frame: Word);
begin
Push(Frame);
GotoFrame2(false);
end;
procedure TFlashActionScript.GotoFrame(N: word);
var
AGF: TSWFActionGotoFrame;
begin
AGF := TSWFActionGotoFrame.Create;
AGF.Frame := N;
ActionList.Add(AGF);
end;
procedure TFlashActionScript.GotoFrame2(Play: boolean; SceneBias: word = 0);
var
AGF: TSWFActionGotoFrame2;
begin
AGF := TSWFActionGotoFrame2.Create;
AGF.PlayFlag := Play;
AGF.SceneBias := SceneBias;
AGF.SceneBiasFlag := SceneBias > 0;
ActionList.Add(AGF);
end;
procedure TFlashActionScript.GoToLabel(FrameLabel: string);
var
A: TSWFActionGoToLabel;
begin
A := TSWFActionGoToLabel.Create;
A.FrameLabel := FrameLabel;
ActionList.Add(A);
end;
procedure TFlashActionScript.Greater;
begin
ActionList.Add(TSWFActionGreater.Create);
end;
procedure TFlashActionScript.ImplementsOp;
begin
ActionList.Add(TSWFActionImplementsOp.Create);
end;
procedure TFlashActionScript.Increment;
begin
ActionList.Add(TSWFActionIncrement.Create);
end;
procedure TFlashActionScript.InitArray;
begin
ActionList.Add(TSWFActionInitArray.Create);
end;
procedure TFlashActionScript.InitObject;
begin
ActionList.Add(TSWFActionInitObject.Create);
end;
procedure TFlashActionScript.InstanceOf;
begin
ActionList.Add(TSWFActionInstanceOf.Create);
end;
function TFlashActionScript.Jump: TSWFActionJump;
begin
Result := TSWFActionJump.Create;
ActionList.Add(Result);
end;
procedure TFlashActionScript.Less;
begin
ActionList.Add(TSWFActionLess.Create);
end;
procedure TFlashActionScript.Less2;
begin
ActionList.Add(TSWFActionLess2.Create);
end;
function TFlashActionScript.LoadMovie(URL, Target: string;
IsBrowserTarget: boolean = false; Method: byte = svmNone): TSWFActionGetUrl2;
begin
Push([URL, Target], [vtString, vtString]);
Result := TSWFActionGetUrl2.Create;
Result.SendVarsMethod := Method;
Result.LoadTargetFlag := not IsBrowserTarget;
ActionList.Add(Result)
end;
function TFlashActionScript.LoadMovieNum(URL: string; Level: word; Method: byte): TSWFActionGetUrl2;
begin
Push([URL, '_level'+IntToStr(Level)], [vtString, vtString]);
Result := TSWFActionGetUrl2.Create;
Result.SendVarsMethod := Method;
ActionList.Add(Result)
end;
function TFlashActionScript.LoadVariables(URL, Target: string; Method: byte = svmNone): TSWFActionGetUrl2;
begin
Push([URL, Target], [vtString, vtString]);
Result := TSWFActionGetUrl2.Create;
Result.SendVarsMethod := Method;
Result.LoadTargetFlag := true;
Result.LoadVariablesFlag := true;
ActionList.Add(Result)
end;
function TFlashActionScript.LoadVariablesNum(URL: string; Level: word; Method: byte = svmNone): TSWFActionGetUrl2;
begin
Push([URL, '_level'+IntToStr(Level)], [vtString, vtString]);
Result := TSWFActionGetUrl2.Create;
Result.SendVarsMethod := Method;
Result.LoadVariablesFlag := true;
ActionList.Add(Result)
end;
procedure TFlashActionScript.MBAsciiToChar;
begin
ActionList.Add(TSWFActionMBAsciiToChar.Create);
end;
procedure TFlashActionScript.MBCharToAscii;
begin
ActionList.Add(TSWFActionMBCharToAscii.Create);
end;
procedure TFlashActionScript.MBStringExtract;
begin
ActionList.Add(TSWFActionMBStringExtract.Create);
end;
procedure TFlashActionScript.MBStringLength;
begin
ActionList.Add(TSWFActionMBStringLength.Create);
end;
function TFlashActionScript.MinVersion: Byte;
var
il: Word;
begin
Result := SWFVer1;
if ActionList.Count>0 then
for il:= 0 to ActionList.Count - 1 do
if Result < Action[il].MinVersion then
Result:= Action[il].MinVersion;
end;
procedure TFlashActionScript.Modulo;
begin
ActionList.Add(TSWFActionModulo.Create);
end;
procedure TFlashActionScript.Multiply;
begin
ActionList.Add(TSWFActionMultiply.Create);
end;
procedure TFlashActionScript.NewMethod;
begin
ActionList.Add(TSWFActionNewMethod.Create);
end;
procedure TFlashActionScript.NewObject;
begin
ActionList.Add(TSWFActionNewObject.Create);
end;
procedure TFlashActionScript.NextFrame;
begin
ActionList.Add(TSWFActionNextFrame.Create);
end;
procedure TFlashActionScript.Operation(op: string);
var
A: TSWFAction;
il: Integer;
begin
A := nil;
For il := 0 to 3 do
if op = ActionOperation[il] then
case il of
0: A := TSWFActionAdd2.Create;
1: A := TSWFActionSubtract.Create;
2: A := TSWFActionMultiply.Create;
3: A := TSWFActionDivide.Create;
4: A := TSWFActionAnd.Create;
5: A := TSWFActionOr.Create;
6: A := TSWFActionNot.Create;
7: A := TSWFActionIncrement.Create;
8: A := TSWFActionDecrement.Create;
end;
if A<>nil then fActionList.Add(A);
end;
procedure TFlashActionScript.Play;
begin
ActionList.Add(TSWFActionPlay.Create);
end;
procedure TFlashActionScript.Pop;
begin
ActionList.Add(TSWFActionPop.Create);
end;
procedure TFlashActionScript.PreviousFrame;
begin
ActionList.Add(TSWFActionPreviousFrame.Create);
end;
function TFlashActionScript.Push(const Args: array of Variant): TSWFActionPush;
var
AP: TSWFActionPush;
il: LongInt;
begin
if (fActionList.Count>0) and
(Action[fActionList.Count - 1].ActionCode = ActionPush) then
AP := TSWFActionPush(fActionList[fActionList.Count - 1]) else AP := nil;
if AP = nil then
begin
AP := TSWFActionPush.Create;
ActionList.Add(AP);
end;
For il := Low(Args) to High(Args) do
AP.AddValue(Args[il]);
Result :=AP;
end;
function TFlashActionScript.Push(const Args: array of Variant; const Types: array of TSWFValueType): TSWFActionPush;
var
AP: TSWFActionPush;
il: LongInt;
begin
if (fActionList.Count>0) and
(Action[fActionList.Count - 1].ActionCode = ActionPush) then
AP := TSWFActionPush(fActionList[fActionList.Count - 1]) else AP := nil;
if AP = nil then
begin
AP := TSWFActionPush.Create;
ActionList.Add(AP);
end;
For il := Low(Args) to High(Args) do
AP.ValueInfo[AP.AddValue(Args[il])].ValueType := Types[il];
Result := AP;
end;
function TFlashActionScript.Push(Value: Variant): TSWFActionPush;
begin
Result := Push([Value]);
end;
procedure TFlashActionScript.PushConstant(Value: word);
begin
PushConstant([Value]);
end;
procedure TFlashActionScript.PushConstant(const Args: array of word);
var
AP: TSWFActionPush;
il: LongInt;
begin
if (fActionList.Count>0) and
(Action[fActionList.Count - 1].ActionCode = ActionPush) then
AP := TSWFActionPush(fActionList[fActionList.Count - 1]) else AP := nil;
if AP = nil then
begin
AP := TSWFActionPush.Create;
ActionList.Add(AP);
end;
For il := Low(Args) to High(Args) do
with AP.ValueInfo[AP.AddValue(Args[il])] do
if Args[il] <= $FF then ValueType := vtConstant8 else ValueType := vtConstant16;
end;
procedure TFlashActionScript.PushDuplicate;
begin
ActionList.Add(TSWFActionPushDuplicate.Create);
end;
procedure TFlashActionScript.PushRegister(const Args: array of Word);
var
AP: TSWFActionPush;
il: LongInt;
begin
if (fActionList.Count>0) and
(Action[fActionList.Count - 1].ActionCode = ActionPush) then
AP := TSWFActionPush(fActionList[fActionList.Count - 1]) else AP := nil;
if AP = nil then
begin
AP := TSWFActionPush.Create;
ActionList.Add(AP);
end;
For il := Low(Args) to High(Args) do
AP.ValueInfo[AP.AddValue(Args[il])].ValueType := vtRegister ;
end;
procedure TFlashActionScript.PushRegister(Value: Word);
begin
PushRegister([Value]);
end;
procedure TFlashActionScript.Random;
begin
RandomNumber;
end;
procedure TFlashActionScript.Random(max: dword);
begin
Push(max);
RandomNumber;
end;
procedure TFlashActionScript.Random(min, max: dword);
begin
Push([min, max]);
RandomNumber;
StackSwap;
Operation('-');
end;
procedure TFlashActionScript.RandomNumber;
begin
ActionList.Add(TSWFActionRandomNumber.Create);
end;
procedure TFlashActionScript.RemoveSprite;
begin
ActionList.Add(TSWFActionRemoveSprite.Create);
end;
procedure TFlashActionScript.Return;
begin
ActionList.Add(TSWFActionReturn.Create);
end;
procedure TFlashActionScript.SetArray(const name: string; const Args: array of Variant; inSprite: boolean = false);
var il: integer;
begin
Push(Name);
for il := High(Args) downto Low(Args) do push(Args[il]);
Push(High(Args) - Low(Args) + 1);
InitArray;
if inSprite then DefineLocal
else SetVariable;
end;
function TFlashActionScript.SetMarker(M: TSWFOffsetMarker = nil; ToBack: boolean = false): TSWFOffsetMarker;
begin
if M = nil then
begin
Result := TSWFOffsetMarker.Create;
Result.JumpToBack := true;
end else
begin
Result := M;
Result.JumpToBack := ToBack;
end;
Result.isUsing := true;
ActionList.Add(Result);
end;
procedure TFlashActionScript.SetMember;
begin
ActionList.Add(TSWFActionSetMember.Create);
end;
procedure TFlashActionScript.SetProperty;
begin
ActionList.Add(TSWFActionSetProperty.Create);
end;
procedure TFlashActionScript.SetProperty(targ: string; id: byte);
begin
Push([targ, id]);
SetProperty;
end;
procedure TFlashActionScript.SetTarget(TargetName: string);
var
A: TSWFActionSetTarget;
begin
A := TSWFActionSetTarget.Create;
A.TargetName := TargetName;
ActionList.Add(A);
end;
procedure TFlashActionScript.SetTarget2;
begin
ActionList.Add(TSWFActionSetTarget2.Create);
end;
procedure TFlashActionScript.SetVar(VarName: string; Value: Variant; inSprite: boolean = false);
var
AP: TSWFActionPush;
begin
AP := TSWFActionPush.Create;
AP.AddValue(VarName);
AP.AddValue(Value);
ActionList.Add(AP);
if inSprite then DefineLocal
else SetVariable;
end;
procedure TFlashActionScript.SetVariable;
var
ASV: TSWFActionSetVariable;
begin
ASV := TSWFActionSetVariable.Create;
ActionList.Add(ASV);
end;
procedure TFlashActionScript.StackSwap;
begin
fActionList.Add(TSWFActionStackSwap.Create);
end;
procedure TFlashActionScript.StartDrag;
begin
ActionList.Add(TSWFActionStartDrag.Create);
end;
procedure TFlashActionScript.Stop;
begin
ActionList.Add(TSWFActionStop.Create);
end;
procedure TFlashActionScript.StopSounds;
begin
ActionList.Add(TSWFActionStopSounds.Create);
end;
procedure TFlashActionScript.StoreRegister(Num: byte);
var
A: TSWFActionStoreRegister;
begin
A := TSWFActionStoreRegister.Create;
A.RegisterNumber := Num;
ActionList.Add(A);
end;
procedure TFlashActionScript.StrictEquals;
begin
ActionList.Add(TSWFActionStrictEquals.Create);
end;
procedure TFlashActionScript.StringAdd;
begin
ActionList.Add(TSWFActionStringAdd.Create);
end;
procedure TFlashActionScript.StringEquals;
begin
ActionList.Add(TSWFActionStringEquals.Create);
end;
procedure TFlashActionScript.StringExtract;
begin
ActionList.Add(TSWFActionStringExtract.Create);
end;
procedure TFlashActionScript.StringGreater;
begin
ActionList.Add(TSWFActionStringGreater.Create);
end;
procedure TFlashActionScript.StringLength;
begin
ActionList.Add(TSWFActionStringLength.Create);
end;
procedure TFlashActionScript.StringLess;
begin
ActionList.Add(TSWFActionStringLess.Create);
end;
procedure TFlashActionScript.Subtract;
begin
ActionList.Add(TSWFActionSubtract.Create);
end;
procedure TFlashActionScript.TargetPath;
begin
ActionList.Add(TSWFActionTargetPath.Create);
end;
procedure TFlashActionScript.Throw;
begin
ActionList.Add(TSWFActionThrow.Create);
end;
procedure TFlashActionScript.ToggleQuality;
begin
ActionList.Add(TSWFActionToggleQuality.Create);
end;
procedure TFlashActionScript.ToInteger;
begin
ActionList.Add(TSWFActionToInteger.Create);
end;
procedure TFlashActionScript.ToNumber;
begin
ActionList.Add(TSWFActionToNumber.Create);
end;
procedure TFlashActionScript.ToString;
begin
ActionList.Add(TSWFActionToString.Create);
end;
procedure TFlashActionScript.Trace;
begin
ActionList.Add(TSWFActionTrace.Create);
end;
procedure TFlashActionScript.TypeOf;
begin
ActionList.Add(TSWFActionTypeOf.Create);
end;
procedure TFlashActionScript.WaitForFrame(Frame: Word; SkipCount: Byte);
var
A: TSWFActionWaitForFrame;
begin
A := TSWFActionWaitForFrame.Create;
A.Frame := Frame;
A.SkipCount := SkipCount;
ActionList.Add(A);
end;
procedure TFlashActionScript.WaitForFrame2;
begin
ActionList.Add(TSWFActionWaitForFrame2.Create.Create);
end;
procedure TFlashActionScript.WriteToStream(be: TBitsEngine);
begin
with TSWFDoAction.Create(fActionList) do
begin
WriteToStream(be);
free;
end;
end;
procedure TFlashActionScript._And;
begin
ActionList.Add(TSWFActionAnd.Create);
end;
function TFlashActionScript._If: TSWFActionIf;
begin
Result := TSWFActionIf.Create;
ActionList.Add(Result);
end;
procedure TFlashActionScript._Not;
begin
ActionList.Add(TSWFActionNot.Create);
end;
procedure TFlashActionScript._Or;
begin
ActionList.Add(TSWFActionOr.Create);
end;
function TFlashActionScript._Try: TSWFActionTry;
begin
Result := TSWFActionTry.Create;
ActionList.Add(Result);
end;
function TFlashActionScript._With: TSWFActionWith;
begin
Result := TSWFActionWith.Create;
ActionList.Add(Result);
end;
{
**************************************************** TFlashVisualObject *****************************************************
}
procedure TFlashVisualObject.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashVisualObject(Source) do
begin
self.IgnoreMovieSettings := IgnoreMovieSettings;
self.fXCenter := fXCenter;
self.fYCenter := fYCenter;
end;
end;
function TFlashVisualObject.GetMultCoord: Byte;
begin
if IgnoreMovieSettings or (owner = nil) then Result := 1
else Result := Owner.MultCoord;
end;
// =============================================================//
// TFlashShape //
// =============================================================//
const
CEllipse1 = 0.1465;
CEllipse2 = 0.2070;
CEllipse3: array [0..7, 0..3] of Shortint =
(( 0, 1, -1, 1),
(-1, 1, -1, 0),
(-1, 0, -1, -1),
(-1, -1, 0, -1),
( 0, -1, 1, -1),
( 1, -1, 1, 0),
( 1, 0, 1, 1),
( 1, 1, 0, 1));
type
TLineInfo = record
X: LongInt;
Y: LongInt;
a: Double;
b: Double;
isVertical: Boolean;
end;
{
******************************************************** TFlashEdges ********************************************************
}
constructor TFlashEdges.Create(List: TObjectList);
begin
ListEdges := List;
StartNewStyle;
FCurrentPos := Point(0, 0);
OptimizeMode := false;
end;
destructor TFlashEdges.Destroy;
begin
inherited;
end;
function TFlashEdges.AddChangeStyle: TSWFStyleChangeRecord;
begin
With ListEdges do
if (Count > 0) and
(TSWFShapeRecord(Items[Count-1]).ShapeRecType = StyleChangeRecord)
then
Result := TSWFStyleChangeRecord(Items[Count-1])
else
begin
Result := TSWFStyleChangeRecord.Create;
Add(Result);
end;
end;
procedure TFlashEdges.CloseAllConturs;
var il, ils: longint;
SPoint, CPoint: TPoint;
L: TSWFStraightEdgeRecord;
begin
if ListEdges.Count > 0 then
begin
il := 0;
ils := 0;
while il < ListEdges.Count do
begin
case TSWFShapeRecord(ListEdges.Items[il]).ShapeRecType of
StyleChangeRecord:
begin
if ((ils + 1) < il) and (SPoint.X <> CPoint.X) and (SPoint.Y <> CPoint.Y) then
begin
L := TSWFStraightEdgeRecord.Create;
ListEdges.Insert(il, L);
L.X := SPoint.X - CPoint.X;
L.Y := SPoint.Y - CPoint.Y;
end;
with TSWFStraightEdgeRecord(ListEdges[il]) do
CPoint := Point(X, Y);
SPoint := CPoint;
ils := il;
end;
StraightEdgeRecord:
with TSWFStraightEdgeRecord(ListEdges[il]) do
begin
CPoint.X := CPoint.X + X;
CPoint.Y := CPoint.Y + Y;
end;
CurvedEdgeRecord:
with TSWFCurvedEdgeRecord(ListEdges[il]) do
begin
CPoint.X := CPoint.X + ControlX + AnchorX;
CPoint.Y := CPoint.Y + ControlY + AnchorY;
end;
end;
inc(il);
end;
end;
end;
procedure TFlashEdges.CloseShape;
var
ISet: Boolean;
begin
if (CurrentPos.X <> LastStart.X) or (CurrentPos.Y <> LastStart.Y) then
begin
ISet := IgnoreMovieSettings;
IgnoreMovieSettings := true;
LineTo(LastStart.X, LastStart.Y);
IgnoreMovieSettings := ISet;
end;
end;
procedure TFlashEdges.CopyFrom(Source: TFlashEdges);
begin
CopyShapeRecords(Source.ListEdges, ListEdges);
end;
function TFlashEdges.CurveDelta(ControlX, ControlY, AnchorX, AnchorY: longint): TSWFCurvedEdgeRecord;
var
FCPos: TPoint;
procedure ResultNil(X, Y: longint);
var ISet: boolean;
begin
ISet := IgnoreMovieSettings;
IgnoreMovieSettings := true;
LineDelta(X, Y);
IgnoreMovieSettings := ISet;
Result.Free;
Result := nil;
end;
begin
Result := TSWFCurvedEdgeRecord.Create;
Result.ControlX := ControlX * MultCoord;
Result.ControlY := ControlY * MultCoord;
Result.AnchorX := AnchorX * MultCoord;
Result.AnchorY := AnchorY * MultCoord;
FCPos := Point(FCurrentPos.X + Result.ControlX + Result.AnchorX,
FCurrentPos.Y + Result.ControlY + Result.AnchorY);
if ((Result.ControlX = 0) and (Result.ControlY = 0)) then
begin
ResultNil(Result.AnchorX, Result.AnchorY);
end else
if ((Result.AnchorX = 0) and (Result.AnchorY = 0)) then
begin
ResultNil(Result.ControlX, Result.ControlY);
end else
if ((Result.ControlY = 0) and (Result.AnchorY = 0)) then
begin
ResultNil(Result.AnchorX + Result.ControlX, 0);
end else
if ((Result.ControlX = 0) and (Result.AnchorX = 0)) then
begin
ResultNil(0, Result.AnchorY + Result.ControlY);
end else
ListEdges.Add(Result);
FCurrentPos := FCPos;
end;
function TFlashEdges.CurveTo(ControlX, ControlY, AnchorX, AnchorY: longint): TSWFCurvedEdgeRecord;
var
tmpP: TPoint;
procedure ResultNil(X, Y: longint);
var ISet: boolean;
begin
ISet := IgnoreMovieSettings;
IgnoreMovieSettings := true;
LineDelta(X, Y);
IgnoreMovieSettings := ISet;
Result.Free;
Result := nil;
end;
begin
if ((AnchorX * MultCoord) = FCurrentPos.X) and
((AnchorY *MultCoord ) = FCurrentPos.Y) then Exit;
Result := TSWFCurvedEdgeRecord.Create;
tmpP := Point(ControlX * MultCoord, ControlY * MultCoord);
Result.ControlX := tmpP.X - CurrentPos.X;
Result.ControlY := tmpP.Y - CurrentPos.Y;
Result.AnchorX := (AnchorX - ControlX) * MultCoord;
Result.AnchorY := (AnchorY - ControlY) * MultCoord;
if ((Result.ControlX = 0) and (Result.ControlY = 0)) then
begin
ResultNil(Result.AnchorX, Result.AnchorY);
end else
if ((Result.AnchorX = 0) and (Result.AnchorY = 0)) then
begin
ResultNil(Result.ControlX, Result.ControlY);
end else
if ((Result.ControlY = 0) and (Result.AnchorY = 0)) then
begin
ResultNil(Result.AnchorX + Result.ControlX, 0);
end else
if ((Result.ControlX = 0) and (Result.AnchorX = 0)) then
begin
ResultNil(0, Result.AnchorY + Result.ControlY);
end else
ListEdges.Add(Result);
FCurrentPos := Point(AnchorX * MultCoord, AnchorY * MultCoord);
end;
function TFlashEdges.EndEdges: TSWFEndShapeRecord;
begin
Result := TSWFEndShapeRecord.Create;
ListEdges.Add(Result);
end;
function TFlashEdges.FindLastChangeStyle: TSWFStyleChangeRecord;
var
SearchState: Boolean;
il: Word;
begin
Result := nil;
with ListEdges do
if (Count>0) then
begin
SearchState := true;
il := count - 1;
while SearchState do
begin
if TSWFShapeRecord(Items[il]).ShapeRecType = StyleChangeRecord then
begin
Result := TSWFStyleChangeRecord(Items[il]);
SearchState := false;
end;
if il = 0 then SearchState := false else dec(il);
end;
end;
end;
function TFlashEdges.GetBoundsRect: TRect;
var
il: Word;
rX, rY: LongInt;
procedure fCompare;
begin
if Result.Left > rX then Result.Left := rX;
if Result.Right < rX then Result.Right := rX;
if Result.Top > rY then Result.Top := rY;
if Result.Bottom < rY then Result.Bottom := rY;
end;
begin
if ListEdges.Count = 0 then Result := Rect(0,0,0,0)
else
begin
With TSWFStraightEdgeRecord(ListEdges[0]) do
Result := Rect(X, Y, X, Y);
rX := 0;
rY := 0;
if ListEdges.Count > 1 then
for il := 0 to ListEdges.Count - 1 do
case TSWFShapeRecord(ListEdges[il]).ShapeRecType of
StyleChangeRecord:
With TSWFStraightEdgeRecord(ListEdges[il]) do
begin
rX := X;
rY := Y;
fCompare;
end;
StraightEdgeRecord:
With TSWFStraightEdgeRecord(ListEdges[il]) do
begin
rX := rX + X;
rY := rY + Y;
fCompare;
end;
CurvedEdgeRecord:
With TSWFCurvedEdgeRecord(ListEdges[il]) do
begin
rX := rX + ControlX;
rY := rY + ControlY;
fCompare;
rX := rX + AnchorX;
rY := rY + AnchorY;
fCompare;
end;
end;
end;
end;
function TFlashEdges.isClockWise: boolean;
var il: word;
rX1, rY1, rX2, rY2, rX3, rY3, res, acount: longint;
function orientation(X1, Y1, X2, Y2, X3, Y3: longint): longint;
begin
Result := (X1 - X3)*(Y2 - Y3) - (Y1 - Y3)*(X2 - X3);
end;
begin
Result := true;
acount := 0;
if ListEdges.Count <= 2 then exit;
for il := 0 to ListEdges.Count - 1 do
case TSWFShapeRecord(ListEdges[il]).ShapeRecType of
StyleChangeRecord:
With TSWFStraightEdgeRecord(ListEdges[il]) do
begin
rX1 := X;
rY1 := Y;
end;
StraightEdgeRecord:
With TSWFStraightEdgeRecord(ListEdges[il]) do
begin
if il > 1 then
begin
rX3 := rX2 + X;
rY3 := rY2 + Y;
res := orientation(rX1, rY1, rX2, rY2, rX3, rY3);
if res > 0 then Inc(acount) else
if res < 0 then dec(acount);
rX1 := rX2;
rY1 := rY2;
rX2 := rX3;
rY2 := rY3;
end else
begin
rX2 := rX1 + X;
rY2 := rY1 + Y;
end;
end;
CurvedEdgeRecord:
With TSWFCurvedEdgeRecord(ListEdges[il]) do
begin
if il > 1 then
begin
rX3 := rX2 + ControlX + AnchorX;
rY3 := rY2 + ControlY + AnchorY;
res := orientation(rX1, rY1, rX2, rY2, rX3, rY3);
if res > 0 then Inc(acount) else
if res < 0 then dec(acount);
rX1 := rX2;
rY1 := rY2;
rX2 := rX3;
rY2 := rY3;
end else
begin
rX2 := ControlX + AnchorX;
rY2 := ControlY + AnchorY;
end;
end;
end;
Result := acount > 0;
end;
function TFlashEdges.GetMultCoord: Byte;
begin
if IgnoreMovieSettings or (owner = nil) then Result := 1
else Result := Owner.MultCoord;
end;
function TFlashEdges.hasAddMoveTo(DX, DY: integer): boolean;
var
Prev: TSWFStraightEdgeRecord;
begin
Result := true;
if OptimizeMode and (ListEdges.Count > 0) and
(TSWFShapeRecord(ListEdges.Items[ListEdges.Count-1]).ShapeRecType = StraightEdgeRecord) then
begin
Prev := TSWFStraightEdgeRecord(ListEdges.Items[ListEdges.Count-1]);
if (Prev.X = 0) and (DX = 0) and
(((Prev.Y < 0) and (DY < 0)) or ((Prev.Y > 0) and (DY > 0))) and
(Abs(Prev.Y + DY) < $FFFF) then
begin
Result := false;
Prev.Y := Prev.Y + DY;
end else
if (Prev.Y = 0) and (DY = 0) and
(((Prev.X < 0) and (DX < 0)) or ((Prev.X > 0) and (DX > 0))) and
(Abs(Prev.X + DX) < $FFFF) then
begin
Result := false;
Prev.X := Prev.X + DX;
end else
if (Prev.X = DX) and (Prev.Y = DY) and (Round(Hypot(2*DX, 2*DY)) < $FFFF) then
begin
Result := false;
Prev.X := Prev.X + DX;
Prev.Y := Prev.Y + DY;
end;
end;
end;
function TFlashEdges.LineDelta(DX, DY: longint): TSWFStraightEdgeRecord;
var
countX, countY, il: Byte;
hasAdd: boolean;
begin
Result := nil;
if (DX = 0) and (DY = 0) then Exit;
DX := DX * MultCoord;
DY := DY * MultCoord;
hasAdd := hasAddMoveTo(DX, DY);
if hasAdd then
begin
// Flash noshow line large $FFFF twips. Fixed it.
countX := Ceil(Abs(DX) / $FFFF);
countY := Ceil(Abs(DY) / $FFFF);
if countX < countY then countX := countY;
for il := 1 to countX do
begin
Result := TSWFStraightEdgeRecord.Create;
Result.X := Round(DX / countX * il) - Round(DX / countX * (il - 1));
Result.Y := Round(DY / countX * il) - Round(DY / countX * (il - 1));
ListEdges.Add(Result);
end;
end;
FCurrentPos := Point(CurrentPos.X + DX, CurrentPos.Y + DY);
end;
function TFlashEdges.LineTo(X, Y: longint): TSWFStraightEdgeRecord;
var
tmpP: TPoint;
countX, countY, il: Byte;
hasAdd: boolean;
DX, DY: integer;
begin
tmpP := point(X * MultCoord, Y * MultCoord);
Result := nil;
DX := tmpP.X - CurrentPos.X;
DY := tmpP.Y - CurrentPos.Y;
if (DX <> 0) or (DY <> 0) then
begin
hasAdd := hasAddMoveTo(DX, DY);
if hasAdd then
begin
countX := Ceil(Abs(DX) / $FFFF);
countY := Ceil(Abs(DY) / $FFFF);
if countX < countY then countX := countY;
for il := 1 to countX do
begin
Result := TSWFStraightEdgeRecord.Create;
Result.X := Round((tmpP.X - CurrentPos.X) / countX * il) -
Round((tmpP.X - CurrentPos.X) / countX * (il - 1));
Result.Y := Round((tmpP.Y - CurrentPos.Y) / countX * il) -
Round((tmpP.Y - CurrentPos.Y) / countX * (il - 1)) ;
ListEdges.Add(Result);
end;
end;
FCurrentPos := tmpP;
end;
end;
function TFlashEdges.LineTo(P: TPoint): TSWFStraightEdgeRecord;
begin
Result := LineTo(P.X, P.Y)
end;
procedure TFlashEdges.MakeArc(XC, YC: longInt; RadiusX, RadiusY: longint; StartAngle, EndAngle: single; closed: boolean =
true; clockwise: boolean = true);
var
Steps: Byte;
il, ClckWs: Integer;
P0, P1, P2, PStart: TPoint;
rad, StepsA, GipX, GipY: Double;
ChangeI: Boolean;
begin
if clockwise then ClckWs:=1 else ClckWs:=-1;
if MultCoord = twips then
begin
RadiusX := RadiusX * twips;
RadiusY := RadiusY * twips;
XC := XC * twips;
YC := YC * twips;
IgnoreMovieSettings := true;
ChangeI := true;
end else ChangeI := false;
if EndAngle < StartAngle then EndAngle := EndAngle + 360;
Steps := Ceil((EndAngle - StartAngle) / 45);
StepsA := (EndAngle - StartAngle) / Steps;
GipX := RadiusX / cos(DegToRad(StepsA / 2));
GipY := RadiusY / cos(DegToRad(StepsA / 2));
// StartAngle:=StartAngle+360;
il := 0;
Repeat
rad := ClckWs*DegToRad(StartAngle + (il * StepsA));
P0.X := XC + Trunc(cos( rad ) * RadiusX);
P0.Y := YC +Trunc(sin( rad ) * RadiusY);
if il = 0 then
begin
MoveTo(P0.X, P0.Y);
PStart := P0;
end else
begin
rad := rad - ClckWs*DegToRad (StepsA / 2);
P1.X := XC +Trunc(cos( rad ) * GipX);
P1.Y := YC +Trunc(sin( rad ) * GipY);
CurveDelta(P1.X - P2.X, P1.Y - P2.Y, P0.X - P1.X , P0.Y - P1.Y);
end;
inc(il);
if il <= Steps then P2 := P0;
Until il > Steps;
if closed then
LineDelta(PStart.X - P0.X, PStart.Y - P0.Y);
if ChangeI then IgnoreMovieSettings := false;
FCurrentPos.X:=P0.X div MultCoord;
FCurrentPos.Y:=P0.Y div MultCoord;
end;
procedure TFlashEdges.MakeArc(XC, YC: longInt; Radius: longint; StartAngle, EndAngle: single; closed: boolean = true);
begin
MakeArc(XC, YC, Radius, Radius, StartAngle, EndAngle, closed);
end;
procedure TFlashEdges.MakeCubicBezier(P1, P2, P3: TPoint; parts: byte = 4);
var
fP0, fP1, fP2, fP3: TPoint;
il: Byte;
PartsStep: Single;
CurT, NextT: TLineInfo;
function getCubicDerivative(c0, c1, c2, c3: longint; t: single): longint;
var g, b: double;
begin
g := 3 * (c1 - c0);
b := (3 * (c2 - c1)) - g;
Result := Round(3*(c3 - c0 - b - g)*t*t + 2*b*t + g);
end;
Function GetLineDef(P1, P2: TPoint): TLineInfo;
begin
Result.X := P1.X;
Result.Y := P1.Y;
if P1.X = P2.X then
begin
Result.isVertical := true;
Result.a := $FFFFFFF;
end else
begin
Result.a := (P1.Y - P2.Y) / (P1.X - P2.X);
Result.b := P1.Y - (Result.a * P1.X);
Result.isVertical := false;
end;
end;
Function GetLineDef2(P, V: TPoint): TLineInfo;
begin
Result.X := P.X;
Result.Y := P.Y;
if V.X = 0 then
begin
Result.isVertical := true;
Result.a := $FFFFFFF;
end else
begin
Result.a := V.y / V.x;
Result.b := P.y - (Result.a * P.X);
Result.isVertical := false;
end;
end;
function getCubicTangent(t: single): TLineInfo;
var tmpP: TPoint;
begin
Result.X := Round(GetCubicPoint(fp0.x, fp1.x, fp2.x, fp3.x, t));
Result.Y := Round(GetCubicPoint(fp0.y, fp1.y, fp2.y, fp3.y, t));
tmpP.X := getCubicDerivative(fp0.x, fp1.x, fp2.x, fp3.x, t);
tmpP.Y := getCubicDerivative(fp0.y, fp1.y, fp2.y, fp3.y, t);
Result := GetLineDef2(Point(Result.X, Result.Y), tmpP);
end;
function GetLinesCrossing(L1, L2: TLineInfo; var Cross: TPoint): boolean;
begin
Result := true;
if ((L1.isVertical and L2.isVertical)) or (L1.a = L2.a) then Result := false
else
if L1.isVertical then
begin
Cross.X := L1.X;
Cross.Y := Round(L2.a * Cross.X + L2.b);
end else
if L2.isVertical then
begin
Cross.X := L2.X;
Cross.Y := Round(L1.a * Cross.X + L1.b);
end else
begin
Cross.X := Round((L2.b - L1.b) / (L1.a - L2.a));
Cross.Y := Round(L1.a * Cross.X + L1.b);
end;
end;
Function GetDistance(P1, P2: TPoint): longint;
begin
result := Round(Hypot(P2.X - P1.X, P2.Y - P1.Y));
end;
Procedure SliceSegment (u1, u2: double; L1, L2: TLineInfo; recurs: byte);
var cross: TPoint;
D: longint;
isExit: boolean;
uMid: double;
LMid: TLineInfo;
begin
isExit := true;
if (recurs > 10) then
begin
LineTo(L2.x, L2.y);
end else
if GetLinesCrossing(L1, L2, cross) then
begin
D := round(Hypot(L2.X - L1.X, L2.Y - L1.Y));
isExit := not ((D < GetDistance(Point(L1.X, L1.Y), cross)) or (D < GetDistance(Point(L2.X, L2.Y), cross)));
end else isExit := false;
if not isExit then
begin
uMid := (u1 + u2) / 2;
LMid := getCubicTangent(uMid);
SliceSegment(u1, uMid, L1, LMid, recurs+1);
SliceSegment(uMid, u2, LMid, L2, recurs+1);
end else CurveTo(cross.X, cross.Y, L2.X, L2.Y);
end;
begin
fP0 := CurrentPos;
fP1.X := P1.X * MultCoord;
fP1.Y := P1.Y * MultCoord;
fP2.X := P2.X * MultCoord;
fP2.Y := P2.Y * MultCoord;
fP3.X := P3.X * MultCoord;
fP3.Y := P3.Y * MultCoord;
if MultCoord = twips then IgnoreMovieSettings := true;
if parts < 1 then parts := 1;
PartsStep := 1/parts;
CurT := GetLineDef(fP0, fP1);
CurT.X := fP0.X;
CurT.Y := fP0.Y;
for il := 1 to parts do
begin
nextT := getCubicTangent( il*PartsStep);
SliceSegment((il-1)*PartsStep, il*PartsStep, curT, nextT, 0);
curT := nextT;
end;
IgnoreMovieSettings := false;
end;
procedure TFlashEdges.MakeDiamond(W, H: longint);
begin
if MultCoord = twips then
begin
W := W * twips;
H := H * twips;
IgnoreMovieSettings := true;
end;
LineDelta(W div 2, H div 2);
LineDelta(- W div 2, H div 2);
LineDelta(- W div 2, - H div 2);
LineDelta(W div 2, - H div 2);
IgnoreMovieSettings := false;
end;
procedure TFlashEdges.MakeEllipse(W, H: longint);
var
il: Byte;
begin
if MultCoord = twips then
begin
W := W * twips;
H := H * twips;
IgnoreMovieSettings := true;
end;
MoveDelta(W, H div 2);
for il := 0 to 7 do
if not Odd(il) then
CurveDelta( Trunc(CEllipse3[il, 0] * CEllipse2 * W), Trunc(CEllipse3[il, 1] * CEllipse2 * H),
Trunc(CEllipse3[il, 2] * CEllipse1 * W), Trunc(CEllipse3[il, 3] * CEllipse1 * H))
else
CurveDelta( Trunc(CEllipse3[il, 0] * CEllipse1 * W), Trunc(CEllipse3[il, 1] * CEllipse1 * H),
Trunc(CEllipse3[il, 2] * CEllipse2 * W), Trunc(CEllipse3[il, 3] * CEllipse2 * H));
IgnoreMovieSettings := false;
end;
procedure TFlashEdges.MakeMirror(Horz, Vert: boolean);
var
il: Word;
begin
if ListEdges.Count > 0 then
for il := 0 to ListEdges.Count - 1 do
case TSWFShapeRecord(ListEdges[il]).ShapeRecType of
StyleChangeRecord, StraightEdgeRecord:
With TSWFStraightEdgeRecord(ListEdges[il]) do
begin
if Horz then X := - X;
if Vert then Y := - Y;
end;
CurvedEdgeRecord:
With TSWFCurvedEdgeRecord(ListEdges[il]) do
begin
if Horz then
begin
ControlX := - ControlX;
AnchorX := - AnchorX;
end;
if Vert then
begin
ControlY := - ControlY;
AnchorY := - AnchorY;
end;
end;
end;
end;
procedure TFlashEdges.MakePie(Radius: longint; StartAngle, EndAngle: single);
begin
MakePie(Radius, Radius, StartAngle, EndAngle);
end;
procedure TFlashEdges.MakePie(RadiusX, RadiusY: longint; StartAngle, EndAngle: single; clockwise: boolean = true);
var
Steps: Byte;
il, ClckWs: Integer;
P0, P1, P2: TPoint;
rad, StepsA, GipX, GipY: Double;
begin
if clockwise then ClckWs:=1 else ClckWs:=-1;
if MultCoord = twips then
begin
RadiusY := RadiusY * twips;
RadiusX := RadiusX * twips;
IgnoreMovieSettings := true;
end;
if EndAngle < StartAngle then EndAngle := EndAngle + 360;
Steps := Ceil((EndAngle - StartAngle) / 45);
if Steps = 0 then Steps := 1;
StepsA := (EndAngle - StartAngle) / Steps;
GipX := RadiusX / cos(DegToRad(StepsA / 2));
GipY := RadiusY / cos(DegToRad(StepsA / 2));
il := 0;
Repeat
rad := ClckWs*DegToRad(StartAngle + (il * StepsA));
P0.X := Trunc(cos( rad ) * RadiusX);
P0.Y:= Trunc(sin( rad ) * RadiusY);
if il = 0 then LineDelta(P0.X, P0.Y) else
begin
rad := rad - ClckWs*DegToRad (StepsA / 2);
P1.X := Trunc(cos( rad ) * GipX);
P1.Y := Trunc(sin( rad ) * GipY);
CurveDelta(P1.X - P2.X, P1.Y - P2.Y, P0.X - P1.X , P0.Y - P1.Y);
end;
inc(il);
if il <= Steps then P2 := P0;
Until il > Steps;
LineDelta(- P0.X, -P0.Y);
IgnoreMovieSettings := false;
end;
procedure TFlashEdges.MakePolyBezier(AP: array of TPoint; Start: TPoint);
var
i, j, l: Integer;
// p: Cardinal;
begin
if (Start.X = -1) and (Start.Y = -1) Then
begin
if (CurrentPos.X <> Start.X) or (CurrentPos.Y <> Start.Y) then
MoveTo(AP[Low(AP)].X, AP[Low(AP)].Y);
l := 1;
end else
begin
if (CurrentPos.X <> Start.X) or (CurrentPos.Y <> Start.Y) then
MoveTo(Start.X, Start.Y);
l := 0;
end;
for i:=Low(AP) to ((High(AP)+1-l) div 3)-1 do
begin
{
p := ABS(AP[l+3*i].X - Start.X) + ABS(AP[l+3*i].Y - Start.Y) +
ABS(AP[l+1+3*i].X - AP[l+3*i].X) + ABS(AP[l+1+3*i].Y - AP[l+3*i].Y) +
ABS(AP[l+2+3*i].X - AP[l+1+3*i].X) + ABS(AP[l+2+3*i].Y - AP[l+1+3*i].Y);
p := (p div 50) + 1; }
MakeCubicBezier(AP[l+3*i], AP[l+1+3*i], AP[l+2+3*i]{, p});
end;
i:=(High(AP)+1-l) div 3; j:=0;
while (I*3+j)<=High(AP) do
begin
LineTo(AP[i*3+j].X, AP[3*i+j].Y);
inc(j);
end;
end;
procedure TFlashEdges.MakePolyline(AP: array of TPoint);
var
il: Integer;
begin
For il := low(AP) to High(AP) do
if il = low(AP)
then MoveTo(AP[il].X, AP[il].Y)
else LineTo(AP[il].X, AP[il].Y);
end;
procedure TFlashEdges.MakeRectangle(W, H: longint);
begin
LineDelta(W, 0);
LineDelta(0, H);
LineDelta(-W, 0);
LineDelta(0, -H);
end;
procedure TFlashEdges.MakeRoundRect(W, H, R: longint);
var
il: Byte;
D: LongInt;
begin
if MultCoord = twips then
begin
W := W * twips;
H := H * twips;
R := R * twips;
IgnoreMovieSettings := true;
end;
D := 2 * R;
MoveDelta(W, R);
for il := 0 to 7 do
begin
Case il of
0: LineDelta(0, H - D);
2: LineDelta(- (W - D), 0);
4: LineDelta(0, -(H - D));
6: LineDelta(W - 2 * R, 0);
end;
if not Odd(il) then
CurveDelta( Trunc(CEllipse3[il, 0] * CEllipse2 * D), Trunc(CEllipse3[il, 1] * CEllipse2 * D),
Trunc(CEllipse3[il, 2] * CEllipse1 * D), Trunc(CEllipse3[il, 3] * CEllipse1 * D))
else
CurveDelta( Trunc(CEllipse3[il, 0] * CEllipse1 * D), Trunc(CEllipse3[il, 1] * CEllipse1 * D),
Trunc(CEllipse3[il, 2] * CEllipse2 * D), Trunc(CEllipse3[il, 3] * CEllipse2 * D));
end;
IgnoreMovieSettings := false;
end;
procedure TFlashEdges.MakeRoundRect(W, H, RX, RY: longint);
var
il: Byte;
DX, DY: LongInt;
begin
if MultCoord = twips then
begin
W := W * twips;
H := H * twips;
RX := RX * twips;
RY := RY * twips;
IgnoreMovieSettings := true;
end;
DX := 2 * RX;
DY := 2 * RY;
MoveDelta(W, RY);
for il := 0 to 7 do
begin
Case il of
0: LineDelta(0, H - DY);
2: LineDelta(- (W - DX), 0);
4: LineDelta(0, -(H - DY));
6: LineDelta(W - DX, 0);
end;
if not Odd(il) then
CurveDelta( Trunc(CEllipse3[il, 0] * CEllipse2 * DX), Trunc(CEllipse3[il, 1] * CEllipse2 * DY),
Trunc(CEllipse3[il, 2] * CEllipse1 * DX), Trunc(CEllipse3[il, 3] * CEllipse1 * DY))
else
CurveDelta( Trunc(CEllipse3[il, 0] * CEllipse1 * DX), Trunc(CEllipse3[il, 1] * CEllipse1 * DY),
Trunc(CEllipse3[il, 2] * CEllipse2 * DX), Trunc(CEllipse3[il, 3] * CEllipse2 * DY));
end;
IgnoreMovieSettings := false;
end;
procedure TFlashEdges.MakeStar(X, Y, R1, R2: longint; NumPoint: word; curve: boolean = false);
var
il, ilc: Integer;
acur, aStep: Double;
PX, PY, cPX, cPY: LongInt;
begin
if MultCoord = twips then
begin
X := X * twips;
Y := Y * twips;
R1 := R1 * twips;
R2 := R2 * twips;
IgnoreMovieSettings := true;
end;
if NumPoint < 2 then ilc := 2 else
if NumPoint > 360 then ilc := 360 else ilc := NumPoint;
acur := - pi / 2;
aStep := pi * 2 / ilc;
MoveTo(X + Round(R1 * cos(acur)), Y + Round(R1 * sin(acur)));
for il := 1 to ilc do
begin
cPX := X + Round(R2 * cos(acur + aStep / 2));
cPY := Y + Round(R2 * sin(acur + aStep / 2));
acur := acur + aStep;
PX := X + Round(R1 * cos(acur));
PY := Y + Round(R1 * sin(acur));
if curve then CurveTo(cPX, cPY, PX, PY) else
begin
LineTo(cPX, cPY);
LineTo(PX, PY);
end;
end;
IgnoreMovieSettings := false;
end;
function TFlashEdges.MoveDelta(X, Y: longint): TSWFStyleChangeRecord;
begin
Result := AddChangeStyle;
if (X<>0) or (Y<>0) then
begin
FCurrentPos := Point(CurrentPos.X + X * MultCoord, FCurrentPos.Y + Y * MultCoord);
Result.X := CurrentPos.X;
Result.Y := CurrentPos.Y;
Result.stateMoveTo := true;
FLastStart := CurrentPos;
end;
end;
function TFlashEdges.MoveTo(X, Y: longint): TSWFStyleChangeRecord;
begin
Result := AddChangeStyle;
if (X<>CurrentPos.X) or (Y<>CurrentPos.Y) or (ListEdges.Count>1) then
begin
FCurrentPos := Point(X * MultCoord, Y * MultCoord);
Result.X := FCurrentPos.X;
Result.Y := FCurrentPos.Y;
Result.stateMoveTo := true;
FLastStart := CurrentPos;
end;
end;
procedure TFlashEdges.OffsetEdges(DX, DY: LongInt; UseSysCoord: boolean = true);
var
il: Word;
mult: byte;
begin
if UseSysCoord then mult := MultCoord
else mult := 1;
if ListEdges.Count > 0 then
for il := 0 to ListEdges.Count - 1 do
case TSWFShapeRecord(ListEdges[il]).ShapeRecType of
StyleChangeRecord:
With TSWFStraightEdgeRecord(ListEdges[il]) do
begin
X := X + DX * mult;
Y := Y + DY * mult;
end;
end;
end;
function TFlashEdges.StartNewStyle: TSWFStyleChangeRecord;
begin
Result := AddChangeStyle;
Result.StateFillStyle1 := true;
end;
function TFlashEdges.StartNewStyle(MoveToX, MoveToY: longint): TSWFStyleChangeRecord;
begin
Result := MoveTo(MoveToX, MoveToY);
Result.StateFillStyle1 := true;
end;
{
****************************************************** TFlashLineStyle ******************************************************
}
constructor TFlashLineStyle.Create;
begin
Items := TList.Create;
end;
destructor TFlashLineStyle.Destroy;
begin
Items.Free;
inherited;
end;
function TFlashLineStyle.GetCount: Byte;
begin
Result := Items.Count;
end;
function TFlashLineStyle.GetLen(Index: Integer): Byte;
begin
Result := Longint(Items[Index]);
end;
procedure TFlashLineStyle.SetCount(Value: Byte);
begin
While Items.Count < Value do Items.Add(nil);
While Items.Count > Value do Items.Delete(Items.Count - 1);
end;
procedure TFlashLineStyle.SetLen(Index: Integer; Value: Byte);
begin
Items[Index] := Pointer(LongInt(Value));
end;
procedure TFlashLineStyle.SetStyle(A: array of byte);
var
il: Byte;
begin
Count := High(A) - Low(A) + 1;
for il := Low(A) to High(A) do Len[il] := A[il];
end;
type
TCurveRec = record
crP0, crP1, crP2, crPC, crP1c: TPoint;
cru, crdu: double;
crAx, crBx, crCx, crAy, crBy, crCy: Integer;
crExitFlag: Integer;
end;
{
******************************************************** TFlashShape ********************************************************
}
constructor TFlashShape.Create(owner: TFlashMovie);
begin
inherited;
EdgesStore := TObjectList.Create;
LineStyles := TObjectList.Create;
FillStyles := TObjectList.Create;
FEdges := TFlashEdges.Create(EdgesStore);
FEdges.Owner := owner;
FBounds := TSWFRect.Create;
hasAlpha := false;
IgnoreMovieSettings := false;
ExtLineTransparent := true;
StyleChangeMode := scmFirst;
hasUseAdvancedStyles := false;
end;
destructor TFlashShape.Destroy;
begin
EdgesStore.Free;
LineStyles.Free;
FillStyles.Free;
FExtLineStyle.Free;
// FShape.Free;
FBounds.Free;
FEdges.Free;
if Assigned(FLineBgColor) then FreeAndNil(FLineBgColor);
inherited;
end;
function TFlashShape.AddChangeStyle: TSWFStyleChangeRecord;
begin
With GetListEdges do
if (Count > 0) and
(TSWFShapeRecord(Items[Count-1]).ShapeRecType = StyleChangeRecord)
then
Result := TSWFStyleChangeRecord(Items[Count-1])
else
begin
Result := TSWFStyleChangeRecord.Create;
Add(Result);
end;
end;
function TFlashShape.AddFillStyle(fill: TSWFFillStyle): TSWFFillStyle;
begin
Result := fill;
if FillStyles.IndexOf(Result) = -1
then FillStyleNum := FillStyles.Add(Result) + 1
else FillStyleNum := FillStyles.IndexOf(Result) + 1;
end;
function TFlashShape.AddLineStyle(outline: TSWFLineStyle = nil): TSWFLineStyle;
begin
if outline = nil then Result := TSWFLineStyle.Create else Result := outline;
if LineStyles.IndexOf(Result) = -1
then LineStyleNum := LineStyles.Add(Result) + 1
else LineStyleNum := LineStyles.IndexOf(Result) + 1;
end;
procedure TFlashShape.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashShape(Source) do
begin
self.FillStyleLeft := FillStyleLeft;
self.FillStyleRight := FillStyleRight;
self.LineStyleNum := LineStyleNum;
// self.fShape.Assign(fShape);
// todo
self.hasAlpha := hasAlpha;
end;
end;
procedure TFlashShape.CalcBounds;
begin
Bounds.Rect := Edges.GetBoundsRect;
end;
procedure TFlashShape.ChangeOwner;
begin
Edges.Owner := Owner;
end;
function TFlashShape.FindLastChangeStyle: TSWFStyleChangeRecord;
var
SearchState: Boolean;
il: Word;
begin
Result := nil;
with GetListEdges do
if (Count>0) then
begin
SearchState := true;
il := count - 1;
while SearchState do
begin
if TSWFShapeRecord(Items[il]).ShapeRecType = StyleChangeRecord then
begin
Result := TSWFStyleChangeRecord(Items[il]);
SearchState := false;
end;
if il = 0 then SearchState := false else dec(il);
end;
end;
end;
function TFlashShape.GetCenterX: LongInt;
begin
result := fXCenter div MultCoord;
end;
function TFlashShape.GetCenterY: LongInt;
begin
result := fYCenter div MultCoord;
end;
function TFlashShape.GetExtLineStyle: TFlashLineStyle;
begin
if FExtLineStyle = nil then FExtLineStyle := TFlashLineStyle.Create;
HasExtLineStyle := true;
Result := FExtLineStyle;
end;
function TFlashShape.GetLineBgColor: TSWFRGBA;
begin
if FLineBgColor = nil then
begin
FLineBgColor := TSWFRGBA.Create(true);
ExtLineTransparent := false;
end;
Result := FLineBgColor;
end;
function TFlashShape.GetHeight(inTwips: boolean = true): LongInt;
begin
Result := Ymax - YMin;
if inTwips then Result := Result * MultCoord;
end;
function TFlashShape.GetListEdges: TObjectList;
begin
Result := EdgesStore;
end;
function TFlashShape.GetWidth(inTwips: boolean = true): LongInt;
begin
Result := Xmax - XMin;
if inTwips then Result := Result * MultCoord;
end;
function TFlashShape.GetXMax: Integer;
begin
Result := Bounds.XMax div MultCoord;
end;
function TFlashShape.GetXMin: Integer;
begin
Result := Bounds.XMin div MultCoord;
end;
function TFlashShape.GetYMax: Integer;
begin
Result := Bounds.YMax div MultCoord;
end;
function TFlashShape.GetYMin: Integer;
begin
Result := Bounds.YMin div MultCoord;
end;
procedure TFlashShape.MakeMirror(Horz, Vert: boolean);
begin
Edges.MakeMirror(Horz, Vert);
end;
function TFlashShape.MinVersion: Byte;
begin
Result := SWFVer2 + byte(hasAlpha);
end;
procedure TFlashShape.SetCenterX(X: LongInt);
var
delta: LongInt;
begin
delta := X * MultCoord - fXCenter;
Edges.OffsetEdges(delta, 0, false);
fXCenter := X * MultCoord
end;
procedure TFlashShape.SetCenterY(Y: LongInt);
var
delta: LongInt;
begin
delta := Y * MultCoord - fYCenter;
Edges.OffsetEdges(0, delta, false);
fYCenter := Y * MultCoord
end;
procedure TFlashShape.SetFillStyleLeft(n: Word);
var
R: TSWFStyleChangeRecord;
begin
R := nil;
if StyleChangeMode = scmFirst then
With GetListEdges do
begin
if (Count > 0) and
(TSWFShapeRecord(Items[0]).ShapeRecType = StyleChangeRecord) then
R := TSWFStyleChangeRecord(Items[0]);
end else
R := FindLastChangeStyle;
if R = nil then fFillStyleLeft := 0
else
begin
fFillStyleLeft := n;
R.StateFillStyle0 := true;
R.Fill0Id := n;
end;
end;
procedure TFlashShape.SetFillStyleRight(n: Word);
var
R: TSWFStyleChangeRecord;
begin
R := nil;
if StyleChangeMode = scmFirst then
with GetListEdges do
begin
if (Count > 0) and
(TSWFShapeRecord(EdgesStore[0]).ShapeRecType = StyleChangeRecord) then
R := TSWFStyleChangeRecord(Items[0]);
end else
R := FindLastChangeStyle;
if R = nil then fFillStyleRight := 0
else
begin
fFillStyleRight := n;
R.StateFillStyle1 := true;
R.Fill1Id := n;
end;
end;
function TFlashShape.SetImageFill(img: TFlashImage; mode: TFillImageMode; ScaleX: single = 1; ScaleY: single = 1):
TSWFImageFill;
var
adds, XSc, YSc: Single;
offset: byte;
begin
Result := TSWFImageFill.Create;
Result.ImageID := img.CharacterID;
// adds & (twips div 4) - values for fixed visual bag of flash 6, 7. non document
if (owner <> nil) and (Owner.CorrectImageFill) then
begin
adds := $f0 / specFixed;
offset := twips div 4;
end else
begin
adds := 0;
offset := 0;
end;
case mode of
fmFit: begin
Result.SWFFillType := SWFFillClipBitmap;
Result.Matrix.SetTranslate(Bounds.Xmin - offset, Bounds.Ymin - offset);
XSc := GetWidth/img.Width + adds;
YSc := GetHeight/img.Height + adds;
if XSc > ($FFFF div 4) then XSc := ($FFFF div 4);
if YSc > ($FFFF div 4) then YSc := ($FFFF div 4);
Result.Matrix.SetScale(XSc, YSc);
end;
fmClip: begin
Result.SWFFillType := SWFFillClipBitmap;
Result.Matrix.SetTranslate(Bounds.Xmin - offset, Bounds.Ymin - offset);
Result.Matrix.SetScale(ScaleX * twips, ScaleY * twips);
end;
fmTile:begin
Result.SWFFillType := SWFFillTileBitmap;
Result.Matrix.SetTranslate(Bounds.Xmin - offset, Bounds.Ymin - offset);
Result.Matrix.SetScale(ScaleX * twips, ScaleY * twips);
end;
end;
AddFillStyle(Result);
if owner <> nil then
with owner.ObjectList do
if IndexOf(img) > IndexOf(self) then
Move(IndexOf(img), IndexOf(self));
end;
function TFlashShape.SetLinearGradient(Gradient: array of recRGBA; angle: single = 0): TSWFGradientFill;
var
il: Byte;
r, kX, kY: Double;
begin
Result := TSWFGradientFill.Create;
Result.Count := High(Gradient) - Low(Gradient) + 1;
For il:=1 to Result.count do
begin
Result.GradientColor[il].RGBA := Gradient[Low(Gradient) + il - 1];
if Result.GradientColor[il].A < $FF then hasAlpha := true;
Result.GradientRatio[il] := Round((il - 1) / (Result.count - 1) * $FF);
end;
r := DegToRad(angle);
kX := GetWidth /GradientSizeXY;
kY := GetHeight/GradientSizeXY;
Result.Matrix.SetScale(kX*cos(r), kY*cos(r));
Result.Matrix.SetSkew(kX*sin(r), -kY*sin(r));
Result.Matrix.SetTranslate(Bounds.Xmin + GetWidth div 2, Bounds.Ymin + GetHeight div 2);
AddFillStyle(Result);
end;
function TFlashShape.SetLinearGradient(Gradient: array of TSWFGradientRec; angle: single = 0): TSWFGradientFill;
var
il: Byte;
r, kX, kY: Double;
begin
Result := TSWFGradientFill.Create;
Result.Count := High(Gradient) - Low(Gradient) + 1;
if Result.Count > 8 then Result.Count := 8;
For il:=1 to Result.Count do
begin
Result.GradientColor[il].RGBA := Gradient[Low(Gradient) + il - 1].Color;
Result.GradientRatio[il] := Gradient[Low(Gradient) + il - 1].Ratio;
if Result.GradientColor[il].A < $FF then hasAlpha := true;
end;
r := DegToRad(angle);
kX := GetWidth /GradientSizeXY;
kY := GetHeight/GradientSizeXY;
Result.Matrix.SetScale(kX*cos(r), kY*cos(r));
Result.Matrix.SetSkew(kX*sin(r), -kY*sin(r));
Result.Matrix.SetTranslate(Bounds.Xmin + GetWidth div 2, Bounds.Ymin + GetHeight div 2);
AddFillStyle(Result);
end;
function TFlashShape.SetLinearGradient(C1, C2: recRGBA; angle: single = 0): TSWFGradientFill;
var
Gradient: array [0..1] of recRGBA;
begin
Gradient[0] := C1;
Gradient[1] := C2;
result := SetLinearGradient(Gradient, angle);
end;
function TFlashShape.SetLineStyle(width: word; c: recRGB): TSWFLineStyle;
begin
Result := SetLineStyle(width, SWFRGBA(c, $ff));
end;
function TFlashShape.SetLineStyle(width: word; c: recRGBA): TSWFLineStyle;
begin
Result := AddLineStyle;
Result.Width := width * MultCoord;
Result.Color.RGBA := c;
if C.A < $FF then hasAlpha := true;
end;
function TFlashShape.SetAdvancedLineStyle(width: word; c: recRGBA; CapStyle:
byte = 0; JoinStyle: byte = 0): TSWFLineStyle2;
begin
Result := TSWFLineStyle2.Create;
Result.Width := width * MultCoord;
Result.Color.RGBA := c;
hasAlpha := true;
hasUseAdvancedStyles := true;
LineStyleNum := LineStyles.Add(Result) + 1;
end;
procedure TFlashShape.SetLineStyleNum(n: Word);
var
R: TSWFStyleChangeRecord;
begin
R := nil;
if StyleChangeMode = scmFirst then
begin
with GetListEdges do
if (Count > 0) and
(TSWFShapeRecord(Items[0]).ShapeRecType = StyleChangeRecord) then
R := TSWFStyleChangeRecord(Items[0]);
end
else R := FindLastChangeStyle;
if R = nil then fLineStyleNum := 0
else
begin
fLineStyleNum := n;
R.StateLineStyle := true;
R.LineId := n;
end;
end;
function TFlashShape.SetRadialGradient(Gradient: array of recRGBA; Xc, Yc: byte): TSWFGradientFill;
var
il: Byte;
kX, kY: Double;
begin
Result := TSWFGradientFill.Create;
Result.SWFFillType := SWFFillRadialGradient;
Result.Count := High(Gradient) - Low(Gradient) + 1;
if Result.Count > 8 then Result.Count := 8;
For il:=1 to Result.count do
begin
Result.GradientColor[il].RGBA := Gradient[Low(Gradient) + il - 1];
if Result.GradientColor[il].A < 255 then self.hasAlpha := true;
Result.GradientRatio[il] := Round((il - 1) / (Result.count - 1) * $FF);
end;
kX := GetWidth /GradientSizeXY;
kY := GetHeight/GradientSizeXY;
Result.Matrix.SetScale(kX, kY);
Result.Matrix.SetTranslate(Bounds.Xmin + Round(GetWidth / 100 * Xc),
Bounds.Ymin + Round(GetHeight / 100 * Yc));
AddFillStyle(Result);
end;
function TFlashShape.SetRadialGradient(C1, C2: recRGBA; Xc, Yc: byte): TSWFGradientFill;
var
Gradient: array [0..1] of recRGBA;
begin
Gradient[0] := C1;
Gradient[1] := C2;
Result := SetRadialGradient(Gradient, Xc, Yc);
end;
function TFlashShape.SetFocalGradient(Gradient: array of recRGBA; FocalPoint: single;
InterpolationMode: TSWFInterpolationMode; SpreadMode: TSWFSpreadMode): TSWFFocalGradientFill;
var
il: Byte;
begin
Result := TSWFFocalGradientFill.Create;
Result.Count := High(Gradient) - Low(Gradient) + 1;
if Result.Count > 8 then Result.Count := 8;
For il:=1 to Result.count do
begin
Result.GradientColor[il].RGBA := Gradient[Low(Gradient) + il - 1];
if Result.GradientColor[il].A < 255 then self.hasAlpha := true;
Result.GradientRatio[il] := Round((il - 1) / (Result.count - 1) * $FF);
end;
Result.FocalPoint := FocalPoint;
Result.InterpolationMode := InterpolationMode;
Result.SpreadMode := SpreadMode;
AddFillStyle(Result);
hasUseAdvancedStyles := true;
end;
function TFlashShape.SetFocalGradient(Color1, Color2: recRGBA; FocalPoint: single;
InterpolationMode: TSWFInterpolationMode; SpreadMode: TSWFSpreadMode): TSWFGradientFill;
var
Gradient: array [0..1] of recRGBA;
begin
Gradient[0] := Color1;
Gradient[1] := Color2;
Result := SetFocalGradient(Gradient, FocalPoint, InterpolationMode, SpreadMode);
end;
procedure TFlashShape.SetShapeBound(XMin, YMin, XMax, YMax: integer);
begin
Bounds.Rect := Rect(XMin * MultCoord, YMin * MultCoord,
XMax * MultCoord, YMax * MultCoord);
end;
function TFlashShape.SetSolidColor(r, g, b, a: byte): TSWFColorFill;
begin
Result := SetSolidColor(SWFRGBA(r, g, b, a));
end;
function TFlashShape.SetSolidColor(c: recRGB): TSWFColorFill;
begin
Result := SetSolidColor(SWFRGBA(c, $ff));
end;
function TFlashShape.SetSolidColor(c: recRGBA): TSWFColorFill;
begin
if C.A < 255 then hasAlpha := true;
Result := TSWFColorFill.Create;
Result.Color.RGBA := c;
AddFillStyle(Result);
end;
procedure TFlashShape.SetXMax(Value: Integer);
begin
Bounds.XMax := Value * MultCoord;
end;
procedure TFlashShape.SetXMin(Value: Integer);
begin
Bounds.XMin := Value * MultCoord;
end;
procedure TFlashShape.SetYMax(Value: Integer);
begin
Bounds.YMax := Value * MultCoord;
end;
procedure TFlashShape.SetYMin(Value: Integer);
begin
Bounds.YMin := Value * MultCoord;
end;
procedure TFlashShape.WriteToStream(be: TBitsEngine);
var
LostSegment: Integer;
MaxW, il, NewLineID: Word;
SegmentNum: Cardinal;
OldList, NewList: TObjectList;
AbsLen, SegmentLen, CurentLen: LongInt;
SCR: TSWFStyleChangeRecord;
SER: TSWFStraightEdgeRecord;
SCvR: TSWFCurvedEdgeRecord;
DrawFlag: Boolean;
NewPT, LastMT: TPoint;
CurveRec: TCurveRec;
PrevPT: TPoint;
fShape: TSWFDefineShape;
fShape3: TSWFDefineShape3;
fShape4: TSWFDefineShape4;
LS2: TSWFLineStyle2;
{$IFDEF VER130} // Delphi 5
procedure CopyList(From, Dest: TObjectList);
var il: integer;
begin
if From.Count > 0 then
for il := 0 to From.Count - 1 do
Dest.Add(From[il]);
end;
{$ENDIF}
function SearchCurvePos(S:Integer; var CR:TCurveRec):TPoint;
var
Delta: double;
P: TPoint;
Sum, MyMod: Integer;
B0x, B0y, B2x, B2y: double;
uP: double;
begin
with CR do
begin
S:=S*S; MyMod:=S;
Sum:=1;
repeat
Delta:= (S-MyMod)/crBx;
if Abs(Delta) < 0.01/Sum then Delta := (0.01/Sum)*Sign(Delta);
crdu:=crdu+Delta;
Delta:=cru+crdu;
if Delta>1 then
begin
Delta:=1;
P:=crP2;
crExitFlag:=Round(SQRT(S)-SQRT((P.X-crPC.X)*(P.X-crPC.X)+(P.Y-crPC.Y)*(P.Y-crPC.Y)));
end;
P.X:=Round((crAx*Delta+2*crP1.X)*Delta);
P.Y:=Round((crAy*Delta+2*crP1.Y)*Delta);
MyMod:=(P.X-crPC.X)*(P.X-crPC.X)+(P.Y-crPC.Y)*(P.Y-crPC.Y);
inc(Sum);
IF Boolean(crExitFlag) and (MyMod>S) then crExitFlag:=0;
until (Abs(MyMod-S) < 50) or (Sum > 100);
crCx:=P.X-crPC.X; crCy:=P.Y-crPC.Y;
B0x:=2*(crAx*cru+crP1.X); B0y:=2*(crAy*cru+crP1.Y);
B2x:=2*(crAx*Delta+crP1.X); B2y:=2*(crAy*Delta+crP1.Y);
if (B0x=B2x) then crP1c.X := 0 else
begin
uP:=(crCx-B2x*(Delta-cru))/(B0x-B2x);
crP1c.X:=Round(B0x*uP);
end;
if (B0y=B2y) then crP1c.Y := 0 else
begin
uP:=(crCy-B2y*(Delta-cru))/(B0y-B2y);
crP1c.Y:=Round(B0y*uP);
end;
cru:=cru+crdu;
Result:=P;
end;
end;
begin
MaxW := 0;
if LineStyles.Count > 0 then
for il := 0 to LineStyles.Count - 1 do
with TSWFLineStyle(LineStyles[il]) do
if MaxW < Width then MaxW := Width;
if hasUseAdvancedStyles then
begin
fShape4 := TSWFDefineShape4.Create;
if LineStyles.Count > 0 then
for il := 0 to LineStyles.Count - 1 do
begin
LS2 := TSWFLineStyle2.Create;
if LineStyles[il] is TSWFLineStyle2 then
begin
LS2.Assign(TSWFLineStyle2(LineStyles[il]));
end else
with TSWFLineStyle(LineStyles[il]) do
begin
LS2.Width := Width;
LS2.Color.Assign(Color);
end;
fShape4.LineStyles.Add(LS2);
end;
fShape4.EdgeBounds.Assign(Bounds);
fShape := fShape4;
end else
begin
fShape3 := TSWFDefineShape3.Create;
if hasAlpha then fShape3.TagID := tagDefineShape3
else fShape3.TagID := tagDefineShape2;
if LineStyles.Count > 0 then
begin
fShape3.LineStyles.OwnsObjects := false;
{$IFDEF VER130}
CopyList(LineStyles, fShape3.LineStyles);
{$ELSE}
fShape3.LineStyles.Assign(LineStyles);
{$ENDIF}
end;
fShape := fShape3;
end;
fShape.ShapeId := FCharacterId;
fShape.hasAlpha := hasAlpha;
if FillStyles.Count > 0 then
begin
fShape.FillStyles.OwnsObjects := false;
{$IFDEF VER130}
CopyList(FillStyles, fShape.FillStyles);
{$ELSE}
fShape.FillStyles.Assign(FillStyles);
{$ENDIF}
end;
fShape.ShapeBounds.Rect := Rect(Bounds.Xmin - MaxW div 2, Bounds.Ymin - MaxW div 2,
Bounds.Xmax + MaxW div 2, Bounds.Ymax + MaxW div 2);
if HasExtLineStyle and (fShape.LineStyles.Count > 0) then
begin
OldList := EdgesStore; //fShape.Edges;
NewList := fShape.Edges; //TObjectList.Create;
if not ExtLineTransparent then
begin
with AddLineStyle(nil) do
begin
Width := TSWFLineStyle(fShape.LineStyles[0]).Width;
Color.Assign(LineBgColor);
end;
LineStyleNum := LineStyleNum - 1;
end;
// is closed shape
if (OldList.Count > 0) and (fShape.FillStyles.Count > 0)
and (Edges.LastStart.X = Edges.CurrentPos.X)
and (Edges.LastStart.Y = Edges.CurrentPos.Y) then
begin
CopyShapeRecords(OldList, NewList);
for il := 0 to NewList.Count - 1 do
if TSWFShapeRecord(NewList[il]).ShapeRecType = StyleChangeRecord then
with TSWFStyleChangeRecord(NewList[il]) do
if StateLineStyle and (LineId > 0) then
LineId := 0;
end;
LostSegment:=0;
SegmentNum:=0;
DrawFlag := true;
for il := 0 to OldList.Count - 1 do
case TSWFShapeRecord(OldList[il]).ShapeRecType of
StyleChangeRecord:
With TSWFStyleChangeRecord(OldList[il]) do
begin
SCR := TSWFStyleChangeRecord.Create;
if StateLineStyle and (LineId > 0) then
begin
SCR.LineId := LineId;
NewLineID := LineId;
SCR.Fill0Id:= Fill0Id;
SCR.Fill1Id:= Fill0Id;
// SCR.StateFillStyle0:=True;
SCR.StateFillStyle1:=True;
end;
if StateMoveTo then
begin
SCR.StateMoveTo := true;
SCR.X := X;
SCR.Y := Y;
end;
LastMT.X := SCR.X;
LastMT.Y := SCR.Y;
NewList.Add(SCR);
end;
StraightEdgeRecord:
with TSWFStraightEdgeRecord(OldList[il]) do
begin
AbsLen := Round(Hypot(X, Y));
CurentLen := 0;
While CurentLen < AbsLen do
begin
if (LostSegment <> 0) then
begin
SegmentLen := LostSegment;
LostSegment := 0;
DrawFlag := not DrawFlag;
end else
begin
SegmentLen := twips * ExtLineStyle[SegmentNum mod ExtLineStyle.Count];
inc(SegmentNum);
end;
if (CurentLen + SegmentLen) > AbsLen then
begin
LostSegment:=SegmentLen + CurentLen - AbsLen;
SegmentLen := AbsLen - CurentLen;
end;
if DrawFlag
then
begin
SER := TSWFStraightEdgeRecord.Create;
SER.X := Round(X / AbsLen * SegmentLen);
SER.Y := Round(Y / AbsLen * SegmentLen);
NewList.Add(SER);
end
else
begin
if ExtLineTransparent then
begin
SCR := TSWFStyleChangeRecord.Create;
SCR.LineId := NewLineID;
SCR.StateMoveTo := true;
SCR.X := Round(X / AbsLen * (CurentLen + SegmentLen))+ LastMT.X;
SCR.Y := Round(Y / AbsLen * (CurentLen + SegmentLen))+ LastMT.Y;
NewList.Add(SCR);
end else
begin
SCR := TSWFStyleChangeRecord.Create;
SCR.LineId := LineStyleNum + 1;
NewList.Add(SCR);
SER := TSWFStraightEdgeRecord.Create;
SER.X := Round(X / AbsLen * SegmentLen);
SER.Y := Round(Y / AbsLen * SegmentLen);
NewList.Add(SER);
SCR := TSWFStyleChangeRecord.Create;
SCR.LineId := NewLineID;
NewList.Add(SCR);
end;
end;
CurentLen := CurentLen + SegmentLen;
DrawFlag := not DrawFlag;
end;
// SegmentLen := 0;
// SegmentNum:=0;
LastMT.X := LastMT.X+X;
LastMT.Y := LastMT.Y+Y;
end;
CurvedEdgeRecord:
with CurveRec, TSWFCurvedEdgeRecord(OldList[il]) do
begin
crP0:=Point(0,0); crPC:=crP0; PrevPT:=crP0;
crP1:=Point(crP0.X+ControlX, crP0.Y+ControlY);
crP2:=Point(crP1.X+AnchorX, crP1.Y+AnchorY);
cru:=0; crdu:=0.02; crExitFlag:=0;
crAx:= crP2.X-2*crP1.X; crAy:= crP2.Y-2*crP1.Y;
crBx:=crP2.X*crP2.X+crP2.Y*crP2.Y;
repeat
if (LostSegment <> 0) then
begin SegmentLen := LostSegment; LostSegment:=0;
DrawFlag := not DrawFlag; end
else begin
SegmentLen:=twips*ExtLineStyle[SegmentNum mod ExtLineStyle.Count];
inc(SegmentNum); end;
PrevPT:=crPC;
crPC:=SearchCurvePos(SegmentLen, CurveRec);
PrevPT:=Point(crPC.X-PrevPT.X, crPC.Y-PrevPT.Y);
if DrawFlag
then
begin
if (Abs(PrevPt.X)<20) or (Abs(PrevPT.Y)<20)
or (SegmentLen < 100) or (crP1c.X+crP1c.Y = 0) then
begin
SER := TSWFStraightEdgeRecord.Create;
SER.X := PrevPT.X;
SER.Y := PrevPt.Y;
NewList.Add(SER);
end
else begin
SCvR := TSWFCurvedEdgeRecord.Create;
SCvR.ControlX := crP1c.X;
SCvR.ControlY := crP1c.Y;
SCvR.AnchorX := PrevPT.X-crP1c.X;
SCvR.AnchorY := PrevPT.Y-crP1c.Y;
NewList.Add(SCvR);
end;
end
else
begin
if ExtLineTransparent then
begin
SCR := TSWFStyleChangeRecord.Create;
SCR.LineId := NewLineID;
SCR.StateMoveTo := true;
SCR.X := PrevPT.X + LastMT.X;
SCR.Y := PrevPT.Y + LastMT.Y;
NewList.Add(SCR);
end else
begin
SCR := TSWFStyleChangeRecord.Create;
SCR.LineId := LineStyleNum + 1;
NewList.Add(SCR);
if (Abs(PrevPt.X)<20) or (Abs(PrevPT.Y)<20)
or (SegmentLen < 100) or (crP1c.X+crP1c.Y = 0) then
begin
SER := TSWFStraightEdgeRecord.Create;
SER.X := PrevPT.X;
SER.Y := PrevPt.Y;
NewList.Add(SER);
end
else begin
SCvR := TSWFCurvedEdgeRecord.Create;
SCvR.ControlX := crP1c.X;
SCvR.ControlY := crP1c.Y;
SCvR.AnchorX := PrevPT.X-crP1c.X;
SCvR.AnchorY := PrevPT.Y-crP1c.Y;
NewList.Add(SCvR);
end;
SCR := TSWFStyleChangeRecord.Create;
SCR.LineId := NewLineID;
NewList.Add(SCR);
end;
end;
DrawFlag := not DrawFlag;
LastMT.X := LastMT.X+PrevPT.X;
LastMT.Y := LastMT.Y+PrevPT.Y;
until crExitFlag > 0;
LostSegment:= crExitFlag;
end;
EndShapeRecord:
NewList.Add(TSWFEndShapeRecord.Create);
end;
// fShape.Edges := NewList;
end else
begin
fShape.Edges.OwnsObjects := false;
{$IFDEF VER130}
CopyList(EdgesStore, fShape.Edges);
{$ELSE}
fShape.Edges.Assign(EdgesStore);
{$ENDIF}
end;
fShape.WriteToStream(be);
fShape.Free;
end;
{
***************************************************** TFlashMorphShape ******************************************************
}
constructor TFlashMorphShape.Create(owner: TFlashMovie);
begin
inherited;
fMorphShape := TSWFDefineMorphShape.Create;
ListEdges := fMorphShape.StartEdges;
FStartEdges := TFlashEdges.Create(fMorphShape.StartEdges);
FStartEdges.Owner := owner;
FEndEdges := TFlashEdges.Create(fMorphShape.EndEdges);
FEndEdges.Owner := owner;
IgnoreMovieSettings := false;
hasUseAdvancedStyles := false;
end;
destructor TFlashMorphShape.Destroy;
begin
fMorphShape.Free;
FStartEdges.Free;
FEndEdges.Free;
inherited;
end;
procedure TFlashMorphShape.AddFillStyle(fill: TSWFMorphFillStyle);
begin
FillStyleNum := fMorphShape.MorphFillStyles.Add(fill) + 1;
end;
function TFlashMorphShape.AddLineStyle(outline: TSWFMorphLineStyle = nil): TSWFMorphLineStyle;
begin
if outline = nil then Result := TSWFMorphLineStyle.Create else Result := outline;
LineStyleNum := fMorphShape.MorphLineStyles.Add(Result) + 1;
end;
procedure TFlashMorphShape.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashMorphShape(Source) do
begin
self.FillStyleLeft := FillStyleLeft;
self.LineStyleNum := LineStyleNum;
self.fMorphShape.Assign(fMorphShape);
end;
end;
procedure TFlashMorphShape.ChangeOwner;
begin
StartEdges.Owner := Owner;
EndEdges.Owner := Owner;
end;
function TFlashMorphShape.EndHeight: LongInt;
begin
with fMorphShape.EndBounds do
Result := Ymax - YMin;
end;
function TFlashMorphShape.EndWidth: LongInt;
begin
with fMorphShape.EndBounds do
Result := Xmax - XMin;
end;
function TFlashMorphShape.FindLastChangeStyle: TSWFStyleChangeRecord;
var
SearchState: Boolean;
il: Word;
begin
Result := nil;
with ListEdges do
if (Count>0) then
begin
SearchState := true;
il := count - 1;
while SearchState do
begin
if TSWFShapeRecord(Items[il]).ShapeRecType = StyleChangeRecord then
begin
Result := TSWFStyleChangeRecord(Items[il]);
SearchState := false;
end;
if il = 0 then SearchState := false else dec(il);
end;
end;
end;
function TFlashMorphShape.GetCenterX: LongInt;
begin
result := fXCenter div MultCoord;
end;
function TFlashMorphShape.GetCenterY: LongInt;
begin
result := fYCenter div MultCoord;
end;
function TFlashMorphShape.MinVersion: Byte;
begin
Result := SWFVer3;
end;
procedure TFlashMorphShape.SetCenterX(X: LongInt);
var
delta: LongInt;
il: Word;
begin
delta := X * MultCoord - fXCenter;
if ListEdges.Count > 0 then
for il := 0 to ListEdges.Count-1 do
case TSWFShapeRecord(ListEdges[il]).ShapeRecType of
StyleChangeRecord, StraightEdgeRecord:
With TSWFStraightEdgeRecord(ListEdges[il]) do
X := X + delta;
CurvedEdgeRecord:
With TSWFCurvedEdgeRecord(ListEdges[il]) do
begin
X := X + delta;
AnchorX := AnchorX + delta;
end;
end;
fXCenter := X * MultCoord
end;
procedure TFlashMorphShape.SetCenterY(Y: LongInt);
var
delta: LongInt;
il: Word;
begin
delta := Y * MultCoord - fYCenter;
if ListEdges.Count > 0 then
for il := 0 to ListEdges.Count-1 do
case TSWFShapeRecord(ListEdges[il]).ShapeRecType of
StyleChangeRecord, StraightEdgeRecord:
With TSWFStraightEdgeRecord(ListEdges[il]) do
Y := Y + delta;
CurvedEdgeRecord:
With TSWFCurvedEdgeRecord(ListEdges[il]) do
begin
Y :=Y + delta;
AnchorY := AnchorY + delta;
end;
end;
fYCenter := Y * MultCoord
end;
procedure TFlashMorphShape.SetCharacterId(id: word);
begin
inherited;
fMorphShape.CharacterId := id;
end;
procedure TFlashMorphShape.SetEndBound(XMin, YMin, XMax, YMax: integer);
const addB = 10;
begin
fMorphShape.EndBounds.Rect := Rect(XMin * MultCoord - addB, YMin * MultCoord - addB,
XMax * MultCoord + addB, YMax * MultCoord + addB);
end;
procedure TFlashMorphShape.SetFillStyleLeft(n: Word);
var
R: TSWFStyleChangeRecord;
begin
if (fMorphShape.MorphFillStyles.Count = 1) then
With ListEdges do
begin
if (Count > 0) and
(TSWFShapeRecord(Items[0]).ShapeRecType = StyleChangeRecord)
then R := TSWFStyleChangeRecord(Items[0])
else R := nil;
end else
R := FindLastChangeStyle;
if R = nil then fFillStyleLeft := 0
else
begin
fFillStyleLeft := n;
R.StateFillStyle0 := true;
R.Fill0Id := n;
end;
end;
function TFlashMorphShape.SetImageFill(img: TFlashImage; mode: TFillImageMode; StartScaleX: single = 1; StartScaleY: single = 1;
EndScaleX: single = 1; EndScaleY: single = 1): TSWFMorphImageFill;
var
adds: Single;
begin
Result := TSWFMorphImageFill.Create;
Result.ImageID := img.CharacterID;
// adds & (twips div 4) - values for fixed visual bag of flash. non document
adds := $f0 / specFixed;
case mode of
fmFit: begin
Result.SWFFillType := SWFFillClipBitmap;
Result.StartMatrix.SetTranslate(fMorphShape.StartBounds.Xmin - twips div 4, fMorphShape.StartBounds.Ymin - twips div 4);
Result.StartMatrix.SetScale(StartWidth/img.Width + adds, StartHeight/img.Height + adds);
Result.EndMatrix.SetTranslate(fMorphShape.EndBounds.Xmin - twips div 4, fMorphShape.EndBounds.Ymin - twips div 4);
Result.EndMatrix.SetScale(EndWidth/img.Width + adds, EndHeight/img.Height + adds);
end;
fmClip: begin
Result.SWFFillType := SWFFillClipBitmap;
Result.StartMatrix.SetTranslate(fMorphShape.StartBounds.Xmin - twips div 4, fMorphShape.StartBounds.Ymin - twips div 4);
Result.StartMatrix.SetScale(StartScaleX * twips, StartScaleY * twips);
Result.EndMatrix.SetTranslate(fMorphShape.EndBounds.Xmin - twips div 4, fMorphShape.EndBounds.Ymin - twips div 4);
Result.EndMatrix.SetScale(EndScaleX * twips, EndScaleY * twips);
end;
fmTile:begin
Result.SWFFillType := SWFFillTileBitmap;
Result.StartMatrix.SetTranslate(fMorphShape.StartBounds.Xmin - twips div 4, fMorphShape.StartBounds.Ymin - twips div 4);
Result.StartMatrix.SetScale(StartScaleX * twips, StartScaleY * twips);
Result.EndMatrix.SetTranslate(fMorphShape.EndBounds.Xmin - twips div 4, fMorphShape.EndBounds.Ymin - twips div 4);
Result.EndMatrix.SetScale(EndScaleX * twips, EndScaleY * twips);
end;
end;
AddFillStyle(Result);
if owner <> nil then
with owner.ObjectList do
if IndexOf(img) > IndexOf(self) then
Move(IndexOf(img), IndexOf(self));
end;
function TFlashMorphShape.SetLinearGradient(StartGradient, EndGradient: array of recRGBA; StartAngle: single = 0; EndAngle:
single = 0): TSWFMorphGradientFill;
var
il, ind: Byte;
r, kX, kY: Double;
begin
Result := TSWFMorphGradientFill.Create;
Result.Count := High(StartGradient) - Low(StartGradient) + 1;
For il:=1 to Result.count do
begin
ind := Low(StartGradient) + il - 1;
Result.StartColor[il].RGBA := StartGradient[ind];
Result.StartRatio[il] := Round((il - 1) / (Result.count - 1) * $FF);
Result.EndColor[il].RGBA := EndGradient[ind];
Result.EndRatio[il] := Round((il - 1) / (Result.count - 1) * $FF);
end;
r := DegToRad(StartAngle);
kX := StartWidth /GradientSizeXY;
kY := StartHeight/GradientSizeXY;
Result.StartMatrix.SetScale(kX*cos(r), kY*cos(r));
Result.StartMatrix.SetSkew(kX*sin(r), -kY*sin(r));
Result.StartMatrix.SetTranslate(fMorphShape.StartBounds.Xmin + StartWidth div 2,
fMorphShape.StartBounds.Ymin + StartHeight div 2);
r := DegToRad(EndAngle);
kX := EndWidth /GradientSizeXY;
kY := EndHeight/GradientSizeXY;
Result.EndMatrix.SetScale(kX*cos(r), kY*cos(r));
Result.EndMatrix.SetSkew(kX*sin(r), -kY*sin(r));
Result.EndMatrix.SetTranslate(fMorphShape.EndBounds.Xmin + EndWidth div 2,
fMorphShape.EndBounds.Ymin + EndHeight div 2);
AddFillStyle(Result);
end;
function TFlashMorphShape.SetLinearGradient(Gradient: array of TSWFMorphGradientRec; StartAngle: single = 0; EndAngle:
single = 0): TSWFMorphGradientFill;
var
il, ind: Byte;
r, kX, kY: Double;
begin
Result := TSWFMorphGradientFill.Create;
Result.Count := High(Gradient) - Low(Gradient) + 1;
if Result.Count > 8 then Result.Count := 8;
For il:=1 to Result.Count do
begin
ind := Low(Gradient) + il - 1;
Result.StartColor[il].RGBA := Gradient[ind].StartColor;
Result.StartRatio[il] := Gradient[ind].StartRatio;
Result.EndColor[il].RGBA := Gradient[ind].EndColor;
Result.EndRatio[il] := Gradient[ind].EndRatio;
end;
r := DegToRad(StartAngle);
kX := StartWidth /GradientSizeXY;
kY := StartHeight/GradientSizeXY;
Result.StartMatrix.SetScale(kX*cos(r), kY*cos(r));
Result.StartMatrix.SetSkew(kX*sin(r), -kY*sin(r));
Result.StartMatrix.SetTranslate(fMorphShape.StartBounds.Xmin + StartWidth div 2,
fMorphShape.StartBounds.Ymin + StartHeight div 2);
r := DegToRad(EndAngle);
kX := EndWidth /GradientSizeXY;
kY := EndHeight/GradientSizeXY;
Result.EndMatrix.SetScale(kX*cos(r), kY*cos(r));
Result.EndMatrix.SetSkew(kX*sin(r), -kY*sin(r));
Result.EndMatrix.SetTranslate(fMorphShape.EndBounds.Xmin + EndWidth div 2,
fMorphShape.EndBounds.Ymin + EndHeight div 2);
AddFillStyle(Result);
end;
function TFlashMorphShape.SetLinearGradient(StartC1, StartC2, EndC1, EndC2: recRGBA; StartAngle: single = 0; EndAngle:
single = 0): TSWFMorphGradientFill;
var
SGradient, EGradient: array [0..1] of recRGBA;
begin
SGradient[0] := StartC1;
SGradient[1] := StartC2;
EGradient[0] := EndC1;
EGradient[1] := EndC2;
result := SetLinearGradient(SGradient, EGradient, StartAngle, EndAngle);
end;
function TFlashMorphShape.SetAdvancedLineStyle(StartWidth, EndWidth: word; StartColor, EndColor: recRGBA;
StartCapStyle: byte = 0; EndCapStyle: byte = 0; JoinStyle: byte = 0): TSWFMorphLineStyle2;
begin
Result := TSWFMorphLineStyle2.Create;
LineStyleNum := fMorphShape.MorphLineStyles.Add(Result) + 1;
Result.StartWidth := StartWidth * MultCoord;
Result.EndWidth := EndWidth * MultCoord;
Result.StartColor.RGBA := StartColor;
Result.EndColor.RGBA := EndColor;
Result.StartCapStyle := StartCapStyle;
Result.EndCapStyle := EndCapStyle;
Result.JoinStyle := JoinStyle;
hasUseAdvancedStyles := true;
end;
function TFlashMorphShape.SetLineStyle(StartWidth, EndWidth: word; StartColor, EndColor: recRGBA): TSWFMorphLineStyle;
begin
Result := AddLineStyle;
Result.StartWidth := StartWidth * MultCoord;
Result.EndWidth := EndWidth * MultCoord;
Result.StartColor.RGBA := StartColor;
Result.EndColor.RGBA := EndColor;
end;
procedure TFlashMorphShape.SetLineStyleNum(n: Word);
var
R: TSWFStyleChangeRecord;
begin
if (fMorphShape.MorphFillStyles.Count = 1) then
with ListEdges do
begin
if (Count > 0) and
(TSWFShapeRecord(Items[0]).ShapeRecType = StyleChangeRecord)
then R := TSWFStyleChangeRecord(Items[0])
else R := nil;
end else
R := FindLastChangeStyle;
if R = nil then fLineStyleNum := 0
else
begin
fLineStyleNum := n;
R.StateLineStyle := true;
R.LineId := n;
end;
end;
function TFlashMorphShape.SetRadialGradient(StartGradient, EndGradient: array of recRGBA; StartXc, StartYc, EndXc, EndYc:
byte): TSWFMorphGradientFill;
var
il, ind: Byte;
kX, kY: Double;
begin
Result := TSWFMorphGradientFill.Create;
Result.SWFFillType := SWFFillRadialGradient;
Result.Count := High(StartGradient) - Low(StartGradient) + 1;
if Result.Count > 8 then Result.Count := 8;
For il:=1 to Result.count do
begin
ind := Low(StartGradient) + il - 1;
Result.StartColor[il].RGBA := StartGradient[ind];
Result.EndColor[il].RGBA := EndGradient[ind];
Result.StartRatio[il] := Round((il - 1) / (Result.count - 1) * $FF);
Result.EndRatio[il] := Result.StartRatio[il];
end;
kX := StartWidth /GradientSizeXY;
kY := StartHeight/GradientSizeXY;
Result.StartMatrix.SetScale(kX, kY);
Result.StartMatrix.SetTranslate(fMorphShape.StartBounds.Xmin + Round(StartWidth / 100 * StartXc),
fMorphShape.StartBounds.Ymin + Round(StartHeight / 100 * StartYc));
kX := EndWidth /GradientSizeXY;
kY := EndHeight/GradientSizeXY;
Result.EndMatrix.SetScale(kX, kY);
Result.EndMatrix.SetTranslate(fMorphShape.EndBounds.Xmin + Round(EndWidth / 100 * EndXc),
fMorphShape.EndBounds.Ymin + Round(EndHeight / 100 * EndYc));
AddFillStyle(Result);
end;
function TFlashMorphShape.SetRadialGradient(StartC1, StartC2, EndC1, EndC2: recRGBA; StartXc, StartYc, EndXc, EndYc: byte):
TSWFMorphGradientFill;
var
SGradient, EGradient: array [0..1] of recRGBA;
begin
SGradient[0] := StartC1;
SGradient[1] := StartC2;
EGradient[0] := EndC1;
EGradient[1] := EndC2;
Result := SetRadialGradient(SGradient, EGradient, StartXc, StartYc, EndXc, EndYc);
end;
function TFlashMorphShape.SetSolidColor(StartC, EndC: recRGBA): TSWFMorphColorFill;
begin
Result := TSWFMorphColorFill.Create;
Result.StartColor.RGBA := StartC;
Result.EndColor.RGBA := EndC;
AddFillStyle(Result);
end;
procedure TFlashMorphShape.SetStartBound(XMin, YMin, XMax, YMax: integer);
const addB = 10;
begin
fMorphShape.StartBounds.Rect := Rect(XMin * MultCoord - addB, YMin * MultCoord - addB,
XMax * MultCoord + addB, YMax * MultCoord + addB);
end;
function TFlashMorphShape.StartHeight: LongInt;
begin
with fMorphShape.StartBounds do
Result := Ymax - YMin;
end;
function TFlashMorphShape.StartWidth: LongInt;
begin
with fMorphShape.StartBounds do
Result := Xmax - XMin;
end;
procedure TFlashMorphShape.WriteToStream(be: TBitsEngine);
var MS2: TSWFDefineMorphShape2;
begin
if hasUseAdvancedStyles then
begin
MS2 := TSWFDefineMorphShape2.Create;
MS2.Assign(fMorphShape);
MS2.WriteToStream(be);
MS2.Free;
end else
fMorphShape.WriteToStream(be);
end;
{
******************************************************** TFlashVideo ********************************************************
}
constructor TFlashVideo.Create(owner: TFlashMovie; FileName: string);
begin
inherited Create(owner);
FFLV := TFLVData.Create(FileName);
end;
constructor TFlashVideo.Create(owner: TFlashMovie; Source: TStream);
begin
inherited Create(owner);
FFLV := TFLVData.Create('');
FLV.Data := Source;
FLV.Parse;
end;
destructor TFlashVideo.Destroy;
begin
FLV.Free;
inherited;
end;
procedure TFlashVideo.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashVideo(Source) do
begin
self.CharacterID := CharacterID;
if Assigned(FPlaceFrame) then self.OnPlaceFrame := OnPlaceFrame;
if Assigned(FWriteFrame) then self.OnWriteFrame := OnWriteFrame;
// F: TWriteFrame;
end;
end;
function TFlashVideo.GetHeight: Word;
begin
Result := FLV.Header.YDim;
end;
function TFlashVideo.GetWidth: Word;
begin
Result := FLV.Header.XDim;
end;
function TFlashVideo.MinVersion: Byte;
begin
Case FLV.Header.CodecInfo of
codecSorenson: Result := SWFVer6;
codecScreenVideo: Result := SWFVer7;
codecScreenVideo2, codecVP6, codecAlphaVP6:
Result := SWFVer8;
else Result := 9;
end;
end;
procedure TFlashVideo.WriteFrame(sender: TSWFObject; BE: TBitsEngine);
var dd: longint;
begin
With FLV.Frame[TSWFVideoFrame(sender).FrameNum] do
begin
dd := 0;
case FLV.Header.CodecInfo of
codecScreenVideo, codecScreenVideo2:
be.WriteByte((byte(FLV.Header.KeyFrame) shl 4)+FLV.Header.CodecInfo);
codecVP6, codecAlphaVP6:
dd := 1;
end;
FLV.Data.Position := Start + dd;
BE.BitsStream.CopyFrom(FLV.Data, Len - dd);
end;
end;
procedure TFlashVideo.WriteToStream(be: TBitsEngine);
begin
With TSWFDefineVideoStream.Create do
begin;
CharacterID := self.CharacterID;
CodecID := FLV.Header.CodecInfo;
NumFrames := FLV.Header.FrameCount;
Width := FLV.Header.XDim;
Height := FLV.Header.YDim;
WriteToStream(BE);
Free;
end;
end;
// =============================================================//
// TFlashSprite //
// =============================================================//
{
******************************************************* TFlashSprite ********************************************************
}
constructor TFlashSprite.Create;
begin
inherited;
FSprite := TSWFDefineSprite.Create;
end;
destructor TFlashSprite.Destroy;
begin
FSprite.Free;
if FVideoList <> nil then FVideoList.Free;
if FInitActions <> nil then FInitActions.Free;
inherited;
end;
procedure TFlashSprite.AddFlashObject(Obj: TBasedSWFObject);
begin
if (owner.AddObjectMode = amEnd) or (CurrentFramePosIndex = -1) or
(CurrentFramePosIndex >= (ObjectList.Count -1)) then
begin
ObjectList.Add(Obj);
CurrentFramePosIndex := ObjectList.Count - 1;
end else
begin
ObjectList.Insert(CurrentFramePosIndex, Obj);
inc(CurrentFramePosIndex);
end;
end;
procedure TFlashSprite.Assign(Source: TBasedSWFObject);
var
il: Word;
PV: TFlashPlaceVideo;
begin
inherited;
With TFlashSprite(Source) do
begin
self.FSprite.Assign(FSprite);
if FBackgroundSound <> nil then
self.BackgroundSound.Assign(BackgroundSound);
if VideoListCount > 0 then
for il := 0 to VideoListCount - 1 do
begin
PV := TFlashPlaceVideo.Create(owner, nil, 0);
PV.Assign(VideoList[il]);
Self.FVideoList.Add(PV);
end;
end;
end;
function TFlashSprite.GetBackgrondSound: TFlashSound;
begin
if FBackgroundSound = nil then FBackgroundSound := TFlashSound.Create(owner);
Result := FBackgroundSound;
end;
function TFlashSprite.GetFrameActions: TFlashActionScript;
begin
if fFrameActions = nil then
fFrameActions := TFlashActionScript.Create(owner);
Result := fFrameActions;
end;
function TFlashSprite.GetFrameCount: Word;
begin
result := Sprite.FrameCount;
end;
function TFlashSprite.GetInitActions: TFlashActionScript;
begin
if fInitActions = nil then
fInitActions := TFlashActionScript.Create(owner);
Result := fInitActions;
end;
function TFlashSprite.GetObjectList: TObjectList;
begin
Result := Sprite.ControlTags;
end;
function TFlashSprite.GetVideoList(Index: Integer): TFlashPlaceVideo;
begin
Result := TFlashPlaceVideo(FVideoList[index]);
end;
function TFlashSprite.GetVideoListCount: Integer;
begin
if FVideoList = nil then Result := 0
else Result := FVideoList.Count;
end;
function TFlashSprite.MinVersion: Byte;
var
il: Word;
SWFObject: TBasedSWFObject;
begin
Result := SWFVer3;
if Sprite.ControlTags.Count = 0 then exit;
With Sprite.ControlTags do
for il:=0 to Count - 1 do
begin
SWFObject := TBasedSWFObject(Items[il]);
if (SWFObject<>nil) and (Result < SWFObject.MinVersion) then
Result := SWFObject.MinVersion;
end;
end;
function TFlashSprite.PlaceMorphShape(MS: TFlashMorphShape; Depth, NumFrame: word): TFlashPlaceObject;
var
il: Integer;
PO: TFlashPlaceObject;
begin
if NumFrame < 2 then NumFrame := 2;
For il := 0 to NumFrame - 1 do
begin
if il = 0 then
begin
PO := PlaceObject(MS, Depth);
Result := PO;
end
else
begin
PO := PlaceObject(Depth);
PO.RemoveDepth := true;
end;
PO.Ratio := Round( il / (NumFrame - 1) * $FFFF );
ShowFrame;
end;
end;
function TFlashSprite.PlaceObject(shape: TFlashVisualObject; depth: word): TFlashPlaceObject;
var
io1, io2: LongInt;
begin
Result := TFlashPlaceObject.Create(owner, shape, depth);
AddFlashObject(Result);
if Owner <> nil then
with owner.ObjectList do
begin
io1 := IndexOf(self);
io2 := IndexOf(shape);
if (io1 < io2) and (io1 <> -1) and (io2 <> -1) then Move(io2, io1);
end;
if FMaxDepth < depth then FMaxDepth := depth;
end;
function TFlashSprite.PlaceObject(shape, mask: TFlashVisualObject; depth: word): TFlashPlaceObject;
var
S: TFlashSprite;
begin
S := owner.AddSprite;
S.PlaceObject(mask, 1).ClipDepth := 2;
//S.PlaceObject(shape, 2);
S.PlaceObject(shape, 2).Name := 'mc_swf';//yangrh
Result := TFlashPlaceObject.Create(owner, S, depth);
AddFlashObject(Result);
if FMaxDepth < depth then FMaxDepth := depth;
end;
function TFlashSprite.PlaceObject(depth: word): TFlashPlaceObject;
begin
Result := TFlashPlaceObject.Create(owner, nil, depth);
AddFlashObject(Result);
if FMaxDepth < depth then FMaxDepth := depth;
end;
function TFlashSprite.PlaceVideo(F: TFlashVideo; depth: word): TFlashPlaceVideo;
begin
Result := TFlashPlaceVideo.Create(owner, F, Depth); //Owner.PlaceVideo(F, depth);
Result.StartFrame := FrameCount;
Result.SpriteParent := self;
if FVideoList = nil then FVideoList := TObjectList.Create(false);
FVideoList.Add(Result);
if FMaxDepth < depth then FMaxDepth := depth;
end;
procedure TFlashSprite.RemoveObject(depth: word; shape: TFlashVisualObject = nil);
var
RO: TSWFRemoveObject;
RO2: TSWFRemoveObject2;
begin
if shape = nil then
begin
RO2 := TSWFRemoveObject2.Create;
RO2.depth := depth;
AddFlashObject(RO2);
end else
begin
RO := TSWFRemoveObject.Create;
RO.CharacterID := shape.CharacterId;
RO.depth := depth;
AddFlashObject(RO);
end;
end;
procedure TFlashSprite.SetCharacterId(id: word);
begin
inherited;
Sprite.SpriteID := ID;
end;
procedure TFlashSprite.SetCurrentFrameNum(Value: Integer);
var
il: LongInt;
begin
if (owner.AddObjectMode <> amEnd) and (ObjectList.Count > 0) then
begin
if Value >= FrameCount then
begin
FCurrentFrameNum := FrameCount - 1;
CurrentFramePosIndex := ObjectList.Count - 1;
end else
begin
FCurrentFrameNum := 0;
for il := 0 to ObjectList.Count - 1 do
if (TBasedSWFObject(ObjectList[il]).LibraryLevel = SWFLevel) and
(TSWFObject(ObjectList[il]).TagID = tagShowFrame) then
begin
Inc(FCurrentFrameNum);
if FCurrentFrameNum = Value then
begin
CurrentFramePosIndex := il;
Break;
end;
end;
end;
end;
end;
procedure TFlashSprite.SetFrameCount(Value: Word);
begin
Sprite.FrameCount := value;
end;
procedure TFlashSprite.ShowFrame(c: word = 1);
var
il: Integer;
begin
if C = 0 then C := 1;
Sprite.FrameCount := Sprite.FrameCount + C;
if fFrameActions <> nil then
begin
Sprite.ControlTags.Add(fFrameActions);
fFrameActions := nil;
end;
if FrameLabel<>'' then
begin
Sprite.ControlTags.Add(TSWFFrameLabel.Create(FrameLabel));
FrameLabel := '';
end;
For il:=1 to C do
begin
Sprite.ControlTags.Add(TSWFShowFrame.Create);
end;
FCurrentFrameNum := Sprite.FrameCount - 1;
CurrentFramePosIndex := Sprite.ControlTags.Count - 1;
end;
function TFlashSprite.StartSound(snd: TFlashSound): TSWFStartSound;
begin
Result := StartSound(snd.CharacterID);
end;
function TFlashSprite.StartSound(ID: word): TSWFStartSound;
begin
Result := TSWFStartSound.Create;
Result.SoundId := ID;
AddFlashObject(Result);
end;
procedure TFlashSprite.StoreFrameActions;
begin
if fFrameActions <> nil then
begin
AddFlashObject(fFrameActions);
fFrameActions := nil;
end;
end;
procedure TFlashSprite.WriteToStream(be: TBitsEngine);
var
il, il2: Integer;
EndFlag: Boolean;
MS: TMemoryStream;
sBE: TBitsEngine;
SH: TSWFSoundStreamHead2;
CurentFrame: Word;
begin
if FrameCount = 0 then ShowFrame;
MS := TMemoryStream.Create;
sBE := TBitsEngine.Create(MS);
With Sprite do
begin
sBE.WriteWord(SpriteID);
sBE.WriteWord(FrameCount);
EndFlag := false;
if EnableBGSound and (fBackgroundSound <> nil) then
begin
SH := TSWFSoundStreamHead2.Create;
BackgroundSound.FillHeader(SH, owner.FPS);
SH.WriteToStream(sBE);
SH.Free;
end;
CurentFrame := 0;
if ControlTags.Count >0 then
For il := 0 to ControlTags.Count - 1 do
With TBasedSWFObject(ControlTags[il]) do
begin
if LibraryLevel = 0 then
begin
if TSWFObject(ControlTags[il]).TagID = tagShowFrame then
begin
if GetVideoListCount > 0 then
for il2 := 0 to VideoListCount - 1 do
With VideoList[il2] do
WriteToStream(sBE, CurentFrame);
if EnableBGSound and (fBackgroundSound <> nil) and
(fBackgroundSound.StartFrame <= CurentFrame) then
fBackgroundSound.WriteSoundBlock(sBE);
inc(CurentFrame);
end;
end else
begin
if (ControlTags[il] is TFlashPlaceObject) then
TFlashPlaceObject(ControlTags[il]).PlaceObject.SWFVersion := Owner.Version;
end;
WriteToStream(sBE);
if (il = (ControlTags.Count - 1)) and (LibraryLevel = 0) then
with TSWFObject(ControlTags[il]) do
EndFlag := tagID = tagEnd;
end;
if not EndFlag then sBE.WriteWord(0);
end;
MS.Position := 0;
WriteCustomData(be.BitsStream, tagDefineSprite, MS);
MS.Free;
sBE.Free;
if FInitActions <> nil then
with TSWFDoInitAction.Create(InitActions.ActionList) do
begin
SpriteID := CharacterId;
WriteToStream(be);
end;
end;
{
******************************************************** TFlashChar *********************************************************
}
constructor TFlashChar.Create(code: word; wide: boolean);
begin
FListEdges := TObjectList.Create;
FEdges := TFlashEdges.Create(FListEdges);
Kerning := TSWFKerningRecord.Create;
FWide := wide;
self.Code := code;
IsUsed := true;
end;
destructor TFlashChar.Destroy;
begin
FListEdges.Free;
FEdges.Free;
FKerning.Free;
end;
procedure TFlashChar.Assign(Source: TObject);
begin
inherited;
With TFlashChar(Source) do
begin
self.FCode := FCode;
self.FWide := FWide;
self.ShapeInit := ShapeInit;
if ShapeInit then
begin
self.GlyphAdvance := GlyphAdvance;
self.Kerning := Kerning;
CopyShapeRecords(ListEdges, self.ListEdges);
end;
end;
end;
function TFlashChar.GetIsWide: Boolean;
begin
Result := Code > 127;
end;
procedure TFlashChar.SetCode(W: Word);
begin
FCode := W;
if W <= $FF then
begin
if FWide then FWideCode := W
else FWideCode := Ord(WideString(chr(W))[1]);
end
else FWideCode := W;
end;
// =============================================================//
// TFlashPlaceObject //
// =============================================================//
{
***************************************************** TFlashPlaceObject *****************************************************
}
constructor TFlashPlaceObject.Create(owner: TFlashMovie; VObject: TFlashVisualObject; depth: word);
begin
inherited Create(owner);
FVisualObject := VObject;
PlaceObject := TSWFPlaceObject3.Create;
PlaceObject.Depth := depth;
if FVisualObject <> nil then
begin
PlaceObject.CharacterId := FVisualObject.CharacterId;
if FVisualObject is TFlashSprite then
begin
tmpActionList := TSWFActionList.Create;
fActions := TFlashActionScript.Create(owner, tmpActionList);
end;
end
end;
destructor TFlashPlaceObject.Destroy;
begin
if fActions <> nil then
begin
tmpActionList.Free;
fActions.Free;
end;
PlaceObject.Free;
inherited;
end;
procedure TFlashPlaceObject.Assign(Source: TBasedSWFObject);
begin
With TFlashPlaceObject(Source) do
begin
if self.Owner = nil then self.Owner := Owner;
self.PlaceObject.Assign(PlaceObject);
FVisualObject := VisualObject;
if fActions<>nil then self.fActions.Assign(fActions);
end;
end;
function TFlashPlaceObject.AddActionEvent(FE: TSWFClipEvents): TSWFClipActionRecord;
begin
Result := PlaceObject.ClipActions.AddActionRecord(FE, 0);
end;
{$IFDEF ASCompiler}
function TFlashPlaceObject.CompileEvent(src: TStrings): boolean;
var S: TMemoryStream;
begin
S := TMemoryStream.Create;
src.SaveToStream(S);
Result := CompileEvent(S);
S.Free;
end;
function TFlashPlaceObject.CompileEvent(src: TStream): boolean;
begin
try
src.Position := 0;
owner.ASCompiler.CompileAction(src, self);
PlaceObject.PlaceFlagHasClipActions := true;
Result := true;
except
on E: Exception do
begin
owner.ASCompilerLog.Write(PChar(E.Message)^, Length(E.Message));
Result := false;
end;
end;
end;
function TFlashPlaceObject.CompileEvent(src: string): boolean;
var S: TMemoryStream;
P: Pointer;
begin
S := TMemoryStream.Create;
P := @src[1];
S.Write(P^, length(src));
Result := CompileEvent(S);
S.Free;
end;
function TFlashPlaceObject.CompileEvent(FileName: string; unicode: boolean): boolean;
var F: TFileStream;
begin
F := TFileStream.Create(Filename, fmOpenRead);
/// if unicode - todo
Result := CompileEvent(F);
F.free;
end;
{$ENDIF}
function TFlashPlaceObject.GetShadowFilter: TSWFDropShadowFilter;
var F: TSWFFilter;
begin
F := FindFilter(fidDropShadow);
if F = nil then
begin
Result := TSWFDropShadowFilter(PlaceObject.SurfaceFilterList.AddFilter(fidDropShadow));
if Owner <> nil then
with Owner.GlobalFilterSettings do
begin
Result.BlurX := BlurX;
Result.BlurY := BlurY;
Result.Distance := Distance;
Result.Angle := DegToRad(Angle);
Result.DropShadowColor.Assign(ShadowColor);
Result.Strength := Strength / 100;
Result.InnerShadow := Inner;
Result.Knockout := Knockout;
Result.Passes := byte(Quality) + 1;
Result.CompositeSource := not HideObject;
end;
end else
Result := TSWFDropShadowFilter(F);
end;
function TFlashPlaceObject.FindActionEvent(FE: TSWFClipEvent; CreateNoExist: boolean = true): TSWFClipActionRecord;
var
il: Word;
CA: TSWFClipActionRecord;
begin
Result := nil;
if not (FVisualObject is TFlashSprite) then Exit;
if PlaceObject.PlaceFlagHasClipActions then
For il:=0 to PlaceObject.ClipActions.ActionRecords.Count - 1 do
begin
CA := PlaceObject.ClipActions.ActionRecord[il];
if FE in CA.EventFlags then
begin
Result := CA;
Break;
end;
end;
if (Result = nil) and CreateNoExist then
Result := PlaceObject.ClipActions.AddActionRecord([FE], 0);
end;
function TFlashPlaceObject.GetBevelFilter: TSWFBevelFilter;
var F: TSWFFilter;
begin
F := FindFilter(fidBevel);
if F = nil then
begin
Result := TSWFBevelFilter(PlaceObject.SurfaceFilterList.AddFilter(fidBevel));
if Owner <> nil then
with owner.GlobalFilterSettings do
begin
Result.BlurX := BlurX;
Result.BlurY := BlurY;
Result.Distance := Distance;
Result.Angle := DegToRad(Angle);
Result.ShadowColor.Assign(ShadowColor);
Result.HighlightColor.Assign(GlowColor);
Result.Strength := Strength / 100;
Result.InnerShadow := Inner;
Result.Knockout := Knockout;
Result.Passes := byte(Quality) + 1;
Result.CompositeSource := not HideObject;
Result.OnTop := OnTop;
end;
end
else
Result := TSWFBevelFilter(F);
end;
function TFlashPlaceObject.GetBlurFilter: TSWFBlurFilter;
var F: TSWFFilter;
begin
F := FindFilter(fidBlur);
if F = nil then
begin
Result := TSWFBlurFilter(PlaceObject.SurfaceFilterList.AddFilter(fidBlur));
if Owner <> nil then
with owner.GlobalFilterSettings do
begin
Result.BlurX := BlurX;
Result.BlurY := BlurY;
Result.Passes := byte(Quality) + 1;
end;
end else
Result := TSWFBlurFilter(F);
end;
function TFlashPlaceObject.GetCharacterID: Word;
begin
Result := PlaceObject.CharacterID;
end;
function TFlashPlaceObject.GetClipDepth: Word;
begin
Result := PlaceObject.ClipDepth;
end;
function TFlashPlaceObject.GetColorTransform: TSWFColorTransform;
begin
Result := PlaceObject.ColorTransform;
end;
function TFlashPlaceObject.GetConvolutionFilter: TSWFConvolutionFilter;
var F: TSWFFilter;
begin
F := FindFilter(fidConvolution);
if F = nil
then
Result := TSWFConvolutionFilter(PlaceObject.SurfaceFilterList.AddFilter(fidConvolution))
else
Result := TSWFConvolutionFilter(F);
end;
function TFlashPlaceObject.GetColorMatrixFilter: TSWFColorMatrixFilter;
var F: TSWFFilter;
begin
F := FindFilter(fidColorMatrix);
if F = nil then
begin
Result := TSWFColorMatrixFilter(PlaceObject.SurfaceFilterList.AddFilter(fidColorMatrix));
if owner <> nil then
with owner.GlobalFilterSettings do
Result.AdjustColor(Brightness, Contrast, Saturation, Hue);
end
else
Result := TSWFColorMatrixFilter(F);
end;
function TFlashPlaceObject.GetDepth: Word;
begin
Result := PlaceObject.Depth;
end;
function TFlashPlaceObject.FindFilter(fid: TSWFFilterID): TSWFFilter;
var il: integer;
begin
Result := nil;
with PlaceObject.SurfaceFilterList do
for il := 0 to Count - 1 do
if fid = Filter[il].FilterID then
begin
Result := Filter[il];
Break;
end;
end;
function TFlashPlaceObject.GetGradientBevelFilter: TSWFGradientBevelFilter;
var F: TSWFFilter;
begin
F := FindFilter(fidGradientBevel);
if F = nil then
begin
Result := TSWFGradientBevelFilter(PlaceObject.SurfaceFilterList.AddFilter(fidGradientBevel));
if Owner <> nil then
with owner.GlobalFilterSettings do
begin
Result.BlurX := BlurX;
Result.BlurY := BlurY;
Result.Distance := Distance;
Result.Angle := DegToRad(Angle);
Result.GradientColor[1].Assign(GlowColor);
Result.GradientColor[2].Assign(ShadowColor);
Result.Strength := Strength / 100;
Result.InnerShadow := Inner;
Result.Knockout := Knockout;
Result.Passes := byte(Quality) + 1;
Result.CompositeSource := not HideObject;
Result.OnTop := OnTop;
end;
end else
Result := TSWFGradientBevelFilter(F);
end;
function TFlashPlaceObject.GetGradientGlowFilter: TSWFGradientGlowFilter;
var F: TSWFFilter;
begin
F := FindFilter(fidGradientGlow);
if F = nil
then
begin
Result := TSWFGradientGlowFilter(PlaceObject.SurfaceFilterList.AddFilter(fidGradientGlow));
if Owner <> nil then
with Owner.GlobalFilterSettings do
begin
Result.BlurX := BlurX;
Result.BlurY := BlurY;
Result.GradientColor[1].Assign(GlowColor);
Result.GradientColor[2].Assign(ShadowColor);
Result.Strength := Strength / 100;
Result.InnerShadow := Inner;
Result.Knockout := Knockout;
Result.Passes := byte(Quality) + 1;
Result.CompositeSource := not HideObject;
Result.OnTop := OnTop;
end;
end
else
Result := TSWFGradientGlowFilter(F);
end;
function TFlashPlaceObject.GetGlowFilter: TSWFGlowFilter;
var F: TSWFFilter;
begin
F := FindFilter(fidGlow);
if F = nil then
begin
Result := TSWFGlowFilter(PlaceObject.SurfaceFilterList.AddFilter(fidGlow));
if Owner <> nil then
with Owner.GlobalFilterSettings do
begin
Result.BlurX := BlurX;
Result.BlurY := BlurY;
Result.GlowColor.Assign(GlowColor);
Result.Strength := Strength / 100;
Result.InnerGlow := Inner;
Result.Knockout := Knockout;
Result.Passes := byte(Quality) + 1;
Result.CompositeSource := not HideObject;
end;
end
else
Result := TSWFGlowFilter(F);
end;
function TFlashPlaceObject.GetMatrix: TSWFMatrix;
begin
Result := PlaceObject.Matrix;
end;
function TFlashPlaceObject.GetName: string;
begin
Result := PlaceObject.Name;
end;
function TFlashPlaceObject.GetRatio: Word;
begin
Result := PlaceObject.Ratio;
end;
function TFlashPlaceObject.GetRemoveDepth: Boolean;
begin
Result := PlaceObject.PlaceFlagMove;
end;
function TFlashPlaceObject.GetTranslateX: LongInt;
begin
if FVisualObject = nil
then
Result := PlaceObject.Matrix.TranslateX div Owner.MultCoord
else
Result := PlaceObject.Matrix.TranslateX div FVisualObject.MultCoord;
end;
function TFlashPlaceObject.GetTranslateY: LongInt;
begin
if FVisualObject = nil
then
Result := PlaceObject.Matrix.TranslateY div Owner.MultCoord
else
Result := PlaceObject.Matrix.TranslateY div FVisualObject.MultCoord;
end;
procedure TFlashPlaceObject.InitColorTransform(hasADD: boolean; addR, addG, addB, addA: Smallint; hasMULT: boolean; multR,
multG, multB, multA: Smallint; hasAlpha: boolean);
begin
//PlaceObject.PlaceFlagHasColorTransform := true;
PlaceObject.ColorTransform.REC :=
MakeColorTransform(hasADD, addR, addG, addB, addA, hasMULT, multR, multG, multB, multA, hasAlpha);
end;
function TFlashPlaceObject.MinVersion: Byte;
begin
if PlaceObject.BlendMode > bmNormal then
Result := SWFVer8 else
if PlaceObject.PlaceFlagHasClipActions then
Result := SWFVer5
else Result := SWFVer3;
end;
function TFlashPlaceObject.OnClick: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceRelease).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnConstruct: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceConstruct).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnData: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceData).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnDragOut: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceDragOut).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnDragOver: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceDragOver).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnEnterFrame: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceEnterFrame).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnInitialize: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceInitialize).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnKeyDown: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceKeyDown).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnKeyPress(Key: byte = 0): TFlashActionScript;
var
AR: TSWFClipActionRecord;
begin
AR := FindActionEvent(ceKeyPress);
AR.KeyCode := Key;
fActions.FActionList := AR.Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnKeyUp: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceKeyUp).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnLoad: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceLoad).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnMouseDown: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceMouseDown).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnMouseMove: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceMouseMove).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnMouseUp: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceMouseUp).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnPress: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(cePress).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnRelease: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceRelease).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnReleaseOutside: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceReleaseOutside).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnRollOut: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceRollOut).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnRollOver: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceRollOver).Actions;
Result := fActions;
end;
function TFlashPlaceObject.OnUnload: TFlashActionScript;
begin
fActions.FActionList := FindActionEvent(ceUnload).Actions;
Result := fActions;
end;
procedure TFlashPlaceObject.SetCharacterID(Value: Word);
begin
PlaceObject.CharacterID := Value;
end;
procedure TFlashPlaceObject.SetClipDepth(Value: Word);
begin
PlaceObject.ClipDepth := Value;
end;
procedure TFlashPlaceObject.SetDepth(Value: Word);
begin
PlaceObject.Depth := Value;
end;
procedure TFlashPlaceObject.SetName(n: string);
begin
PlaceObject.Name := n;
end;
procedure TFlashPlaceObject.SetPosition(X, Y: longint);
begin
if (X = 0) and (Y = 0) and not PlaceObject.PlaceFlagHasMatrix
and not RemoveDepth then Exit;
if FVisualObject = nil
then
PlaceObject.Matrix.SetTranslate(X * Owner.MultCoord, Y * Owner.MultCoord)
else
PlaceObject.Matrix.SetTranslate(FVisualObject.fXCenter + X * Owner.MultCoord,
FVisualObject.fYCenter + Y * Owner.MultCoord);
end;
procedure TFlashPlaceObject.SetRatio(Value: Word);
begin
PlaceObject.Ratio := Value;
end;
procedure TFlashPlaceObject.SetRemoveDepth(v: Boolean);
begin
PlaceObject.PlaceFlagMove := v;
end;
procedure TFlashPlaceObject.SetRotate(angle: single);
begin
PlaceObject.Matrix.SetRotate(angle);
end;
procedure TFlashPlaceObject.SetScale(ScaleX, ScaleY: single);
begin
PlaceObject.Matrix.SetScale(ScaleX, ScaleY);
end;
procedure TFlashPlaceObject.SetSkew(SkewX, SkewY: single);
begin
PlaceObject.Matrix.SetSkew(SkewX, SkewY);
end;
procedure TFlashPlaceObject.SetTranslate(X, Y: longint);
begin
if (X = 0) and (Y = 0) and not PlaceObject.PlaceFlagHasMatrix
and not RemoveDepth then Exit;
PlaceObject.Matrix.SetTranslate(X * Owner.MultCoord, Y * Owner.MultCoord);
end;
procedure TFlashPlaceObject.SetTranslateX(Value: LongInt);
begin
PlaceObject.Matrix.TranslateX := Value * FVisualObject.MultCoord;
end;
procedure TFlashPlaceObject.SetTranslateY(Value: LongInt);
begin
PlaceObject.Matrix.TranslateY := Value * FVisualObject.MultCoord;
end;
function TFlashPlaceObject.GetBlendMode: TSWFBlendMode;
begin
Result := PlaceObject.BlendMode;
end;
procedure TFlashPlaceObject.SetBlendMode(const Value: TSWFBlendMode);
begin
PlaceObject.BlendMode := Value;
if Value > bmNormal then
PlaceObject.PlaceFlagHasBlendMode := true;
end;
function TFlashPlaceObject.GetFilterList: TSWFFilterList;
begin
Result := PlaceObject.SurfaceFilterList;
end;
function TFlashPlaceObject.GetUseBitmapCaching: Boolean;
begin
Result := PlaceObject.PlaceFlagHasCacheAsBitmap;
end;
procedure TFlashPlaceObject.SetUseBitmapCaching(const Value: Boolean);
begin
PlaceObject.PlaceFlagHasCacheAsBitmap := Value;
end;
procedure TFlashPlaceObject.WriteToStream(be: TBitsEngine);
begin
PlaceObject.SaveAsPO2 := (PlaceObject.BlendMode <= bmNormal) and
(not PlaceObject.PlaceFlagHasFilterList) and
(not UseBitmapCaching);
if PlaceObject.SaveAsPO2
then PlaceObject.TagID := tagPlaceObject2
else PlaceObject.TagID := tagPlaceObject3;
PlaceObject.WriteToStream(BE);
end;
{
***************************************************** TFlashPlaceVideo ******************************************************
}
constructor TFlashPlaceVideo.Create(owner: TFlashMovie; Video: TFlashVisualObject; depth: word);
begin
inherited;
AutoReplay := true;
end;
destructor TFlashPlaceVideo.Destroy;
begin
inherited;
end;
procedure TFlashPlaceVideo.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashPlaceVideo(Source) do
begin
self.AutoReplay := AutoReplay;
self.StartFrame := StartFrame;
self.FEnableSound := EnableSound;
if Assigned(FPlaceFrame) then self.FPlaceFrame := FPlaceFrame;
if Assigned(FWriteFrame) then self.FWriteFrame := FWriteFrame;
end;
end;
function TFlashPlaceVideo.GetCharacterID: Word;
begin
Result := Video.CharacterID;
end;
function TFlashPlaceVideo.GetVideo: TFlashVideo;
begin
Result := TFlashVideo(FVisualObject);
end;
function TFlashPlaceVideo.MinVersion: Byte;
begin
Result := SWFVer3;
end;
procedure TFlashPlaceVideo.SetEnableSound(Value: Boolean);
var
il: Word;
begin
FEnableSound := Value and Video.FLV.SoundExist;
if EnableSound then
begin
if SpriteParent = nil then
begin
if (owner <> nil) and owner.EnableBGSound then owner.EnableBGSound := false;
if owner.VideoListCount > 0 then
for il := 0 to owner.VideoListCount - 1 do
if owner.VideoList[il] <> self then
owner.VideoList[il].EnableSound := false;
end else
begin
if SpriteParent.EnableBGSound then SpriteParent.EnableBGSound := true;
if SpriteParent.VideoListCount > 0 then
for il := 0 to SpriteParent.VideoListCount - 1 do
if SpriteParent.VideoList[il] <> self then
SpriteParent.VideoList[il].EnableSound := false;
end;
end;
end;
procedure TFlashPlaceVideo.WriteToStream(be: TBitsEngine; Frame:Word);
var
P: TWriteFrameInfo;
PlaceStream: TFlashPlaceObject;
VFrame: TSWFVIdeoFrame;
CurentFrame: Word;
SH: TSWFSoundStreamHead;
il, T, Sum: Word;
FLVSound: TVFrame;
begin
if (Frame >= StartFrame) then
begin
CurentFrame := (Frame - StartFrame);
if not AutoReplay and (CurentFrame >= Video.FLV.FrameCount) then Exit
else
CurentFrame := CurentFrame mod Max(1,Video.FLV.FrameCount);
end
else exit;
P.ID := CharacterID;
P.Frame := Frame - StartFrame;
P.Depth := Depth;
if Assigned(FWriteFrame) then onWriteFrame(be, P)
else
begin
PlaceStream := TFlashPlaceObject.Create(owner, nil, Depth);
PlaceStream.Assign(self);
if (Frame - StartFrame) = 0 then
begin
PlaceStream.Ratio := 0;
// --------- SOUND header -----------
if EnableSound then
with Video.FLV do
begin
SH := TSWFSoundStreamHead.Create;
SH.PlaybackSoundRate := SoundHeader.SoundRate;
// SH.PlaybackSoundRate := (Video.FLV.SoundHeader.SoundFormat and $C) shr 2;
case SH.PlaybackSoundRate of
0: SndBitRate := 5512; // Snd5k;
1: SndBitRate := 11025; // Snd11k;
2: SndBitRate := 22050; // Snd22k;
3: SndBitRate := 44100; // Snd44k;
end;
SH.PlaybackSoundSize := SoundHeader.Is16Bit;
SH.PlaybackSoundType := SoundHeader.IsStereo;
SH.StreamSoundCompression := SoundHeader.SoundFormat;
SH.StreamSoundRate := SH.PlaybackSoundRate;
SH.StreamSoundSize := SH.PlaybackSoundSize;
SH.StreamSoundType := SH.PlaybackSoundType;
SndSampleCount := Round(SndBitRate / Owner.FPS);
SH.StreamSoundSampleCount := SndSampleCount;
if SH.StreamSoundCompression = snd_MP3 then
begin
SndSeekSample := MPEG_SAMPLES_FRAME[(SoundHeader.MP3Frame and $180000) shr 19,
(SoundHeader.MP3Frame and $C00) shr 10];
SH.LatencySeek := SndSampleCount mod SndSeekSample;
end;
SH.WriteToStream(be);
SH.Free;
end;
end else
begin
PlaceStream.RemoveDepth := True;
PlaceStream.Ratio := CurentFrame;
end;
// SampleCount - VideoFrame
// SeekSample - MP3Frame
if EnableSound and (SndCount < Video.FLV.SoundCount) then
begin
with Video.FLV do
begin
case SoundHeader.SoundFormat of
snd_MP3: begin
il := (SndSampleCount + SndLatency) div SndSeekSample;
if (il = 0) or (P.Frame = 0) then inc(il);
if (SndCount + il) < SoundCount then
begin
be.WriteWord(tagSoundStreamBlock shl 6 + $3F);
Sum := 0;
For T:=0 to il-1 do Sum := Sum + GetSoundFromList(SndCount+T).Len;
be.WriteDWord(Sum + 4);
be.WriteWord(SndSeekSample * il);
be.WriteWord(SndLatency);
SndLatency := (SndSampleCount + SndLatency) mod SndSeekSample;
repeat
T:=GetSoundFromList(SndCount).Len;
if T > 0 then
begin
Data.Position := GetSoundFromList(SndCount).Start;
be.BitsStream.CopyFrom(Video.FLV.Data, T);
end;
Inc(SndCount);
dec(il);
until not boolean(il);
end
else inc( SndCount, il);
end;
snd_Nellymoser: begin
FLVSound := GetSoundFromList(SndCount);
be.WriteWord(tagSoundStreamBlock shl 6 + $3F);
T := FLVSound.Len;
be.WriteDWord(0);
Sum := 0;
while (FLVSound <> nil) and (FLVSound.InVideoPos = CurentFrame) do
begin
if T > 0 then
begin
Data.Position := FLVSound.Start;
be.BitsStream.CopyFrom(Video.FLV.Data, T);
Sum := Sum + T;
end;
inc(SndCount);
if SoundCount > SndCount
then FLVSound := GetSoundFromList(SndCount)
else FLVSound := nil;
if FLVSound <> nil then
T := FLVSound.Len;
end;
if Sum > 0 then
begin
be.BitsStream.Seek(- Sum - 4, 1);
be.WriteDWord(Sum);
be.BitsStream.Seek(Sum, 1);
end;
end;
end;
end;
end;
VFrame := TSWFVIdeoFrame.Create;
VFrame.StreamID := CharacterID;
VFrame.FrameNum := CurentFrame;
VFrame.OnDataWrite := Video.WriteFrame;
VFrame.WriteToStream(be);
VFrame.Free;
if Assigned(FPlaceFrame)then OnPlaceFrame(be, P, PlaceStream);
PlaceStream.WriteToStream(be);
PlaceStream.Free;
end;
end;
// =============================================================//
// TEXT //
// =============================================================//
{
***************************************************** TFlashCustomData ******************************************************
}
constructor TFlashCustomData.Create(owner: TFlashMovie; FileName:string = '');
begin
inherited Create(owner);
FData := TMemoryStream.Create;
if FileExists(FileName) then
begin
Data.LoadFromFile(FileName);
end;
end;
constructor TFlashCustomData.Create(owner: TFlashMovie; S: TStream; Size: longint = 0);
begin
inherited Create(owner);
FData := TMemoryStream.Create;
if Size= 0 then Data.LoadFromStream(S)
else Data.CopyFrom(S, Size);
end;
destructor TFlashCustomData.Destroy;
begin
FData.Free;
inherited;
end;
procedure TFlashCustomData.Assign(Source: TBasedSWFObject);
begin
With TFlashCustomData(Source) do
begin
Data.Position := 0;
self.Data.CopyFrom(Data, Data.Size);
self.TagId := TagId;
self.WriteHeader := WriteHeader;
end;
end;
function TFlashCustomData.MinVersion: Byte;
begin
Result := SWFVer3;
end;
procedure TFlashCustomData.WriteToStream(be: TBitsEngine);
begin
If Data.Size > 0 then
begin
Data.Position := 0;
if WriteHeader
then
WriteCustomData(be.BitsStream, TagID, Data)
else
be.BitsStream.CopyFrom(Data, Data.Size);
end;
end;
function _CodeSort(P1, P2: Pointer): Integer;
var Ch1, Ch2: longint;
begin
Ch1 := LongInt(P1);
Ch2 := LongInt(P2);
if Ch1 > Ch2 then Result := 1 else
if Ch1 = Ch2 then Result := 0 else Result := -1;
end;
{
******************************************************** TFlashFont *********************************************************
}
constructor TFlashFont.Create(owner: TFlashMovie);
begin
inherited Create(owner);
self.asDevice := true;
end;
constructor TFlashFont.Create(owner: TFlashMovie; asDevice: boolean; Name: string; bold, italic: boolean; size: word);
begin
inherited Create(owner);
self.asDevice := asDevice;
self.Name := Name;
self.bold := bold;
self.italic := italic;
self.size := size;
end;
destructor TFlashFont.Destroy;
begin
if FCharList <> nil then FCharList.Free;
inherited ;
end;
procedure TFlashFont.AddChars(s: ansistring);
var
il: Integer;
begin
if (s = '') then Exit;
for il := 1 to length(s) do AddEmpty(ord(s[il]));
end;
procedure TFlashFont.AddChars(chset: TCharSets);
var
il: Byte;
begin
for il := 32 to 255 do
if chr(il) in chset then AddEmpty(il);
end;
{$IFNDEF VER130}
procedure TFlashFont.AddChars(s: WideString);
begin
AddCharsW(S);
end;
{$ENDIF}
procedure TFlashFont.AddChars(min, max: word);
var
il: Word;
begin
for il := min to max do AddEmpty(il);
end;
procedure TFlashFont.AddCharsW(s: WideString);
var
il: Integer;
begin
if (s = '') then Exit;
FWideCodes := true;
for il := 1 to Length(s) do AddEmpty(Word(s[il]));
end;
function TFlashFont.AddEmpty(Ch: word): Boolean;
var
il, CharCode, NewCode: Word;
NewChar: TFlashChar;
begin
Result := true;
if Ch > $FF then FWideCodes := true;
if CharList.Count > 0 then
begin
if FWideCodes then NewCode := ch
else NewCode := ord(WideString(chr(Ch))[1]);
for il := 0 to CharList.Count -1 do
begin
if Ch < $80 then CharCode := CharInfoInd[il].Code
else CharCode := CharInfoInd[il].WideCode;
if (NewCode = CharCode) then
begin
CharInfoInd[il].IsUsed := true;
Result := false;
Break;
end else
if NewCode < CharCode then
begin
NewChar := TFlashChar.Create(Ch, FWideCodes);
CharList.Insert(il, NewChar);
Break;
end else
if (il = (CharList.Count - 1)) and (NewCode > CharCode) then
begin
NewChar := TFlashChar.Create(Ch, FWideCodes);
CharList.Add(NewChar);
end;
end;
end else
begin
NewChar := TFlashChar.Create(Ch, FWideCodes);
CharList.Add(NewChar);
end;
if FWideCodes and (Owner.Version < SWFVer6) then Owner.Version := SWFVer6;
end;
procedure TFlashFont.Assign(Source: TBasedSWFObject);
var
il: Word;
Ch: TFlashChar;
begin
inherited;
With TFlashFont(Source) do
begin
self.AsDevice := AsDevice;
self.Bold := Bold;
self.EncodingType := EncodingType;
self.Ascent := Ascent;
self.FontCharset := FontCharset;
self.Descent := Descent;
self.Leading := Leading;
self.Layout := Layout;
self.IncludeKerning := IncludeKerning;
self.Italic := Italic;
self.LanguageCode := LanguageCode;
self.Name := Name ;
self.FSize := FSize;
self.SmallText := SmallText;
self.FontUsing := FontUsing;
if CharList.Count > 0 then
for il := 0 to CharList.Count - 1 do
begin
Ch := TFlashChar.Create(CharInfoInd[il].Code, FWideCodes);
Ch.Assign(CharInfoInd[il]);
self.CharList.Add(Ch);
end;
end;
end;
function TFlashFont.CalcMetric(V: longint): LongInt;
begin
result := Round(V / EMS * FSize);
end;
procedure TFlashFont.FillCharsInfo;
var
il: Integer;
FDC, OldF: THandle;
LF: TLogFont;
begin
if CharList.Count = 0 then Exit;
if FontInfo.lfFaceName = ''
then LF := MakeLogFont(self)
else LF := FontInfo;
ReadFontMetric(self);
FDC := CreateCompatibleDC(0);
OldF := SelectObject(FDC, CreateFontIndirect(LF));
if CharList.Count > 0 then
For il := 0 to CharList.Count - 1 do
with CharInfoInd[il] do
if IsUsed and not ShapeInit then
FillCharInfo(FDC, CharInfoInd[il]);
DeleteObject(SelectObject(FDC, OldF));
DeleteDC(FDC);
end;
function TFlashFont.GetAntiAlias: Boolean;
begin
Result := not FSmallText;
end;
function TFlashFont.GetCharInfo(Code: Integer): TFlashChar;
var
il: Integer;
begin
Result := nil;
if CharList.Count > 0 then
for il := 0 to CharList.Count - 1 do
if Code = CharInfoInd[il].Code then
begin
Result := CharInfoInd[il];
Break;
end;
end;
function TFlashFont.GetCharInfoInd(Index: Integer): TFlashChar;
begin
Result := TFlashChar(CharList[index]);
end;
function TFlashFont.GetCharList: TObjectList;
begin
If FCharList = nil then FCharList := TObjectList.Create;
Result := FCharList;
end;
function TFlashFont.GetSize: word;
begin
if owner = nil then Result := FSize
else Result := FSize div owner.MultCoord;
end;
function TFlashFont.GetTextExtentPoint(s: string): TSize;
var
FDC, OldF: THandle;
LF: TLogFont;
begin
FDC := CreateCompatibleDC(0);
if FontInfo.lfFaceName = ''
then LF := MakeLogFont(self)
else LF := FontInfo;
OldF := SelectObject(FDC, CreateFontIndirect(LF));
GetTextExtentPoint32(FDC, pchar(S), Length(S), Result);
Result.CX := CalcMetric(Result.CX);
Result.CY := CalcMetric(Result.CY);
DeleteObject(SelectObject(FDC, OldF));
DeleteDC(FDC);
end;
{$IFNDEF VER130}
function TFlashFont.GetTextExtentPoint(s: WideString): TSize;
begin
Result := GetTextExtentPointW(S);
end;
{$ENDIF}
function TFlashFont.GetTextExtentPointW(s: WideString): TSize;
var
FDC, OldF: THandle;
LF: TLogFont;
begin
FDC := CreateCompatibleDC(0);
if FontInfo.lfFaceName = ''
then LF := MakeLogFont(self)
else LF := FontInfo;
OldF := SelectObject(FDC, CreateFontIndirect(LF));
GetTextExtentPoint32W(FDC, PWideChar(S), Length(S), Result);
Result.CX := CalcMetric(Result.CX);
Result.CY := CalcMetric(Result.CY);
DeleteObject(SelectObject(FDC, OldF));
DeleteDC(FDC);
end;
function TFlashFont.GetWideCodes: Boolean;
var
il: Integer;
begin
Result := FWideCodes;
if Result then Exit;
if not asDevice and (CharList.Count > 0) then
For il := 0 to CharList.Count - 1 do
begin
Result := CharInfoInd[il].isWide;
If Result then Exit;
end;
end;
procedure TFlashFont.LoadFromSWFObject(Src: TSWFDefineFont2);
var il: longint;
LE: TObjectList;
begin
with src do
begin
Layout := FontFlagsHasLayout;
if FontFlagsShiftJIS then EncodingType := encodeShiftJIS;
SmallText := FontFlagsSmallText;
if FontFlagsANSI then EncodingType := encodeANSI;
if FontFlagsWideCodes then EncodingType := encodeUnicode;
Italic := FontFlagsItalic;
Bold := FontFlagsBold;
self.LanguageCode := LanguageCode;
Name := FontName;
if FontFlagsHasLayout then
begin
Ascent := FontAscent;
Descent := FontDescent;
Leading := FontLeading;
end;
if CodeTable.Count > 0 then
begin
for il := 0 to CodeTable.Count - 1 do
begin
LE := TObjectList(GlyphShapeTable.Items[il]);
AddEmpty(LongInt(CodeTable[il]));
CopyShapeRecords(LE, CharInfoInd[il].ListEdges);
CharInfoInd[il].IsUsed := false;
CharInfoInd[il].ShapeInit := true;
if FontFlagsHasLayout then
begin
// TSWFRect(FontBoundsTable[il]); no uses
CharInfoInd[il].GlyphAdvance := longint(FontAdvanceTable[il]);
if IncludeKerning then
CharInfoInd[il].Kerning.Assign(TSWFKerningRecord(FontKerningTable[il]));
end;
end;
end;
end;
end;
procedure TFlashFont.LoadFromSWFFile(FileName: string);
var FS: TFileStream;
begin
FS := TFileStream.Create(FileName, fmOpenRead);
LoadFromSWFStream(FS);
FS.Free;
end;
procedure TFlashFont.LoadFromSWFStream(src: TStream);
var
ACH: array [0..2] of char;
DF: TSWFDefineFont2;
BS: TBitsEngine;
SWF: TSWFStreamReader;
il: longint;
begin
src.Read(ACH, 3);
src.seek(-3, 1);
if (ACH = SWFSign) or (ACH = SWFSignCompress) then
begin
SWF := TSWFStreamReader.Create(src);
SWF.ReadBody(true, false);
For il := 0 to SWF.TagList.Count - 1 do
if SWF.TagInfo[il].TagID = tagDefineFont2 then
begin
DF := TSWFDefineFont2(SWF.TagInfo[il].SWFObject);
if (Name = '') or
((DF.FontName = Name) and (DF.FontFlagsItalic = Italic) and (DF.FontFlagsBold = Bold))
then
begin
LoadFromSWFObject(DF);
Break
end;
end;
SWF.Free;
end else
begin
BS := TBitsEngine.Create(src);
DF := TSWFDefineFont2.Create;
DF.ReadFromStream(BS);
LoadFromSWFObject(DF);
DF.Free;
BS.Free;
end;
end;
function TFlashFont.MinVersion: Byte;
begin
Result := SWFVer3;
end;
procedure TFlashFont.SetAntiAlias(Value: Boolean);
begin
FSmallText := not Value;
end;
procedure TFlashFont.SetFontCharset(Value: Byte);
begin
if FFontCharset <> Value then
begin
Case Value of
ANSI_CHARSET, SYMBOL_CHARSET:
begin
LanguageCode := SWFLangNone;
EncodingType := encodeANSI;
end;
DEFAULT_CHARSET:
begin
LanguageCode := SWFLangNone;
EncodingType := encodeUnicode;
end;
SHIFTJIS_CHARSET:
begin
LanguageCode := SWFLangJapanese;
EncodingType := encodeShiftJIS;
end;
GB2312_CHARSET:
LanguageCode := SWFLangSChinese;
CHINESEBIG5_CHARSET:
LanguageCode := SWFLangTChinese;
HANGEUL_CHARSET:
LanguageCode := SWFLangKorean;
else
LanguageCode := $40; // Value;
EncodingType := encodeUnicode;
end;
end;
end;
procedure TFlashFont.SetFontInfo(Info: TLogFont);
begin
FFontInfo := Info;
FBold := Info.lfWeight = 700;
FName := StrPas(Info.lfFaceName);
FItalic := Info.lfItalic > 0;
Size := Abs(Info.lfHeight);
FontCharset := Info.lfCharSet;
FFontInfo.lfHeight := -EMS;//Info.lfHeight * Owner.MultCoord;
FFontInfo.lfOrientation := 0;
FFontInfo.lfEscapement := 0;
FFontInfo.lfWidth := 0;
end;
procedure TFlashFont.SetHasLayout(v: Boolean);
begin
if v and not FHasLayout then
begin
ReadFontMetric(self);
end;
FHasLayout := v;
end;
procedure TFlashFont.SetSize(value: word);
begin
if Owner = nil then FSize := value
else FSize := value * Owner.MultCoord;
end;
procedure TFlashFont.WriteToStream(be: TBitsEngine);
var
il, ncode: Word;
begin
with TSWFDefineFont2.Create do
begin
if Owner = nil then SWFVersion := SWFVer6
else SWFVersion := Owner.Version;
FontId := CharacterID;
FontFlagsHasLayout := Layout or (fuDynamicText in FontUsing);
FontFlagsShiftJIS := EncodingType = encodeShiftJIS;
FontFlagsSmallText := SmallText;
FontFlagsANSI := EncodingType = encodeANSI;
FontFlagsWideOffsets := NoSupport;
FontFlagsWideCodes := (EncodingType = encodeUnicode) or WideCodes;
FontFlagsItalic := Italic;
FontFlagsBold := Bold;
LanguageCode := self.LanguageCode;
FontName := Name;
if (FontFlagsHasLayout or ((FCharList <> nil) and (FCharList.Count > 0))) and
((Ascent = 0) and (Descent = 0) and (Leading = 0))
then ReadFontMetric(self);
if FontFlagsHasLayout then
begin
FontAscent := Ascent;
FontDescent := Descent;
FontLeading := Leading;
if IncludeKerning then
FontKerningTable.OwnsObjects := false;
end;
if ((not asDevice) or (fuStaticText in FontUsing)) and
((FCharList <> nil) and (FCharList.Count > 0)) then
begin
GlyphShapeTable.OwnsObjects := false;
FillCharsInfo;
For il := 0 to FCharList.Count - 1 do
with CharInfoInd[il] do
if IsUsed then
begin
GlyphShapeTable.Add(ListEdges);
if FontFlagsWideCodes then ncode := WideCode
else ncode := Code;
CodeTable.Add(Pointer(Longint(ncode)));
if FontFlagsHasLayout then
begin
FontBoundsTable.Add(TSWFRect.Create);
FontAdvanceTable.Add(Pointer(LongInt(GlyphAdvance)));
if IncludeKerning then FontKerningTable.Add(Kerning);
end;
end;
if not FontFlagsWideCodes then CodeTable.Sort(_CodeSort);
end;
WriteToStream(be);
free;
end;
end;
{
******************************************************** TFlashText *********************************************************
}
constructor TFlashText.Create(owner: TFlashMovie; s: ansistring);
begin
inherited Create(owner);
InitVar(s);
end;
constructor TFlashText.Create(owner: TFlashMovie; s: ansistring; c: recRGBA; f: TFlashFont; P: TPoint; Align: byte);
begin
inherited Create(owner);
Font := f;
InitVar(s);
Color.RGBA := C;
FPtAnchor.X := P.X * MultCoord;
FPtAnchor.Y := P.Y * MultCoord;
self.Align := Align;
Autosize := true;
InitAsPoint := true;
FTextHeight := Abs(f.FSize);
FUseOutlines := not f.AsDevice;
end;
constructor TFlashText.Create(owner: TFlashMovie; s: ansistring; c: recRGBA; f: TFlashFont; R: TRect);
begin
inherited Create(owner);
Font := f;
InitVar(s);
Color.RGBA := C;
SetBounds(R);
FPtAnchor := Bounds.Rect.TopLeft;
InitAsPoint := false;
FTextHeight := Abs(f.FSize);
FUseOutlines := not f.AsDevice;
end;
{$IFNDEF VER130}
constructor TFlashText.Create(owner: TFlashMovie; s: WideString; c: recRGBA; f: TFlashFont; P: TPoint; Align: byte);
begin
inherited Create(owner);
Font := f;
InitVarW(s);
Color.RGBA := C;
FPtAnchor.X := P.X * MultCoord;
FPtAnchor.Y := P.Y * MultCoord;
self.Align := Align;
Autosize := true;
InitAsPoint := true;
FTextHeight := Abs(f.FSize);
FUseOutlines := not f.AsDevice;
end;
constructor TFlashText.Create(owner: TFlashMovie; s: WideString; c: recRGBA; f: TFlashFont; R: TRect);
begin
inherited Create(owner);
Font := f;
InitVarW(s);
Color.RGBA := C;
SetBounds(R);
FPtAnchor := Bounds.Rect.TopLeft;
InitAsPoint := false;
FTextHeight := Abs(f.FSize);
FUseOutlines := not f.AsDevice;
end;
{$ENDIF}
constructor TFlashText.CreateW(owner: TFlashMovie; s: WideString; c: recRGBA; f: TFlashFont; P: TPoint; Align: byte);
begin
inherited Create(owner);
Font := f;
InitVarW(s);
Color.RGBA := C;
FPtAnchor.X := P.X * MultCoord;
FPtAnchor.Y := P.Y * MultCoord;
self.Align := Align;
Autosize := true;
InitAsPoint := true;
FTextHeight := Abs(f.FSize);
FUseOutlines := not f.AsDevice;
end;
constructor TFlashText.CreateW(owner: TFlashMovie; s: WideString; c: recRGBA; f: TFlashFont; R: TRect);
begin
inherited Create(owner);
Font := f;
InitVarW(s);
Color.RGBA := C;
SetBounds(R);
FPtAnchor := R.TopLeft;
InitAsPoint := false;
FTextHeight := Abs(f.FSize);
FUseOutlines := not f.AsDevice;
end;
destructor TFlashText.Destroy;
begin
if Assigned(FMatrix) then FMatrix.Free;
FBounds.Free;
FColor.Free;
inherited;
end;
procedure TFlashText.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashText(Source) do
begin
self.Align := Align;
self.AutoSize := AutoSize;
self.Border := Border;
self.Bounds.Assign(Bounds);
self.DynamicText := DynamicText;
if self.Owner = owner then self.FFont := Font;
self.HasLayout := HasLayout;
if HasLayout then
begin
self.Indent := Indent;
self.RightMargin := RightMargin;
self.LeftMargin := LeftMargin;
self.Leading := Leading;
end;
self.HTML := HTML;
if FMatrix <> nil then
self.Matrix.Assign(Matrix);
self.Multiline := Multiline;
self.NoSelect := NoSelect;
self.Password := Password;
self.FPtAnchor := FPtAnchor;
self.ReadOnly := ReadOnly;
self.Text := Text;
// if wText <> nil then
// begin
// self.Text := WideCharLenToString(wText, wLength);
// end;
self.TextHeight := TextHeight;
self.UseOutlines := UseOutlines;
self.VarName := VarName;
self.WordWrap := WordWrap;
self.HasColor := HasColor;
if HasColor then
self.Color.Assign(Color);
self.HasMaxLen := HasMaxLen;
if HasMaxLen then
self.MaxLength := MaxLength;
end;
end;
function TFlashText.GetCharSpacing: Integer;
begin
Result := FCharSpacing div MultCoord;
end;
function TFlashText.GetColor: TSWFRGBA;
begin
HasColor := true;
Result := FColor;
end;
function TFlashText.GetDynamicText: Boolean;
begin
Result := FDynamicText;
end;
function TFlashText.GetIndent: Integer;
begin
Result := FIndent div MultCoord;
end;
function TFlashText.GetLeading: Integer;
begin
Result := FLeading div MultCoord;
end;
function TFlashText.GetLeftMargin: Integer;
begin
Result := FLeftMargin div MultCoord;
end;
function TFlashText.GetMatrix: TSWFMatrix;
begin
if FMatrix = nil then FMatrix := TSWFMatrix.Create;
Result := FMatrix;
end;
function TFlashText.GetRightMargin: Integer;
begin
Result := FRightMargin div MultCoord;
end;
function TFlashText.GetTextExtentPoint: TSize;
begin
if Assigned(Font) then
{$IFNDEF VER130}
Result := Font.GetTextExtentPointW(WideText);
{$ELSE}
Result := Font.GetTextExtentPoint(Text);
{$ENDIF}
end;
function TFlashText.GetTextHeight: Word;
begin
Result := FTextHeight div MultCoord;
end;
procedure TFlashText.InitVar(s: string);
begin
text := S;
FCharSpacing := 0;
FBounds := TSWFRect.Create;
FColor := TSWFRGBA.Create;
end;
{$IFNDEF VER130}
procedure TFlashText.InitVar(S: WideString);
begin
InitVarW(S);
end;
{$ENDIF}
procedure TFlashText.InitVarW(S: WideString);
begin
WideText := S;
Text := S;
FCharSpacing := 0;
FBounds := TSWFRect.Create;
FColor := TSWFRGBA.Create;
end;
function TFlashText.MinVersion: Byte;
begin
Result := SWFVer3 + byte(DynamicText);
end;
procedure TFlashText.SetAlign(Value: TSWFTextAlign);
begin
HasLayout := true;
FAlign := Value;
end;
procedure TFlashText.SetCharSpacing(Value: Integer);
begin
FCharSpacing := Value * MultCoord;
end;
procedure TFlashText.SetDynamicText(Value: Boolean);
begin
if value then
begin
ReadOnly := false;
NoSelect := false;
end;
FDynamicText := Value;
end;
procedure TFlashText.SetFont(F: TFlashFont);
begin
FFont := F;
if DynamicText
then F.FontUsing := F.FontUsing + [fuDynamicText]
else F.FontUsing := F.FontUsing + [fuStaticText];
end;
procedure TFlashText.SetBounds(R: TRect);
begin
Bounds.Rect := Rect(R.Left * MultCoord, R.Top * MultCoord,
R.Right * MultCoord, R.Bottom * MultCoord);
end;
procedure TFlashText.SetHasLayout(Value: Boolean);
begin
if Font <> nil then Font.Layout := value;
FHasLayout := Value;
end;
procedure TFlashText.SetHTML(Value: Boolean);
begin
if Value then FDynamicText := true;
FHTML := Value;
end;
procedure TFlashText.SetIndent(Value: Integer);
begin
HasLayout := true;
FIndent := value * MultCoord;
end;
procedure TFlashText.SetLeading(Value: Integer);
begin
HasLayout := true;
FLeading := Value * MultCoord;
end;
procedure TFlashText.SetLeftMargin(Value: Integer);
begin
HasLayout := true;
FLeftMargin := value * MultCoord;
end;
procedure TFlashText.SetMaxLength(Value: Integer);
begin
HasMaxLen := true;
FMaxLength := Value;
end;
procedure TFlashText.SetRightMargin(Value: Integer);
begin
HasLayout := true;
FRightMargin := value * MultCoord;
end;
procedure TFlashText.SetText(Value: AnsiString);
begin
if FText <> Value then
begin
if Font <> nil then Font.AddChars(Value);
FText := Value;
end;
end;
procedure TFlashText.SetTextHeight(Value: Word);
begin
FTextHeight := Value * MultCoord;
end;
procedure TFlashText.SetUseOutlines(Value: Boolean);
begin
FUseOutlines := Value;
if Font <> nil then Font.AsDevice := false;
end;
procedure TFlashText.SetWideText(Value: WideString);
begin
if FWideText <> Value then
begin
if Font <> nil then Font.AddChars(Value);
FWideText := Value;
end;
end;
procedure TFlashText.WriteToStream(be: TBitsEngine);
var
Bits: Byte;
il: Integer;
GE: TSWFGlyphEntry;
DText: TSWFDefineText;
RText: TSWFTextRecord;
Ch: TFlashChar;
SaveWide: Boolean;
CodeList: TList;
BRect: TRect;
function GetHTMLTags(open: boolean): string;
begin
result := '';
if HTML and (Font <> nil) then
begin
if open then
begin
result := '<font face="'+Font.Name+'">';
if Font.Bold then result := result + '<b>';
if Font.Italic then result := result + '<i>';
end else
begin
result := '</font>';
if Font.Bold then result := '</b>' + result;
if Font.Italic then result := '</i>' + result;
end;
end;
end;
begin
if DynamicText then
with TSWFDefineEditText.Create do
begin
SWFVersion := owner.Version;
CharacterID := FCharacterID;
if InitAsPoint then
Bounds.Rect := Rect(FPtAnchor.X, FPtAnchor.Y, FPtAnchor.X, FPtAnchor.Y)
else
Bounds.Assign(self.Bounds);
AutoSize := FAutoSize;
Border := FBorder;
HTML := FHTML;
Multiline := FMultiline;
NoSelect := FNoSelect;
Password := FPassword;
ReadOnly := FReadOnly;
UseOutlines := FUseOutlines or not Font.AsDevice;
WordWrap := FWordWrap;
if Font <> nil then
begin
HasFont := true;
FontID := Font.CharacterId;
FontHeight := FTextHeight;
end;
if HasColor then
begin
HasTextColor := true;
TextColor.Assign(Color);
end;
if HasMaxLen then
begin
HasMaxLength := true;
MaxLength := FMaxLength;
end;
if self.HasLayout then
begin
HasLayout := true;
Align := FAlign;
LeftMargin := FLeftMargin;
RightMargin := FRightMargin;
Indent := FIndent;
Leading := FLeading;
end;
VariableName := VarName;
if Font.WideCodes then
begin
if WideText <> '' then
begin
HasText := true;
WideInitialText := GetHTMLTags(true) + WideText + GetHTMLTags(false);
end;
end
else
if Text <> '' then
begin
HasText := true;
InitialText := GetHTMLTags(true) + Text + GetHTMLTags(false);
end;
WriteToStream(BE);
Free;
end else
// ==== Static text ====
if (WideText = '') and (Text <> '') then
begin
if Color.A < $FF then DText := TSWFDefineText2.Create
else DText := TSWFDefineText.Create;
With DText do
begin
Font.FillCharsInfo;
CharacterID := FCharacterID;
if InitAsPoint {AutoSize} then
begin
With Font.GetTextExtentPoint(Text) do
begin
CX := Round(CX/Font.FSize * FTextHeight);
CY := Round(CY/Font.FSize * FTextHeight);
BRect := Rect(0, 0, CX, CY);
OffsetRect(BRect, FPtAnchor.X, FPtAnchor.Y);
Case Align of
taCenter, taJustify: OffsetRect(BRect, - CX div 2, 0);
taRight: OffsetRect(BRect, - CX, 0);
end;
end;
end else
BRect := Bounds.Rect;
TextBounds.Rect := BRect;
TextMatrix.Assign(Matrix);
GlyphBits := 0;
AdvanceBits := 0;
RText := TSWFTextRecord.Create;
RText.FontID := Font.CharacterId;
RText.TextColor.Assign(Color);
RText.TextHeight := FTextHeight;
RText.YOffset := Round(Font.Ascent/EMS * FTextHeight) + BRect.Top;
if BRect.Left <> 0 then
RText.XOffset := BRect.Left;
SaveWide := Font.WideCodes or (Font.EncodingType = encodeUnicode);
if not SaveWide then
begin
CodeList := TList.Create;
for il := 0 to Font.CharList.Count - 1 do
CodeList.Add(Pointer(Font.CharInfoInd[il].Code));
CodeList.Sort(_CodeSort);
end;
For il := 1 to length(Text) do
begin
GE := TSWFGlyphEntry.Create;
Ch := Font.CharInfo[ord(Text[il])];
if SaveWide
then GE.GlyphIndex := Font.CharList.IndexOf(Ch)
else GE.GlyphIndex := CodeList.IndexOf(Pointer(Ch.Code));
GE.GlyphAdvance := Round(Ch.GlyphAdvance/EMS * FTextHeight) + FCharSpacing;
RText.GlyphEntries.Add(GE);
Bits := GetBitsCount(GE.GlyphIndex);
if GlyphBits < Bits then GlyphBits := Bits;
Bits := GetBitsCount(GE.GlyphAdvance, 1);
if AdvanceBits < Bits then AdvanceBits := Bits;
end;
TextRecords.Add(RText);
if not SaveWide then CodeList.Free;
end;
DText.WriteToStream(be);
DText.Free;
end;
// WideString
if not DynamicText and (WideText <> '') then
begin
if Color.A < $FF then DText := TSWFDefineText2.Create
else DText := TSWFDefineText.Create;
With DText do
begin
Font.FillCharsInfo;
CharacterID := FCharacterID;
if InitAsPoint {AutoSize} then
begin
With Font.GetTextExtentPoint(WideText) do
begin
BRect := Rect(0, 0, CX, CY);
OffsetRect(BRect, FPtAnchor.X, FPtAnchor.Y);
Case Align of
taCenter, taJustify: OffsetRect(BRect, - CX div 2, 0);
taRight: OffsetRect(BRect, - CX, 0);
end;
end;
end else
BRect := Bounds.Rect;
TextBounds.Rect := BRect;
TextMatrix.Assign(Matrix);
GlyphBits := 0;
AdvanceBits := 0;
RText := TSWFTextRecord.Create;
RText.FontID := Font.CharacterId;
RText.TextColor.Assign(Color);
RText.TextHeight := FTextHeight;
RText.YOffset := Round(Font.Ascent/EMS * FTextHeight) + BRect.Top;
if BRect.Left <> 0 then
RText.XOffset := BRect.Left;
For il := 1 to Length(WideText) do
begin
GE := TSWFGlyphEntry.Create;
Ch := Font.CharInfo[ord(WideText[il])];
GE.GlyphIndex := Font.CharList.IndexOf(Ch);
GE.GlyphAdvance := Round(Ch.GlyphAdvance/EMS * FTextHeight) + FCharSpacing;
RText.GlyphEntries.Add(GE);
Bits := GetBitsCount(GE.GlyphIndex);
if GlyphBits < Bits then GlyphBits := Bits;
Bits := GetBitsCount(GE.GlyphAdvance, 1);
if AdvanceBits < Bits then AdvanceBits := Bits;
end;
TextRecords.Add(RText);
end;
DText.WriteToStream(be);
DText.Free;
end;
end;
// =============================================================//
// TFlashButton //
// =============================================================//
{
******************************************************* TFlashButton ********************************************************
}
constructor TFlashButton.Create(owner: TFlashMovie; hasmenu: boolean = false; advMode: boolean = true);
var AL: TSWFActionList;
begin
inherited Create(owner);
if advMode then
begin
fButton:= TSWFDefineButton2.Create;
GetButton2.TrackAsMenu := hasmenu;
end
else fButton := TSWFDefineButton.Create;
self.advMode := advMode;
AL := TSWFActionList(LongInt(1));
fFlashActionList := TFlashActionScript.Create(owner, AL);
fButtonSound := TSWFDefineButtonSound.Create;
end;
destructor TFlashButton.destroy;
begin
fButtonSound.Free;
fFlashActionList.free;
fButton.Free;
inherited;
end;
function TFlashButton.Actions: TFlashActionScript;
begin
if not advMode
then fFlashActionList.fActionList := fButton.Actions
else fFlashActionList.fActionList := FindActionEvent(beRelease);
Result := fFlashActionList;
end;
function TFlashButton.AddCondAction(FE: TFlashButtonEvents): TSWFButtonCondAction;
var
il: Integer;
begin
Result := TSWFButtonCondAction.Create;
for il := Integer(IdleToOverUp) to Integer(OverDownToIdle) do
if TFlashButtonEvent(il) in FE then
Result.ActionConditions := Result.ActionConditions + [TSWFStateTransition(il)];
GetButton2.Actions.Add(Result);
end;
function TFlashButton.AddRecord(Shape: TFlashVisualObject; BS: TSWFButtonStates; depth: word = 1): TSWFButtonRecord;
begin
result := AddRecord(Shape.CharacterId, BS, depth);
end;
function TFlashButton.AddRecord(Sprite: TFlashSprite; BS: TSWFButtonStates; depth: word = 1): TSWFButtonRecord;
begin
Result := AddRecord(Sprite.CharacterId, BS, depth);
end;
function TFlashButton.AddRecord(ID: Word; BS: TSWFButtonStates; depth: word = 1): TSWFButtonRecord;
begin
Result := TSWFButtonRecord.Create(ID);
Result.Depth := depth;
Result.ButtonState := BS;
Result.hasColorTransform := advMode;
if advMode then Result.ColorTransform.hasAlpha := true;
fButton.ButtonRecords.Add(Result);
end;
procedure TFlashButton.Assign(Source: TBasedSWFObject);
begin
inherited;
With TFlashButton(Source) do
begin
self.fButton.Assign(fButton);
self.advMode := advMode;
self.fButtonSound.Assign(fButtonSound);
end;
end;
{$IFDEF ASCompiler}
function TFlashButton.CompileEvent(src: TStrings): boolean;
var S: TMemoryStream;
begin
S := TMemoryStream.Create;
src.SaveToStream(S);
Result := CompileEvent(S);
S.Free;
end;
function TFlashButton.CompileEvent(src: TStream): boolean;
begin
try
src.Position := 0;
owner.ASCompiler.CompileAction(src, self);
Result := true;
except
on E: Exception do
begin
owner.ASCompilerLog.Write(PChar(E.Message)^, Length(E.Message));
Result := false;
end;
end;
end;
function TFlashButton.CompileEvent(src: string): boolean;
var S: TMemoryStream;
P: Pointer;
begin
S := TMemoryStream.Create;
P := @src[1];
S.Write(P^, length(src));
Result := CompileEvent(S);
S.Free;
end;
function TFlashButton.CompileEvent(FileName: string; unicode: boolean): boolean;
var F: TFileStream;
begin
F := TFileStream.Create(Filename, fmOpenRead);
/// if unicode - todo
Result := CompileEvent(F);
F.free;
end;
{$ENDIF}
function TFlashButton.FindActionEvent(FE: TFlashButtonEvent; CreateNoExist: boolean = true): TSWFActionList;
var
il: Integer;
CA: TSWFButtonCondAction;
begin
Result := nil;
if GetButton2.Actions.Count > 0 then
For il:=0 to GetButton2.Actions.Count - 1 do
begin
CA := TSWFButtonCondAction(GetButton2.Actions[il]);
if TSWFStateTransition(byte(FE)) in CA.ActionConditions then
begin
Result := CA;
Break;
end;
end;
if (Result = nil) and CreateNoExist then
Result := AddCondAction([FE]);
end;
function TFlashButton.GetButton: TSWFDefineButton;
begin
Result := TSWFDefineButton(fButton);
end;
function TFlashButton.GetButton2: TSWFDefineButton2;
begin
Result := TSWFDefineButton2(fButton);
end;
function TFlashButton.MinVersion: Byte;
begin
Result := SWFVer1 + 2 * Byte(advMode);
end;
function TFlashButton.OnClickActions: TFlashActionScript;
begin
if advMode then Result := OnReleaseActions else
begin
fFlashActionList.fActionList := fButton.Actions;
Result := fFlashActionList;
end;
end;
function TFlashButton.OnDragOutActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(beDragOut);
Result := fFlashActionList;
end;
function TFlashButton.OnDragOverActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(beDragOver);
Result := fFlashActionList;
end;
function TFlashButton.OnMenuDragOutActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(beMenuDragOut);
Result := fFlashActionList;
end;
function TFlashButton.OnMenuDragOverActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(beMenuDragOver);
Result := fFlashActionList;
end;
function TFlashButton.OnPressActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(bePress);
Result := fFlashActionList;
end;
function TFlashButton.OnReleaseActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(beRelease);
Result := fFlashActionList;
end;
function TFlashButton.OnReleaseOutsideActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(beReleaseOutside);
Result := fFlashActionList;
end;
function TFlashButton.OnRollOutActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(beRollOut);
Result := fFlashActionList;
end;
function TFlashButton.OnRollOverActions: TFlashActionScript;
begin
fFlashActionList.fActionList := FindActionEvent(beRollOver);
Result := fFlashActionList;
end;
procedure TFlashButton.SetCharacterId(v: word);
begin
inherited;
fButton.ButtonId := v;
end;
function TFlashButton.SndPress: TSWFStartSound;
begin
Result := fButtonSound.SndOverUpToOverDown;
end;
function TFlashButton.SndRelease: TSWFStartSound;
begin
Result := fButtonSound.SndOverDownToOverUp;
end;
function TFlashButton.SndRollOut: TSWFStartSound;
begin
Result := fButtonSound.SndOverUpToIdle;
end;
function TFlashButton.SndRollOver: TSWFStartSound;
begin
Result := fButtonSound.SndIdleToOverUp;
end;
procedure TFlashButton.WriteToStream(be: TBitsEngine);
begin
fButton.WriteToStream(be);
if fButtonSound.HasIdleToOverUp or fButtonSound.HasOverDownToOverUp or
fButtonSound.HasOverUpToIdle or fButtonSound.HasOverUpToOverDown
then
begin
fButtonSound.ButtonId := CharacterID;
fButtonSound.WriteToStream(be);
end
end;
// =============================================================//
// TFlashCanvas //
// =============================================================//
type
TGDIHandleType = (htPen, htBrush, htFont, htMonoBrush, htDibBrush);
TGDIHandleInfo = class (TObject)
private
HandleType: TGDIHandleType;
end;
TGDIHandlePen = class (TGDIHandleInfo)
private
FInfo: TLogPen;
public
constructor Create(LP: TLogPen); overload;
constructor Create(LP: TExtLogPen); overload;
property Info: TLogPen read FInfo write FInfo;
end;
{
******************************************************* TGDIHandlePen *******************************************************
}
constructor TGDIHandlePen.Create(LP: TLogPen);
begin
HandleType := htPen;
Info := LP;
if Info.lopnStyle = PS_INSIDEFRAME
then FInfo.lopnStyle := PS_SOLID;
end;
constructor TGDIHandlePen.Create(LP: TExtLogPen);
begin
HandleType := htPen;
// Info := LP;
FInfo.lopnColor := LP.elpColor;
FInfo.lopnWidth.X := LP.elpWidth;
FInfo.lopnStyle := LP.elpPenStyle and 7;
if Info.lopnStyle > PS_NULL
then FInfo.lopnStyle := PS_SOLID;
end;
type
TGDIHandleBrush = class (TGDIHandleInfo)
private
FInfo: TLogBrush;
public
constructor Create(LB: TLogBrush);
property Info: TLogBrush read FInfo write FInfo;
end;
{
****************************************************** TGDIHandleBrush ******************************************************
}
constructor TGDIHandleBrush.Create(LB: TLogBrush);
begin
HandleType := htBrush;
Info := LB;
end;
type
TGDIHandleDibBrush = class (TGDIHandleInfo)
private
FInfo: TMemoryStream;
Img: TFlashImage;
public
constructor Create(EMFR:Cardinal);
destructor Destroy; override;
property Info: TMemoryStream read FInfo write FInfo;
end;
{
**************************************************** TGDIHandleDibBrush *****************************************************
}
constructor TGDIHandleDibBrush.Create(EMFR:Cardinal);
var
BMP: TBMPReader;
begin
with PEMRCreateDIBPatternBrushPt(EMFR)^ do
begin
Img := nil;
Info:=TMemoryStream.Create;
BMP := TBMPReader.Create;
BMP.SetInterfaceIndirect(Pointer(Cardinal(EMFR) + offBits), PBMInfo(Cardinal(EMFR) + offBmi)^);
BMP.SaveToStream(Info);
BMP.Free;
HandleType := htDibBrush;
Info.Position:=0;
end;
end;
destructor TGDIHandleDibBrush.Destroy;
begin
inherited;
if FInfo <> nil then FInfo.Free;
end;
type
TGDIHandleMonoBrush = class (TGDIHandleInfo)
private
FInfo: TMemoryStream;
Img: TFlashImage;
public
constructor Create(EMFR:Cardinal);
destructor Destroy; overload; override;
property Info: TMemoryStream read FInfo write FInfo;
end;
{
**************************************************** TGDIHandleMonoBrush ****************************************************
}
constructor TGDIHandleMonoBrush.Create(EMFR:Cardinal);
var
Offset, il: Cardinal;
PBuff: Pointer;
B: Byte;
pb: PByte;
begin
with PEMRCREATEMONOBRUSH(EMFR)^ do
begin
HandleType := htMonoBrush;
Info := TmemoryStream.Create;
Info.Position:=10;
Offset:=cbBmi+14+8; //cbBmiSrc+cbBitsSrc;
Info.Write(Offset, 4);
PBuff:=Pointer(EMFR + offBmi);
Info.WriteBuffer(PBuff^, cbBmi);
Info.Seek(14 - integer(cbBmi), soFromCurrent);
b := 8;
Info.Write(b, 1);
Info.Seek(0, soFromEnd);
Offset:=$FFFFFFFF; Info.Write(Offset, 4); // While
Offset:=$0; Info.Write(Offset, 4); //Black
pb:=Pointer(EMFR + offBits);
for il:=0 to 7 do
begin
for Offset:=7 downto 0 do
begin
B:=((pb^ shr Offset) xor $FF) and 1;
Info.Write(B,1);
end;
inc(pb,4);
end;
Info.Position:=0;
end;
end;
destructor TGDIHandleMonoBrush.Destroy;
begin
inherited;
if FInfo <> nil then FInfo.Free;
end;
type
TGDIHandleFont = class (TGDIHandleInfo)
private
FInfo: TExtLogFontW;
public
constructor Create(LF: TExtLogFontW);
property Info: TExtLogFontW read FInfo write FInfo;
end;
{
****************************************************** TGDIHandleFont *******************************************************
}
constructor TGDIHandleFont.Create(LF: TExtLogFontW);
begin
HandleType := htFont;
Info := LF;
end;
type
MTriVertex = packed record
x: LongInt;
y: LongInt;
red: Word;
green: Word;
blue: Word;
alpha: Word;
end;
ASmP = array of TSmallPoint;
ALnP = array of TPoint;
ABytes = array of byte;
FVer = array of MTriVertex;
ACPoly = array of DWord;
{
****************************************************** TMETAFont *******************************************************
constructor TMetaFont.Create;
begin
inherited;
end;
}
constructor TFSpriteCanvas.Create(owner: TFlashMovie);
begin
inherited;
ZeroMemory(@FXForm, SizeOf(FXForm));
FXForm.eM11 := 1;
FXForm.eM22 := 1;
end;
{
******************************************************* TFlashCanvas ********************************************************
}
const
EMR_COLORMATCHTOTARGETW = 121;
EMR_CREATECOLORSPACEW = 122;
var
isGDIOut: boolean;
function isGDIOutTag(tag: dword): boolean;
begin
Result := tag in [EMR_POLYBEZIER,EMR_POLYGON,EMR_POLYLINE,EMR_POLYBEZIERTO,
EMR_POLYLINETO,EMR_POLYPOLYLINE,EMR_POLYPOLYGON,
EMR_SETPIXELV, EMR_ANGLEARC,EMR_ELLIPSE,EMR_RECTANGLE,EMR_ROUNDRECT,EMR_ARC,EMR_CHORD,EMR_PIE,
EMR_EXTFLOODFILL,EMR_LINETO,EMR_ARCTO,
EMR_POLYDRAW,EMR_FILLPATH,EMR_STROKEANDFILLPATH,EMR_STROKEPATH,EMR_FLATTENPATH,EMR_WIDENPATH,
EMR_FILLRGN,EMR_FRAMERGN,EMR_INVERTRGN,EMR_PAINTRGN,
EMR_BITBLT,EMR_STRETCHBLT,EMR_MASKBLT,EMR_PLGBLT,EMR_STRETCHDIBITS,
EMR_EXTTEXTOUTA,EMR_EXTTEXTOUTW,EMR_POLYBEZIER16,EMR_POLYGON16,EMR_POLYLINE16,
EMR_POLYBEZIERTO16,EMR_POLYLINETO16,EMR_POLYPOLYLINE16,EMR_POLYPOLYGON16,EMR_POLYDRAW16,
EMR_POLYTEXTOUTA,EMR_POLYTEXTOUTW, EMR_DRAWESCAPE,EMR_SMALLTEXTOUT,
EMR_ALPHABLEND, EMR_ALPHADIBBLEND,EMR_TRANSPARENTBLT,EMR_TRANSPARENTDIB,EMR_GRADIENTFILL];
end;
function EnumGDIOut(DC: HDC; HTable: PHandleTable; EMFR: PEnhMetaRecord; nObj: Integer; Sender: TFlashCanvas): BOOL; stdcall;
begin
isGDIOut := isGDIOutTag(EMFR^.iType);
Result := not isGDIOut;
end;
type
TObjMFRecord = class
Rec: PEnhMetaRecord;
PrevGDI: TObjMFRecord;
IsGDIOut: boolean;
IsDraw: boolean;
FromRend: boolean;
SpecDraw: byte;
fROP: dword;
constructor Create(P: PEnhMetaRecord);
end;
constructor TObjMFRecord.Create(P: PEnhMetaRecord);
begin
Rec := P;
IsGDIOut := isGDIOutTag(P^.iType);
IsDraw := true;
FromRend := false;
SpecDraw := 0;
case P^.iType of
EMR_BITBLT: fROP := PEMRBITBLT(P)^.dwRop;
EMR_STRETCHBLT: fROP := PEMRSTRETCHBLT(P)^.dwRop;
EMR_STRETCHDIBITS: fROP := PEMRSTRETCHDIBITS(P)^.dwRop;
end;
if fROP = $00AA0029 then IsDraw := false;
end;
constructor TFlashCanvas.Create(Owner: TFlashMovie);
begin
inherited Create;
FOwner := Owner;
EmbeddedFont := True;
if HTables = nil then HTables := TObjectList.Create(false);
//if CUrDepth = 0 then CurDepth := 3;
if CurShape = 0 then CurShape := 1;
RootScaleX := 1;
RootScaleY := 1;
RenderOptions := [roUseBuffer];
// MainSprite := Owner.AddSprite;
BufferBMP := TBMPReader.Create;
InitHandle;
ListMFRecords := TObjectList.Create;
FTextMetricSize := 0;
FTextMetric := nil;
end;
destructor TFlashCanvas.Destroy;
var il: integer;
begin
BufferBMP.Free;
if HTables <> nil then
begin
for il := 0 to HTables.Count - 1 do
if HTables[il] <> nil then HTables[il].Free;
HTables.Free;
end;
ListMFRecords.Free;
if FTextMetricSize > 0 then
FreeMem(FTextMetric, FTextMetricSize);
inherited;
end;
function TFlashCanvas.IsEmptyMetafile(MetaHandle: THandle = 0): boolean;
var
// isGDIOut: boolean;
R: TRect;
il: word;
begin
if MetaHandle = 0 then
begin
Result := true;
if ListMFRecords.Count > 0 then
for il := 0 to ListMFRecords.Count - 1 do
with TObjMFRecord(ListMFRecords.Items[il]) do
if (IsGDIOut and IsDraw) then
begin
Result := false;
break;
end;
end else
begin
isGDIOut := false;
ZeroMemory(@R, SizeOf(R));
EnumEnhMetaFile(0, MetaHandle, @EnumGDIOut, self, R);
Result := not isGDIOut;
end;
end;
Function myCompareRect(R1, R2: TRect): boolean;
var b1, b2: Array [0..3] of Longint;
il: byte;
begin
Move(R1, b1, SizeOf(R1));
Move(R2, b2, SizeOf(R2));
Result := true;
if ((R1.Bottom - R1.Top) = 0) or ((R2.Bottom - R2.Top) = 0)
then Result := CompareMem(@R1, @R2, SizeOf(R1))
else
for il := 0 to 3 do
Result := Result and (b1[il] >= (b2[il] - 1)) and (b1[il] <= (b2[il] + 1));
end;
function TFlashCanvas.isNeedBuffer: boolean;
var
il, PrevID, Rop2: Word;
PrevRect: TRect;
MFRO: TObjMFRecord;
function ChechOkRop(Rop: DWord):Boolean;
begin
case Rop of
SRCCOPY,{ SRCPAINT,} BLACKNESS, WHITENESS, PATCOPY: Result := true;
else Result := false;
end;
end;
procedure CheckBMPRecord(dRect: TRect; bRop: dword);
begin
if (MFRO.SpecDraw > 0) or not MFRO.IsDraw then
begin
MFRO.FromRend := false;
Exit;
end;
if bRop = $00AA0029 then MFRO.IsDraw := false else
if (PrevID > 0) and myCompareRect(PrevRect, dRect)
then TObjMFRecord(ListMFRecords[PrevID]).IsDraw := false
else PrevRect := dRect;
PrevID := il;
if MFRO.IsDraw and not ChechOkRop(bRop) then MFRO.FromRend := true;
end;
begin
PrevID := 0;
UseBMPRender := false;
Rop2 := R2_COPYPEN;
if ListMFRecords.Count > 0 then
for il := 0 to ListMFRecords.Count - 1 do
begin
MFRO := TObjMFRecord(ListMFRecords[il]);
if MFRO.SpecDraw = ooStartTransparentFill then EnableTransparentFill := true else
if MFRO.SpecDraw = ooEndTransparentFill then EnableTransparentFill := false;
if not EnableTransparentFill then
case MFRO.Rec^.iType of
EMR_BITBLT:
with PEMRBITBLT(MFRO.Rec)^ do
begin
CheckBMPRecord(rclBounds, dwRop);
end;
EMR_STRETCHBLT:
with PEMRSTRETCHBLT(MFRO.Rec)^ do
begin
CheckBMPRecord(rclBounds, dwRop);
end;
// EMR_MASKBLT: DoMASKBLT(PEMRMASKBLT(EMFR));
// EMR_PLGBLT: DoPLGBLT(PEMRPLGBLT(EMFR));
// EMR_SETDIBITSTODEVICE: DoSETDIBITSTODEVICE(PEMRSETDIBITSTODEVICE(EMFR));
EMR_STRETCHDIBITS:
with PEMRSTRETCHDIBITS(MFRO.Rec)^ do
begin
CheckBMPRecord(rclBounds, dwRop);
end;
EMR_ALPHABLEND:
if PEMRALPHABLEND(MFRO.Rec)^.cbBitsSrc > 0 then
MFRO.FromRend := true;
EMR_SETROP2:
Rop2 := PEMRSETROP2(MFRO.Rec)^.iMode;
else
begin
if (PrevID > 0) and (il > PrevID) and MFRO.IsGDIOut then PrevID := 0;
if MFRO.IsGDIOut and (Rop2 <> R2_COPYPEN) then MFRO.FromRend := true;
end;
end;
if MFRO.FromRend then UseBMPRender := true;
end;
Result := UseBMPRender;
end;
Procedure TFlashCanvas.ProcessingRecords(MetaHandle: THandle; Width, Height: integer; stretch: boolean);
var
EMFHeader: TEnhMetaHeader;
R: TRect;
function EnumRec(DC: HDC; var HTable: THandleTable; EMFR: PEnhMetaRecord; nObj: Integer; Sender: TFlashCanvas): BOOL; stdcall;
begin
PlayEnhMetaFileRecord(DC, HTable, EMFR^, nObj);
Sender.DoEnhRecord(EMFR);
Result := true;
end;
begin
CurrentRec := 0;
if (roUseBuffer in RenderOptions) then isNeedBuffer;
MetafileSprite := AddActiveSprite(csMetaFile);
FActiveSprite := MetafileSprite;
GetEnhMetaFileHeader(MetaHandle, Sizeof(EMFHeader), @EMFHeader);
with EMFHeader do
MetafileRect := Rect(MulDiv( rclFrame.Left, szlDevice.cx, szlMillimeters.cx * 100),
MulDiv( rclFrame.Top, szlDevice.cy, szlMillimeters.cy * 100),
MulDiv( rclFrame.Right, szlDevice.cx, szlMillimeters.cx * 100),
MulDiv( rclFrame.Bottom, szlDevice.cy, szlMillimeters.cy * 100));
R := Rect(0, 0,
MetafileRect.Right-MetafileRect.Left, MetafileRect.Bottom-MetafileRect.Top);
// if Assigned(BufferBMP) then
// begin
// GetWorldTransform(BufferBMP.DC, FCWorldTransform);
// if FCWorldTransform.eM11 <> 1 then
// begin
// FillChar(FCWorldTransform, SizeOf(FCWorldTransform), 0);
// FCWorldTransform.eM11 := 1;
// FCWorldTransform.eM22 := 1;
// SetWorldTransform(BufferBMP.DC, FCWorldTransform);
// end;
// end;
if (roUseBuffer in RenderOptions) and UseBMPRender then
begin
if stretch and (not (roHiQualityBuffer in RenderOptions)) {and
((Width < R.Right) or (Height < R.Bottom)) }then
begin
BufferBMP.SetSize(Width, Height, 24);
StretchedBMPRender := true;
R := Rect(0,0, Width, Height);
end else BufferBMP.SetSize(R.Right, R.Bottom, 24);
if Owner.BackgroundMode = bmColor then
with Owner.BackgroundColor do BufferBMP.Clear(FRGB(R,G,B))
else BufferBMP.Clear(FRGB($FF,$FF,$FF));
end
else
BufferBMP.SetSize(10, 10, 24);
BgColor := GetBkColor(BufferBMP.DC);
// FillChar(R, SizeOf(R), 0);
EnumEnhMetaFile(BufferBMP.DC{0}, MetaHandle, @EnumRec, self, R);
end;
procedure TFlashCanvas.DoEnhRecord(EMFR: PEnhMetaRecord);
begin
inc(CurrentRec);
if {(roUseBuffer in RenderOptions) and UseBMPRender and }
(CurrentRec < ListMFRecords.Count) and
not TObjMFRecord(ListMFRecords[CurrentRec-1]).IsDraw
then Exit;
if (ShapeLineTo <> nil) and
(not (EMFR^.iType in [EMR_LINETO, {EMR_CLOSEFIGURE,} EMR_MOVETOEX])) then
begin
ShapeLineTo.CalcBounds;
ActiveSprite.PlaceObject(ShapeLineTo, ActiveSprite.MaxDepth + 1 );
ShapeLineTo := nil;
end;
if MustCreateWorldTransform and isGDIOutTag(EMFR^.iType) then
begin
GetWorldTransform(BufferBMP.DC, FCWorldTransform);
// MustCreateWorldTransform := false;
end;
case EMFR^.iType of
// begin-end tags
EMR_HEADER: DoHEADER(PEnhMetaHeader(EMFR));
EMR_EOF: DoEOF(PEMREOF(EMFR));
EMR_GDICOMMENT: DoGDICOMMENT(PEMRGDICOMMENT(EMFR));
// handles
EMR_CREATEPEN: DoCREATEPEN(PEMRCREATEPEN(EMFR));
EMR_EXTCREATEPEN: DoEXTCREATEPEN(PEMREXTCREATEPEN(EMFR));
EMR_CREATEBRUSHINDIRECT: DoCREATEBRUSHINDIRECT(PEMRCREATEBRUSHINDIRECT(EMFR));
EMR_CREATEMONOBRUSH: DoCREATEMONOBRUSH(PEMRCREATEMONOBRUSH(EMFR));
EMR_CREATEDIBPATTERNBRUSHPT: DoCREATEDIBPATTERNBRUSHPT(PEMRCREATEDIBPATTERNBRUSHPT(EMFR));
EMR_EXTCREATEFONTINDIRECTW: DoEXTCREATEFONTINDIRECTW(PEMREXTCREATEFONTINDIRECT(EMFR));
EMR_SELECTOBJECT: DoSELECTOBJECT(PEMRSELECTOBJECT(EMFR));
EMR_DELETEOBJECT: DoDELETEOBJECT(PEMRDELETEOBJECT(EMFR));
// other settings
EMR_SETTEXTCOLOR: DoSETTEXTCOLOR(PEMRSETTEXTCOLOR(EMFR));
EMR_SETTEXTALIGN: DoSETTEXTALIGN(PEMRSETTEXTALIGN(EMFR));
EMR_SETBKCOLOR: DoSETBKCOLOR(PEMRSETBKCOLOR(EMFR));
EMR_SETBKMODE: DoSETBKMODE(PEMRSETBKMODE(EMFR));
EMR_SETROP2: DoSETROP2(PEMRSETROP2(EMFR));
EMR_SETBRUSHORGEX: DoSETBRUSHORGEX(PEMRSETBRUSHORGEX(EMFR));
EMR_SETPOLYFILLMODE: DoSETPOLYFILLMODE(PEMRSETPOLYFILLMODE(EMFR));
EMR_SETARCDIRECTION: DoSETARCDIRECTION(PEMRSETARCDIRECTION(EMFR));
// line draw
EMR_MOVETOEX: DoMOVETOEX(PEMRMOVETOEX(EMFR));
EMR_LINETO: DoLINETO(PEMRLINETO(EMFR));
EMR_SETPIXELV: DoSETPIXELV(PEMRSETPIXELV(EMFR));
EMR_POLYLINE: DoPOLYLINE(PEMRPolyline(EMFR));
EMR_POLYLINETO: DoPOLYLINETO(PEMRPolyline(EMFR));
EMR_POLYGON: DoPOLYGON(PEMRPolyline(EMFR));
EMR_POLYPOLYLINE: DoPOLYPOLYLINE(PEMRPOLYPOLYLINE(EMFR));
EMR_POLYPOLYGON: DoPOLYPOLYGON(PEMRPOLYPOLYGON(EMFR));
EMR_POLYDRAW: DoPOLYDRAW(PEMRPOLYDRAW(EMFR));
EMR_POLYLINE16: DoPOLYLINE16(PEMRPOLYLINE16(EMFR));
EMR_POLYLINETO16: DoPOLYLINETO16(PEMRPOLYLINETO16(EMFR));
EMR_POLYGON16: DoPOLYGON16(PEMRPOLYGON16(EMFR));
EMR_POLYPOLYLINE16: DoPOLYPOLYLINE16(PEMRPOLYPOLYLINE16(EMFR));
EMR_POLYPOLYGON16: DoPOLYPOLYGON16(PEMRPOLYPOLYGON16(EMFR));
EMR_POLYDRAW16: DoPOLYDRAW16(PEMRPOLYDRAW16(EMFR));
// bezier
EMR_POLYBEZIER: DoPOLYBEZIER(PEMRPolyline(EMFR));
EMR_POLYBEZIERTO: DoPOLYBEZIERTO(PEMRPolyline(EMFR));
EMR_POLYBEZIER16: DoPOLYBEZIER16(PEMRPOLYBEZIER16(EMFR));
EMR_POLYBEZIERTO16: DoPOLYBEZIERTO16(PEMRPOLYBEZIERTO16(EMFR));
// curve
EMR_ANGLEARC: DoANGLEARC(PEMRANGLEARC(EMFR));
EMR_ELLIPSE: DoELLIPSE(PEMRELLIPSE(EMFR));
EMR_ARC: DoARC(PEMRARC(EMFR));
EMR_ARCTO: DoARCTO(PEMRARCTO(EMFR));
EMR_CHORD: DoCHORD(PEMRCHORD(EMFR));
EMR_PIE: DoPIE(PEMRPIE(EMFR));
// rectangle
EMR_RECTANGLE: DoRECTANGLE(PEMRRECTANGLE(EMFR));
EMR_ROUNDRECT: DoROUNDRECT(PEMRROUNDRECT(EMFR));
EMR_GRADIENTFILL: DoGRADIENTFILL((EMFR));
EMR_EXTFLOODFILL: DoEXTFLOODFILL(PEMREXTFLOODFILL(EMFR));
// viewport
EMR_SETWINDOWEXTEX: DoSETWINDOWEXTEX(PEMRSETWINDOWEXTEX(EMFR));
EMR_SETWINDOWORGEX: DoSETWINDOWORGEX(PEMRSETWINDOWORGEX(EMFR));
EMR_SETVIEWPORTEXTEX: DoSETVIEWPORTEXTEX(PEMRSETVIEWPORTEXTEX(EMFR));
EMR_SETVIEWPORTORGEX: DoSETVIEWPORTORGEX(PEMRSETVIEWPORTORGEX(EMFR));
EMR_SCALEVIEWPORTEXTEX: DoSCALEVIEWPORTEXTEX(PEMRSCALEVIEWPORTEXTEX(EMFR));
EMR_SCALEWINDOWEXTEX: DoSCALEWINDOWEXTEX(PEMRSCALEWINDOWEXTEX(EMFR));
EMR_SETMAPPERFLAGS: DoSETMAPPERFLAGS(PEMRSETMAPPERFLAGS(EMFR));
EMR_SETMAPMODE: DoSETMAPMODE(PEMRSETMAPMODE(EMFR));
EMR_SETSTRETCHBLTMODE: DoSETSTRETCHBLTMODE(PEMRSETSTRETCHBLTMODE(EMFR));
EMR_SETCOLORADJUSTMENT: DoSETCOLORADJUSTMENT(PEMRSETCOLORADJUSTMENT(EMFR));
EMR_SAVEDC: DoSAVEDC(PEMRSAVEDC(EMFR));
EMR_RESTOREDC: DoRESTOREDC(PEMRRESTOREDC(EMFR));
EMR_SETWORLDTRANSFORM: DoSETWORLDTRANSFORM(PEMRSETWORLDTRANSFORM(EMFR));
EMR_MODIFYWORLDTRANSFORM: DoMODIFYWORLDTRANSFORM(PEMRMODIFYWORLDTRANSFORM(EMFR));
// palette
EMR_SELECTPALETTE: DoSELECTPALETTE(PEMRSELECTPALETTE(EMFR));
EMR_CREATEPALETTE: DoCREATEPALETTE(PEMRCREATEPALETTE(EMFR));
EMR_SETPALETTEENTRIES: DoSETPALETTEENTRIES(PEMRSETPALETTEENTRIES(EMFR));
EMR_RESIZEPALETTE: DoRESIZEPALETTE(PEMRRESIZEPALETTE(EMFR));
EMR_REALIZEPALETTE: DoREALIZEPALETTE(PEMRREALIZEPALETTE(EMFR));
EMR_SETICMMODE: DoSETICMMODE(PEMRSETICMMODE(EMFR));
EMR_CREATECOLORSPACE: DoCREATECOLORSPACE(PEMRSelectColorSpace(EMFR));
EMR_SETCOLORSPACE: DoSETCOLORSPACE(PEMRSelectColorSpace(EMFR));
EMR_DELETECOLORSPACE: DoDELETECOLORSPACE(PEMRSelectColorSpace(EMFR));
EMR_SETMITERLIMIT: DoSETMITERLIMIT(PEMRSETMITERLIMIT(EMFR));
// clip
EMR_EXCLUDECLIPRECT: DoEXCLUDECLIPRECT(PEMREXCLUDECLIPRECT(EMFR));
EMR_INTERSECTCLIPRECT: DoINTERSECTCLIPRECT(PEMRINTERSECTCLIPRECT(EMFR));
// path
EMR_BEGINPATH: DoBEGINPATH(PEMRBEGINPATH(EMFR));
EMR_ENDPATH: DoENDPATH(PEMRENDPATH(EMFR));
EMR_CLOSEFIGURE: DoCLOSEFIGURE(PEMRCLOSEFIGURE(EMFR));
EMR_FILLPATH: DoFILLPATH(PEMRFILLPATH(EMFR));
EMR_STROKEANDFILLPATH: DoSTROKEANDFILLPATH(PEMRSTROKEANDFILLPATH(EMFR));
EMR_STROKEPATH: DoSTROKEPATH(PEMRSTROKEPATH(EMFR));
EMR_FLATTENPATH: DoFLATTENPATH(PEMRFLATTENPATH(EMFR));
EMR_WIDENPATH: DoWIDENPATH(PEMRWIDENPATH(EMFR));
EMR_SELECTCLIPPATH: DoSELECTCLIPPATH(PEMRSELECTCLIPPATH(EMFR));
EMR_ABORTPATH: DoABORTPATH(PEMRABORTPATH(EMFR));
// region
EMR_FILLRGN: DoFILLRGN(PEMRFILLRGN(EMFR));
EMR_FRAMERGN: DoFRAMERGN(PEMRFRAMERGN(EMFR));
EMR_INVERTRGN: DoINVERTRGN(PEMRINVERTRGN(EMFR));
EMR_PAINTRGN: DoPAINTRGN(PEMRPAINTRGN(EMFR));
EMR_EXTSELECTCLIPRGN: DoEXTSELECTCLIPRGN(PEMREXTSELECTCLIPRGN(EMFR));
EMR_OFFSETCLIPRGN: DoOFFSETCLIPRGN(PEMROFFSETCLIPRGN(EMFR));
EMR_SETMETARGN: DoSETMETARGN(PEMRSETMETARGN(EMFR));
// text
EMR_EXTTEXTOUTA: DoEXTTEXTOUTA(PEMREXTTEXTOUT(EMFR));
EMR_EXTTEXTOUTW: DoEXTTEXTOUTW(PEMREXTTEXTOUT(EMFR));
EMR_SMALLTEXTOUT: DoSMALLTEXTOUT((EMFR));
EMR_POLYTEXTOUTA: DoPOLYTEXTOUTA(PEMRPOLYTEXTOUT(EMFR));
EMR_POLYTEXTOUTW: DoPOLYTEXTOUTW(PEMRPOLYTEXTOUT(EMFR));
// bitmap
EMR_BITBLT: DoBITBLT(PEMRBITBLT(EMFR));
EMR_STRETCHBLT: DoSTRETCHBLT(PEMRSTRETCHBLT(EMFR));
EMR_MASKBLT: DoMASKBLT(PEMRMASKBLT(EMFR));
EMR_PLGBLT: DoPLGBLT(PEMRPLGBLT(EMFR));
EMR_SETDIBITSTODEVICE: DoSETDIBITSTODEVICE(PEMRSETDIBITSTODEVICE(EMFR));
EMR_STRETCHDIBITS: DoSTRETCHDIBITS(PEMRSTRETCHDIBITS(EMFR));
EMR_ALPHABLEND: DoALPHABLEND(PEMRALPHABLEND(EMFR));
EMR_ALPHADIBBLEND: DoALPHADIBBLEND((EMFR));
EMR_TRANSPARENTBLT: DoTRANSPARENTBLT(PEMRTRANSPARENTBLT(EMFR));
EMR_TRANSPARENTDIB: DoTRANSPARENTDIB((EMFR));
// openGL
EMR_GLSRECORD: DoGLSRECORD(PEMRGLSRECORD(EMFR));
EMR_GLSBOUNDEDRECORD: DoGLSBOUNDEDRECORD(PEMRGLSBOUNDEDRECORD(EMFR));
EMR_PIXELFORMAT: DoPIXELFORMAT(PEMRPIXELFORMAT(EMFR));
EMR_DRAWESCAPE: DoDRAWESCAPE((EMFR));
EMR_EXTESCAPE: DoEXTESCAPE((EMFR));
EMR_STARTDOC: DoSTARTDOC((EMFR));
EMR_FORCEUFIMAPPING: DoFORCEUFIMAPPING((EMFR));
EMR_NAMEDESCAPE: DoNAMEDESCAPE((EMFR));
EMR_COLORCORRECTPALETTE: DoCOLORCORRECTPALETTE((EMFR));
EMR_SETICMPROFILEA: DoSETICMPROFILEA((EMFR));
EMR_SETICMPROFILEW: DoSETICMPROFILEW((EMFR));
EMR_SETLINKEDUFIS: DoSETLINKEDUFIS((EMFR));
EMR_SETTEXTJUSTIFICATION: DoSETTEXTJUSTIFICATION((EMFR));
EMR_COLORMATCHTOTARGETW: DoCOLORMATCHTOTARGETW((EMFR));
EMR_CREATECOLORSPACEW: DoCREATECOLORSPACEW((EMFR));
end;
LastEMFR := EMFR;
LastCommand := EMFR^.iType;
end;
function TFlashCanvas.GetCopyFromRender(R: TRect): TBMPReader;
begin
Result := TBMPReader.Create();
Result.SetSize(R.Right - R.Left, R.Bottom - R.Top, 24);
Result.CopyRect(BufferBMP, 0, 0, R.Right - R.Left, R.Bottom - R.Top, R.Left, R.Top);
end;
function TFlashCanvas.GetImageFromRender(R: TRect): TFlashImage;
begin
Result := Owner.AddImage();
Result.BMPStorage.SetSize(R.Right - R.Left, R.Bottom - R.Top, 24);
Result.BMPStorage.CopyRect(BufferBMP, 0, 0, R.Right - R.Left, R.Bottom - R.Top, R.Left, R.Top);
Result.MakeDataFromBMP;
end;
procedure TFlashCanvas.DoHeader(EMFR: PEnhMetaHeader);
var il: integer;
tmpForm : XFORM;
begin
if EMFR^.nHandles > 0 then
begin
if HTables = nil then HTables := TObjectList.Create(false);
HTables.Clear;
for il := 0 to EMFR^.nHandles - 1 do HTables.Add(nil);
end;
// FMetaFont := TMetaFont.Create;
// TColor(FMetaFont.FMColor) := $FF000000;
hasInitViewportOrg := false;
FillChar(FCWorldTransform, SizeOf(0), 0);
FCWorldTransform.eM11 := 1;
FCWorldTransform.eM22 := 1;
MustCreateWorldTransform := false;
// SetWorldTransform(BufferBMP.DC, FCWorldTransform);
end;
procedure TFlashCanvas.DoPOLYLINE(EMFR: PEMRPolyline);
var PLP: ALnP;
I: integer;
P0: TPoint;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
if cptl = 1 then
begin
LastMoveToXY := MapPoint(aptl[0]);
Exit;
end;
PLP := @aptl;
P0 := MapPoint(aptl[0]);
with MapPoint(PLP[1]) do
sh:=Owner.AddLine(P0.x, P0.y, X, Y);
for I := 2 to cptl-1 do
With MapPoint(PLP[i]) do
sh.Edges.LineTo(X, Y);
if (EMFR^.emr.iType = EMR_POLYGON) and
((aptl[0].x <> PLP[cptl - 1].x) or (aptl[0].y <> PLP[cptl-1].y)) then
sh.Edges.LineTo(P0.x, P0.y);
Sh.CalcBounds;
ShapeSetStyle(true, EMFR^.emr.iType = EMR_POLYGON, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
if EMFR^.emr.iType = EMR_POLYLINETO then
with MapPoint(PLP[cptl - 1]) do
LastMoveToXY := Point(X, Y);
end;
end;
procedure TFlashCanvas.DoPOLYLINETO(EMFR: PEMRPOLYLINETO);
begin
DoPOLYLINE(EMFR);
end;
procedure TFlashCanvas.DoPOLYGON(EMFR: PEMRPOLYGON);
begin
DoPOLYLINE(EMFR);
end;
procedure TFlashCanvas.DoSETWINDOWEXTEX(EMFR: PEMRSETWINDOWEXTEX);
begin
with EMFR^ do
begin
WindowExt.Right := szlExtent.cx;
WindowExt.Bottom := szlExtent.cy;
hasInitWindow := true;
MustCreateWorldTransform := true;
end;
end;
procedure TFlashCanvas.DoSETWINDOWORGEX(EMFR: PEMRSETWINDOWORGEX);
var P: TPoint;
begin
with EMFR^ do
begin
GetWindowOrgEx(BufferBMP.DC, P);
WindowExt.TopLeft := P;
// WindowExt.TopLeft := ptlOrigin;
hasInitWindowOrg := true;
end;
end;
procedure TFlashCanvas.DoSETVIEWPORTEXTEX(EMFR: PEMRSETVIEWPORTEXTEX);
begin
with EMFR^ do
begin
ViewportExt.Right := szlExtent.cx;
ViewportExt.Bottom := szlExtent.cy;
hasInitViewport := true;
end;
end;
procedure TFlashCanvas.DoSETVIEWPORTORGEX(EMFR: PEMRSETVIEWPORTORGEX);
begin
with EMFR^ do
begin
if LastCommand <> EMR_SETVIEWPORTORGEX then
ViewportExt.TopLeft := ptlOrigin;
// if not hasInitWindow and (ptlOrigin.X = 0) and (ptlOrigin.Y = 0) then
// GlobalOffset := Point(0, 0);
hasInitViewport := true;
hasInitViewportOrg := true;
end;
end;
function TFlashCanvas.GetFlashROP(ROP: DWord): TSWFBlendMode;
begin
case ROP of
SRCCOPY:
Result := bmNormal;
DSTINVERT, PATINVERT:
Result := bmInvert;
SRCPAINT:
Result := bmLighten;
SRCAND:
Result := bmDarken;
SRCINVERT:
Result := bmDifference;
else
Result := bmNormal;
end;
end;
function TFlashCanvas.PlaceROP(BMP: TBMPReader; Bounds: TRect; ROP: DWord; Color: Cardinal): TFlashPlaceObject;
var
newRop: DWord;
FBkColor, tmpBgColor: Cardinal;
Im: TFlashImage;
Blend: TSWFBlendMode;
tmpTransparent: boolean;
UseImg: boolean;
begin
newRop := ROP;
Im := nil;
UseImg := false;
case ROP of
BLACKNESS:
FBkColor := 0;
WHITENESS:
FBkColor := $FFFFFF;
else
FBkColor := Color;
end;
if BMP <> nil then
begin
if (BMP.Width = 1) and (BMP.Height = 1)
then
with BMP.GetPixel(0, 0) do
FBkColor := RGB(r, g, b)
else
begin
UseImg := true;
case ROP of
SRCPAINT:
begin
if (BMP.Bpp = 32) then
FillAlphaNoSrc(BMP, $FF);
end;
NOTSRCCOPY:
begin
InvertRect(BMP.DC, Rect(0,0, BMP.Width, BMP.Height));
newRop := SRCCOPY;
end;
else
if (BMP.Bpp = 32) and not IsInitAlpha(BMP)
then FillAlpha(BMP, $FF);
end;
end;
end;
Sh := Owner.AddRectangle(Bounds);
Blend := bmNormal;
if (roUseBuffer in RenderOptions) and
TObjMFRecord(ListMFRecords[CurrentRec-1]).FromRend then
begin
Im := Owner.AddImage;
Im.BMPStorage.MakeCopy(BMP, true);
Im.GetBMPInfo;
Sh.SetImageFill(Im, fmFit);
end
else
begin
case ROP of
PATCOPY, PATINVERT, PATPAINT, $A000C9{PATAND}:
begin
tmpTransparent := BgTransparent;
BgTransparent := false;
tmpBgColor := BgColor;
// BgColor := FBkColor;
ShapeSetStyle(False, true, Sh);
BgColor := tmpBgColor;
BgTransparent := tmpTransparent;
end;
else
begin
if UseImg then
begin
Im := Owner.AddImage;
Im.BMPStorage.MakeCopy(BMP, true);
Im.GetBMPInfo;
end;
if Im <> nil
then Sh.SetImageFill(Im, fmFit)
else Sh.SetSolidColor(SWFRGB(FBkColor));
end;
end;
case newRop of
SRCCOPY:
Blend := bmNormal;
DSTINVERT:
Blend := bmInvert;
SRCPAINT, PATPAINT:
Blend := bmLighten;
SRCAND, $A000C9:
Blend := bmDarken;
SRCINVERT, PATINVERT:
Blend := bmDifference;
end;
end;
Result := ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
with Result do
begin
if Blend > bmNormal then BlendMode := Blend;
end;
end;
procedure TFlashCanvas.DoBITBLT(EMFR: PEMRBITBLT);
var
BgRect: TRect;
BMP: TBMPReader;
PBits: PByte;
OMFR: TObjMFRecord;
ndwRop : longint;
AsBMP: boolean;
function GetGradientAlpha: integer;
var ilist, ix, iy: integer;
begin
ilist := ListMFRecords.IndexOf(OMFR.PrevGDI);
// iStop := ListMFRecords.IndexOf(OMFR.PrevGDI.PrevGDI);
Result := 0;
while ilist > 0 do
with TObjMFRecord(ListMFRecords[ilist]) do
begin
if Rec.iType = EMR_CREATEDIBPATTERNBRUSHPT then
begin
BMP := TBMPReader.Create;
with TGDIHandleDibBrush(HTables[PEMRCREATEDIBPATTERNBRUSHPT(Rec)^.ihBrush]) do
begin
Info.Position := 0;
BMP.LoadFromStream(Info);
end;
for iy := 0 to 7 do
for ix := 0 to 7 do
if BMP.PixelsB[iy, ix] = 1 then Inc(Result);
Result := - Round(Result/64*255);
BMP.Free;
Break;
end
else dec(ilist);
end;
end;
begin
with EMFR^ do
begin
ndwRop := dwRop;
AsBMP := true;
BgRect := MapRect(Rect(xDest, yDest, xDest + cxDest, yDest + cyDest));
if (BgRect.Bottom - BgRect.Top) = 0 then BgRect.Bottom := BgRect.Bottom + 1;
OMFR := TObjMFRecord(ListMFRecords[CurrentRec-1]);
if OMFR.SpecDraw in [ooStartTransparentFill, ooEndTransparentFill] then
begin
EnableTransparentFill := OMFR.SpecDraw = ooStartTransparentFill;
AsBMP := false;
BMP := nil;
end else
if OMFR.SpecDraw = ooTransparentRect then
begin
ndwRop := SRCCOPY;
AsBMP := false;
Sh := Owner.AddRectangle(BgRect);
ShapeSetStyle(false, true, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1).ColorTransform.addA := GetGradientAlpha;
BMP := nil;
end else
if (roUseBuffer in RenderOptions) and OMFR.FromRend then
begin
BMP := GetCopyFromRender(BgRect);
end else
if cbBitsSrc > 0 then
begin
BMP := TBMPReader.Create;
BMP.SetSizeIndirect(PBMInfo(Longint(EMFR) + offBmiSrc)^);
PBits := Pointer(Longint(EMFR) + offBitsSrc);
Move(PBits^, BMP.Bits^, BMP.SizeImage);
end else
BMP := nil;
if AsBMP {and (BMP <> nil)} then
PlaceROP(BMP, BgRect, ndwRop, crBkColorSrc);
if BMP <> nil then BMP.Free;
end;
end;
procedure TFlashCanvas.DoSTRETCHBLT(EMFR: PEMRSTRETCHBLT);
var
BgRect: TRect;
BMP, Cropped: TBMPReader;
PBits: PByte;
begin
// if EMFR^.dwRop = $00AA0029 then exit; {empty ROP}
with EMFR^ do
begin
BgRect := MapRect(Rect(xDest, yDest, xDest + cxDest, yDest + cyDest));
//BgRect := rclBounds;
if (BgRect.Bottom - BgRect.Top) = 0 then BgRect.Bottom := BgRect.Bottom + 1;
if (roUseBuffer in RenderOptions) and TObjMFRecord(ListMFRecords[CurrentRec-1]).FromRend then
begin
BMP := GetCopyFromRender(BgRect);
end else
if cbBitsSrc > 0 then
begin
BMP := TBMPReader.Create;
BMP.SetSizeIndirect(PBMInfo(Longint(EMFR) + offBmiSrc)^);
PBits := Pointer(Longint(EMFR) + offBitsSrc);
Move(PBits^, BMP.Bits^, BMP.SizeImage);
if (BMP.Width > (cxSrc - xSrc)) or (BMP.Height > (cySrc - ySrc)) then
begin
Cropped := TBMPReader.Create;
Cropped.SetSize(cxSrc, cySrc, BMP.Bpp);
Cropped.CopyRect(BMP, 0, 0, cxSrc, cySrc, xSrc, ySrc);
BMP.Free;
BMP := Cropped;
end;
end else
BMP := nil;
PlaceROP(BMP, BgRect, dwRop, crBkColorSrc);
if BMP <> nil then BMP.Free;
end;
end;
procedure TFlashCanvas.DoSTRETCHDIBITS(EMFR: PEMRSTRETCHDIBITS);
var
BgRect: TRect;
BMP, Cropped: TBMPReader;
PBits: PByte;
PO: TFlashPlaceObject;
LenXY: TPoint;
begin
// if EMFR^.dwRop = $00AA0029 then exit; {empty ROP}
with EMFR^ do
begin
BgRect := MapRect(Rect(xDest, yDest, xDest + cxDest, yDest + cyDest));
BgRect := NormalizeRect(BgRect);
//BgRect := rclBounds;
if (BgRect.Bottom - BgRect.Top) = 0 then BgRect.Bottom := BgRect.Bottom + 1;
if (roUseBuffer in RenderOptions) and TObjMFRecord(ListMFRecords[CurrentRec-1]).FromRend then
begin
BMP := GetCopyFromRender(BgRect);
end else
if cbBitsSrc > 0 then
begin
BMP := TBMPReader.Create;
BMP.SetSizeIndirect(PBMInfo(Longint(EMFR) + offBmiSrc)^);
PBits := Pointer(Longint(EMFR) + offBitsSrc);
Move(PBits^, BMP.Bits^, BMP.SizeImage);
if (BMP.Width > Abs(cxSrc - xSrc)) or (BMP.Height > Abs(cySrc - ySrc)) then
begin
Cropped := TBMPReader.Create;
Cropped.SetSize(cxSrc, cySrc, BMP.Bpp);
Cropped.CopyRect(BMP, 0, 0, cxSrc, cySrc, xSrc, ySrc);
BMP.Free;
BMP := Cropped;
end;
end else
BMP := nil;
PO := PlaceROP(BMP, BgRect, dwRop, 0);
if not(roUseBuffer in RenderOptions) then
begin
LenXY := Point(MapLen(cxDest, false), MapLen(cyDest, true));
if ((LenXY.X < 0) or (LenXY.Y < 0)) then
begin
PO.SetScale(Sign(LenXY.X), Sign(LenXY.Y));
if LenXY.X < 0 then PO.TranslateX := BgRect.Right;
if LenXY.Y < 0 then PO.TranslateY := BgRect.Bottom;
end;
end;
if BMP <> nil then BMP.Free;
end;
end;
procedure TFlashCanvas.DoPOLYPOLYGON16(EMFR: PEMRPOLYPOLYGON16);
var dX, dY, i, J, eSt, eEn : integer;
P0, P1: TPoint;
begin
if DrawMode = dmPath then exit;
with EMFR^ do
begin
dY := Cardinal(@aPolyCounts); // aPolyCounts
dX := dY + 4*nPolys; // apts
sh:=nil;
for J:=0 to nPolys -1 do
begin
if J = 0 then eSt := 0
else eSt := eEn + 1;
if J = (nPolys-1)
then eEn := cpts - 1
else eEn := eSt + aPolyCounts[J]-1;
P0 := MapPoint(AsmP(dX)[eSt]);
if sh = nil then
with MapPoint(AsmP(dX)[eSt+1]) do
sh:=Owner.AddLine(P0.X, P0.Y, X, Y)
else begin
sh.Edges.MoveTo(P0.x, P0.y);
with MapPoint(AsmP(dX)[eSt+1]) do
sh.Edges.LineTo(X, Y);
end;
for I := eSt + 2 to eEn do
begin
P1 := MapPoint(AsmP(dX)[i]);
sh.Edges.LineTo(P1.X, P1.Y);
end;
if (EMFR^.emr.iType = EMR_POLYPOLYGON16) and ((P1.X <> P0.X) or (P1.Y <> P0.Y)) then
sh.Edges.LineTo(P0.X, P0.Y);
end;
Sh.CalcBounds;
ShapeSetStyle(true, EMFR^.emr.iType = EMR_POLYPOLYGON16, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
if EMFR^.emr.iType = EMR_POLYPOLYLINE16 then
LastMoveToXY := MapPoint(AsmP(dX)[eEn]);
end;
end;
procedure TFlashCanvas.DoPOLYPOLYLINE16(EMFR: PEMRPOLYPOLYLINE16);
begin
DoPOLYPOLYGON16(EMFR);
end;
function PreEnumRec(DC: HDC; var HTable: THandleTable; EMFR: PEnhMetaRecord; nObj: Integer; Sender: TFlashCanvas): BOOL; stdcall;
begin
Sender.ListMFRecords.Add(TObjMFRecord.Create(EMFR));
Result := true;
end;
function CheckTransparentRect(MFRO: TObjMFRecord; iType: word): boolean;
begin
Result := (MFRO.fRop = $5A0049) and (MFRO.PrevGDI <> nil) and
(MFRO.PrevGDI.Rec.iType = iType) and (MFRO.PrevGDI.fRop = $A000C9) and
(MFRO.PrevGDI.PrevGDI <> nil) and (MFRO.PrevGDI.PrevGDI.Rec.iType = iType) and
(MFRO.PrevGDI.PrevGDI.fRop = $5A0049);
end;
function CheckTransparentFill(MFRO: TObjMFRecord): boolean;
var PGDI, DGDI: TObjMFRecord;
begin
Result := false;
if PEMRBITBLT(MFRO.Rec)^.dwRop = $5A0049 then
begin
PGDI := MFRO.PrevGDI;
while (PGDI <> nil) do
begin
if (PGDI.Rec.iType = EMR_BITBLT) then
begin
if (PEMRBITBLT(PGDI.Rec)^.dwRop = $5A0049) and
myCompareRect(PEMRBITBLT(PGDI.Rec)^.rclBounds, PEMRBITBLT(MFRO.Rec)^.rclBounds) then
begin
Result := true;
PGDI.SpecDraw := ooStartTransparentFill;
DGDI := MFRO.PrevGDI;
while PGDI <> DGDI do
begin
DGDI.FromRend := false;
DGDI := DGDI.PrevGDI;
end;
end;
PGDI := nil;
end else PGDI := PGDI.PrevGDI;
end;
end;
end;
procedure TFlashCanvas.MakeListMFRecords(MetaHandle: THandle; r: TRect);
var il: word;
PrevGDI, MFRO: TObjMFRecord;
PCh: PChar;
begin
ListMFRecords.Clear;
EnumEnhMetaFile(0, MetaHandle, @PreEnumRec, self, r);
PrevGDI := nil;
isEMFPlus := false;
for il := 0 to ListMFRecords.Count - 1 do
begin
MFRO := TObjMFRecord(ListMFRecords[il]);
if (MFRO.Rec.iType = EMR_GDICOMMENT) and not isEMFPlus then
begin
PCh := @PEMRGDICOMMENT(MFRO.Rec)^.Data;
isEMFPlus := Pos('EMF+', Pch) = 1;
end;
if MFRO.IsGDIOut then
begin
if (PrevGDI <> nil) then MFRO.PrevGDI := PrevGDI;
PrevGDI := MFRO;
end;
end;
if (roOptimization in RenderOptions) and isEMFPlus then
for il := 0 to ListMFRecords.Count - 1 do
begin
MFRO := TObjMFRecord(ListMFRecords[il]);
case MFRO.Rec.iType of
EMR_BITBLT:
begin
if CheckTransparentFill(MFRO) then
begin
MFRO.SpecDraw := ooEndTransparentFill;
end else
if CheckTransparentRect(MFRO, EMR_BITBLT) then
begin
MFRO.SpecDraw := ooTransparentRect;
MFRO.PrevGDI.IsDraw := false;
MFRO.PrevGDI.PrevGDI.IsDraw := false;
end;
end;
end;
end;
end;
procedure TFlashCanvas.MakeTextOut(WText: WideString; Point0: TPoint; Bounds,
ClippRect: TRect; TextWidth: Integer; fOptions: word; PAWidth: Pointer;
WCount: integer; iGraphicsMode: DWord);
var
FMFont: TFont;
FlashFont: TFlashFont;
NativTextWidth: longint;
Point1: TPoint;
MustCharsSprite: boolean;
BgRect: TRect;
TextSprite, CharsSprite: TFlashSprite;
StrikeOutShape, UnderlineShape: TFlashShape;
CharsList: TObjectList;
XPos, il: longint;
St: TFlashText;
PInt: PLongint;
AWidth: ACPoly absolute PInt;
function TextAlignParse(TA: DWord; vert: boolean): byte;
begin
if Vert then
begin
if TA >= TA_BASELINE then Result := TA_BASELINE else
if TA < TA_BOTTOM then Result := TA_TOP else Result := TA_BOTTOM;
end else
begin
Result := TA and 7;
end;
end;
function fMakeText( T: WideString; R: TRect): TFlashText;
var il: integer;
begin
if (CharsList <> nil) and (CharsList.Count > 0) then
for il := 0 to CharsList.Count -1 do
begin
Result := TFlashText(CharsList.Items[il]);
if Result.WideText = T then Exit;
end;
if FlashFont.AsDevice then
begin
Result := Owner.AddDynamicText('', T, SWFRGBA(TextColor), FlashFont, R);
Result.AutoSize := true;
Result.NoSelect := true;
end else
begin
Result := Owner.AddText(T, SWFRGBA(TextColor), FlashFont, R.TopLeft);
end;
Result.TextHeight := Abs(FMFont.Height);
end;
begin
PInt := PAWidth;
FMFont := TFont.Create;
GetMetrixFont(FMFont);
if (Abs(LogFontInfo.lfHeight) > $FFF) then {bug of metafile}
begin
FMFont.Free;
Exit;
end;
if PrevFont = nil then
begin
FlashFont := owner.Fonts.FindByFont(FMFont, false);
if FlashFont = nil then
FlashFont := Owner.AddFont(LogFontInfo {FMFont}, not EmbeddedFont);
FlashFont.AddChars(WText);
PrevFont := FlashFont;
end else
FlashFont := PrevFont;
// ==== calc width and clipp rect ====
if (Length(WText) > 1) or (TextWidth = 0) then
begin
NativTextWidth := FlashFont.GetTextExtentPoint(WText).cx div 20;
if TextWidth = 0 then TextWidth := NativTextWidth;
MustCharsSprite := abs(NativTextWidth - TextWidth) > 2;
end else MustCharsSprite := false;
if (not MustCharsSprite) and (LogFontInfo.lfOrientation <> 0)
and (WCount > 0) then MustCharsSprite := true;
Point1 := Point(0, 0);
case TextAlignParse(TextAlign, true) of
TA_TOP: Point1.Y := 0;
TA_BASELINE: Point1.Y := - FTextMetric.otmTextMetrics.tmAscent;
TA_BOTTOM: Point1.Y := - FTextMetric.otmTextMetrics.tmHeight;
end;
case TextAlignParse(TextAlign, false) of
TA_LEFT: Point1.X := 0;
TA_CENTER: Point1.X := - TextWidth div 2;
TA_RIGHT: Point1.X := - TextWidth;
end;
if (LogFontInfo.lfEscapement <> 0) or ((fOptions = 0) and (WCount = 0)) then
begin
BgRect := Rect(0, 0, TextWidth, FTextMetric.otmTextMetrics.tmHeight);
OffsetRect(BgRect, Point1.X, Point1.Y);
inc(Point1.Y, 1);
end else
begin
BgRect := Bounds;
OffsetRect(BgRect, -Point0.X, -Point0.Y);
end;
// ==== place background =====
CharsSprite := Owner.AddSprite;
if (fOptions = 0) and (LogFontInfo.lfEscapement = 0)
then TextSprite := CharsSprite
else TextSprite := Owner.AddSprite;
if not BgTransparent then
begin
Sh := Owner.AddRectangle(BgRect);
Sh.SetSolidColor(SWFRGB(BgColor));
with CharsSprite.PlaceObject(Sh, 1) do
begin
end;
end;
if (fOptions <> 0) {or true} then
begin
Sh := Owner.AddRectangle(ClippRect);
if ((fOptions and ETO_OPAQUE) = ETO_OPAQUE) {or true} then
begin
Sh.SetSolidColor(SWFRGB(BgColor));
TextSprite.PlaceObject(Sh, 3);
end;
if (fOptions and ETO_CLIPPED) = ETO_CLIPPED then
begin
if Sh.FillStyleNum = 0 then Sh.SetSolidColor(cswfYellow);
TextSprite.PlaceObject(Sh, 4).ClipDepth := 5;
end;
end;
// ==== decoration shapes ====
if boolean(LogFontInfo.lfStrikeOut) then
begin
StrikeOutShape := Owner.AddRectangle(0, 0, 10, FTextMetric.otmsStrikeoutSize);
StrikeOutShape.SetSolidColor(SWFRGBA(TextColor));
end;
if boolean(LogFontInfo.lfUnderline) then
begin
UnderlineShape := Owner.AddRectangle(0, 0, 10, FTextMetric.otmsUnderscoreSize);
UnderlineShape.SetSolidColor(SWFRGBA(TextColor));
end;
CharsList := nil;
if MustCharsSprite then
begin
CharsList := TObjectList.Create;
XPos := 0;
for il := 1 to Length(WText) do
begin
St := fMakeText(WideString(WText[il]), Rect(0, 0, MapLen(AWidth[il-1], false), FTextMetric.otmTextMetrics.tmHeight));
with CharsSprite.PlaceObject(St, CharsSprite.MaxDepth + 1) do
begin
if Abs(FCWorldTransform.eM11) <> Abs(FCWorldTransform.eM22) then
SetScale(Abs(FCWorldTransform.eM11/FCWorldTransform.eM22), 1) else
if LogFontInfo.lfWidth <> 0 then
SetScale(FontScale{LogFontInfo.lfWidth/FTextMetric.otmTextMetrics.tmAveCharWidth}, 1);
if (LogFontInfo.lfOrientation <> 0) and (iGraphicsMode = GM_ADVANCED) then
SetRotate((-LogFontInfo.lfEscapement + LogFontInfo.lfOrientation)/10);
// if (TGDIHandleFont(HTables[CurrentFont]).Info.elfLogFont.lfHeight < 0)
// then
SetTranslate(Point1.X + MapLen(XPos, false), Point1.Y+Byte(EmbeddedFont));
// else
// SetTranslate(XPos, Point1.Y + Byte(EmbeddedFont));
end;
XPos := XPos + AWidth[il-1];
end;
CharsList.Free;
end else
begin
St := fMakeText(WText, Rect(0, 0, TextWidth, FTextMetric.otmTextMetrics.tmHeight));
with CharsSprite.PlaceObject(St, CharsSprite.MaxDepth + 1) do
begin
if LogFontInfo.lfWidth <> 0 then
SetScale(FontScale{LogFontInfo.lfWidth/FTextMetric.otmTextMetrics.tmAveCharWidth}, 1);
SetTranslate(Point1.X, Point1.Y+Byte(EmbeddedFont));
end;
end;
if LogFontInfo.lfOrientation = 0 then
begin
if boolean(LogFontInfo.lfUnderline) then
with CharsSprite.PlaceObject(UnderlineShape, CharsSprite.MaxDepth + 1) do
begin
SetTranslate(Point1.X, FTextMetric.otmTextMetrics.tmAscent + Point1.Y - FTextMetric.otmsUnderscorePosition);
SetScale((TextWidth - 1)/UnderlineShape.Bounds.Width*twips, 1);
end;
if boolean(LogFontInfo.lfStrikeOut) then
with CharsSprite.PlaceObject(StrikeOutShape, CharsSprite.MaxDepth + 1) do
begin
SetTranslate(Point1.X, FTextMetric.otmTextMetrics.tmAscent + Point1.Y - FTextMetric.otmsStrikeoutPosition);
SetScale((TextWidth - 1)/StrikeOutShape.Bounds.Width*twips, 1);
end;
end;
if TextSprite <> CharsSprite then
with TextSprite.PlaceObject(CharsSprite, 5) do
begin
if LogFontInfo.lfEscapement <> 0 then SetRotate(LogFontInfo.lfEscapement/10);
end;
// ==== main place =====
with ActiveSprite.PlaceObject(TextSprite, ActiveSprite.MaxDepth + 1) do
begin
SetTranslate(Point0.X, Point0.Y);
end;
FMFont.Free;
end;
procedure TFlashCanvas.DoEXTTEXTOUTW(EMFR: PEMREXTTEXTOUT);
var _PW: PWord;
WText: WideString;
il, dX: integer;
PInt: PLongint;
PAWidth: ACPoly absolute PInt;
_PB: PByte;
ClippRect: TRect;
TextWidth: longint;
Point0: TPoint;
WidthCount: integer;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
SetLength(WText, emrtext.nChars);
If EMFR^.emr.iType = EMR_EXTTEXTOUTW then
begin
_PW := Pointer(Cardinal(EMFR)+emrtext.offString);
if ((EMFR^.emrtext.fOptions and ETO_GLYPH_INDEX) = ETO_GLYPH_INDEX) then dx := 29 else dx := 0;
For il := 1 to emrtext.nChars do
begin
WText[il] := WideChar(_PW^ + dx);
inc(_PW);
end;
end else
begin
_PB := Pointer(Cardinal(EMFR)+emrtext.offString);
For il := 1 to emrtext.nChars do
begin
WText[il] := WideChar(_PB^);
inc(_PB);
end;
end;
if (emrtext.offDx > 0) and (emrtext.nChars > 0) then
begin
WidthCount := emrtext.nChars;
PInt := Pointer(Cardinal(EMFR) + emrtext.offDx);
end else
begin
WidthCount := 0;
PInt := nil;
end;
end;
// exit;
if (DrawMode = dmPath) or (WText = '') or
((Trim(WText) = '') and not(((EMFR^.emrtext.fOptions and ETO_OPAQUE) = ETO_OPAQUE) or
((TextAlign and TA_UPDATECP) = TA_UPDATECP))) then Exit;
with EMFR^ do
begin
// ==== get start point ====
if (TextAlign and TA_UPDATECP) = TA_UPDATECP then
begin
Point0 := LastMoveToXY;
GetCurrentPositionEx(BufferBMP.DC, @LastMoveToXY);
LastMoveToXY := MapPoint(LastMoveToXY);
end else
begin
Point0 := MapPoint(emrtext.ptlReference);
end;
TextWidth := 0;
if emrtext.offDx > 0 then
begin
for il := 1 to emrtext.nChars do
TextWidth := TextWidth + PAWidth[il-1];
TextWidth := MapLen(TextWidth, false);
end;
if emrtext.fOptions = 0 then ClippRect := Rect(0, 0, 0, 0) else
begin
ClippRect := MapRect(emrtext.rcl);
OffsetRect(ClippRect, -Point0.X, -Point0.Y);
end;
MakeTextOut(WText, Point0, rclBounds, ClippRect, TextWidth, emrtext.fOptions, PAWidth, WidthCount, iGraphicsMode);
end;
end;
procedure TFlashCanvas.DoEXTTEXTOUTA(EMFR: PEMREXTTEXTOUT);
begin
DoEXTTEXTOUTW(EMFR);
end;
type
PEMRSmallTextOut = ^TEMRSmallTextOut;
TEMRSmallTextOut = record
emr: TEMR;
ptlReference: TPoint;
nChars: DWord;
fOptions: DWord;
iGraphicsMode: DWord;
exScale: single;
eyScale: single;
Text: array [0..0] of char;
end;
procedure TFlashCanvas.DoSMALLTEXTOUT(EMFR: PEnhMetaRecord);
var EMRTextOut: PEMRSmallTextOut;
_PB: PByte;
_PW: PWord;
WText: WideString;
il: integer;
begin
EMRTextOut := Pointer(EMFR);
if EMRTextOut.nChars = 0 then Exit;
SetLength(WText, EMRTextOut.nChars);
If (EMRTextOut.fOptions = $100) then
begin
_PW := Pointer(@EMRTextOut.Text);
For il := 1 to EMRTextOut.nChars do
begin
WText[il] := WideChar(_PW^);
inc(_PW);
end;
end else
begin
_PB := Pointer(Longint(@EMRTextOut.Text) + byte((EMRTextOut.fOptions and 516) = 516)*SizeOf(TRect));
For il := 1 to EMRTextOut.nChars do
begin
WText[il] := WideChar(_PB^);
inc(_PB);
end;
end;
MakeTextOut(WText, MapPoint(EMRTextOut.ptlReference),
Rect(0,0,0,0), Rect(0,0,0,0), 0, 0, nil, 0, EMRTextOut^.iGraphicsMode);
end;
procedure TFlashCanvas.DoSCALEVIEWPORTEXTEX(EMFR: PEMRSCALEVIEWPORTEXTEX);
begin
end;
type
PEMRSETICMPROFILE = ^TEMRSETICMPROFILE;
TEMRSETICMPROFILE = record
emr: TEMR;
dwFlags: DWORD;
cbName: DWORD;
cbData: DWORD;
Data: array[0..0] of byte;
end;
procedure TFlashCanvas.DoSETICMPROFILEA(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoSETICMPROFILEW(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoMASKBLT(EMFR: PEMRMASKBLT);
var MStream: TMemoryStream;
dX, dY, eEn, I, J, eSt: integer;
PBuff: Pointer;
Im: TFlashImage;
begin
with EMFR^ do
begin
MStream:=TMemoryStream.Create;
MStream.Position:=10;
dX:=cbBmiSrc + 14;
Mstream.Write(dX, 4);
PBuff:=Pointer(Cardinal(EMFR) + offBmiSrc);
MStream.WriteBuffer(PBuff^, cbBmiSrc);
PBuff:=Pointer(Cardinal(EMFR) + offBitsSrc);
MStream.WriteBuffer(PBuff^, cbBitsSrc);
MStream.Position:=0;
Im:=Owner.AddImage;
Im.LoadDataFromStream(MStream);
MStream.Free;
dX:=cbBitsMask div PBITMAPINFO(Pointer(Cardinal(EMFR) + offBmiMask))^.bmiHeader.biHeight; // Mask Width
eEn:=Cardinal(EMFR) + offBitsMask;
if Im.BMPStorage.Bpp <> 32 Then
begin
MStream:=TMemoryStream.Create;
MStream.Position:=10;
dY:=14+cbBmiSrc; // $28;
Mstream.Write(dY, 4);
PBuff:=Pointer(Cardinal(EMFR) + offBmiSrc);
PBITMAPINFO(PBuff)^.bmiHeader.biBitCount:=32;
MStream.WriteBuffer(PBuff^, cbBmiSrc);
for I := 0 to cyDest-1 do // Iterate
begin
for J:=0 to cxDest-1 do
begin
eSt:=(Im.BMPStorage.Pixels[I,J].r shl 16) or
(Im.BMPStorage.Pixels[I,J].g shl 8) or
Im.BMPStorage.Pixels[I,J].b and $FFFFFF;
MStream.Write(eSt,4);
end;
end; // for
MStream.Position:=0;
Im.LoadDataFromStream(MStream);
end;
for I := 0 to cyDest-1 do // Iterate
begin
PBuff:=Pointer(eEn+I*dX);
for J := 0 to cxDest-1 do // Iterate
begin
if not Boolean((ABytes(PBuff)[J div 8] shr (7-(J mod 8))) And 1) then
begin
Im.BMPStorage.Pixels32[I,J].a:=$FF;
end;
end; // for
end; // for
// end; // if
Sh:=Owner.AddRectangle(xDest,yDest,xDest+cxDest,yDest+cyDest);
Sh.SetImageFill(Im, fmFit);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
end;
end;
procedure TFlashCanvas.DoREALIZEPALETTE(EMFR: PEMRREALIZEPALETTE);
begin
end;
procedure TFlashCanvas.DoCHORD(EMFR: PEMRCHORD);
var dX, dY, eSt, eEn: integer;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
if ClockWs then
begin
dX:=ptlStart.X; dY:=ptlStart.Y;
ptlStart:=ptlEnd;
ptlEnd.X:=dX; ptlEnd.Y:=dY;
end;
Sh:=Owner.AddShape;
Sh.Edges.IgnoreMovieSettings:=True;
dX := twips * (rclBox.Right+rclBox.Left) div 2;
dY := twips * (rclBox.Top+rclBox.Bottom) div 2;
eSt:=Ceil(RadToDeg(ArcTan2(dY-twips * ptlStart.Y, twips * ptlStart.X-dX)));
eEn:=Ceil(RadToDeg(ArcTan2(dY-twips * ptlEnd.Y, twips * ptlEnd.X -dX)));
sh.Edges.MakeArc(dX, dY, dX-twips * rclBox.Left, dY-twips * rclBox.Top,
eSt, eEn, false, false);
Sh.CalcBounds;
Sh.Edges.LineTo(dX+Trunc((dX-twips * rclBox.Left)*cos(DegToRad(eSt))),
(dY-Trunc((dY-twips * rclBox.Top)*sin(DegToRad(eSt)))));
ShapeSetStyle(true, true, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
Sh.Edges.IgnoreMovieSettings:=False;
end;
end;
procedure TFlashCanvas.DoSETWORLDTRANSFORM(EMFR: PEMRSETWORLDTRANSFORM);
begin
FCWorldTransform := EMFR^.xForm;
MustCreateWorldTransform := true;
end;
procedure TFlashCanvas.DoMODIFYWORLDTRANSFORM(EMFR: PEMRMODIFYWORLDTRANSFORM);
begin
MustCreateWorldTransform := true;
SetWTransform(EMFR^.xForm, EMFR^.iMode);
end;
procedure TFlashCanvas.DoSETSTRETCHBLTMODE(EMFR: PEMRSETSTRETCHBLTMODE);
begin
end;
procedure TFlashCanvas.DoSETMAPMODE(EMFR: PEMRSETMAPMODE);
begin
MapMode := EMFR^.iMode;
end;
procedure TFlashCanvas.DoPIXELFORMAT(EMFR: PEMRPIXELFORMAT);
begin
end;
procedure TFlashCanvas.DoGLSBOUNDEDRECORD(EMFR: PEMRGLSBOUNDEDRECORD);
begin
end;
procedure TFlashCanvas.DoALPHADIBBLEND(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoPOLYDRAW16(EMFR: PEMRPOLYDRAW16);
begin
end;
procedure TFlashCanvas.DoPLGBLT(EMFR: PEMRPLGBLT);
begin
end;
procedure TFlashCanvas.DoROUNDRECT(EMFR: PEMRROUNDRECT);
begin
if DrawMode = dmPath then exit;
with EMFR^ do
begin
Sh:=Owner.AddShape;
Sh.Bounds.Rect := MapRect(rclBox);
Sh.Edges.MoveTo(Sh.Bounds.Xmin, Sh.Bounds.Ymin);
Sh.Edges.MakeRoundRect(Sh.Bounds.Width, Sh.Bounds.Height, MapLen(szlCorner.cx div 2, false), MapLen(szlCorner.cy div 2, true));
ShapeSetStyle(true, true, Sh);
Sh.CalcBounds;
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
end;
end;
procedure TFlashCanvas.DoMOVETOEX(EMFR: PEMRMOVETOEX);
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
LastMoveToXY := MapPoint(ptl);
if ShapeLineTo <> nil then
ShapeLineTo.Edges.MoveTo(LastMoveToXY.X, LastMoveToXY.Y);
end;
BeginPath := LastMoveToXY;
end;
procedure TFlashCanvas.DoLINETO(EMFR: PEMRLINETO);
var P0: TPoint;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
P0 := MapPoint(ptl);
if ShapeLineTo = nil then
begin
ShapeLineTo := Owner.AddLine(LastMoveToXY.X, LastMoveToXY.Y, P0.X, P0.Y);
ShapeSetStyle(true, false, ShapeLineTo);
end
else ShapeLineTo.Edges.LineTo(P0.X, P0.Y);
LastMoveToXY := P0;
end;
end;
procedure TFlashCanvas.DoSETPOLYFILLMODE(EMFR: PEMRSETPOLYFILLMODE);
begin
if DrawMode = dmNormal then
PolyFillMode := EMFR^.iMode;
end;
procedure TFlashCanvas.DoCOLORMATCHTOTARGETW(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoPOLYBEZIER16(EMFR: PEMRPOLYBEZIER16);
var il: integer;
PLP: ALnP;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
SetLength(PLP, cpts);
for il := 0 to cpts-1 do PLP[il] := MapPoint(ASmp(@apts)[il]);
Sh := Owner.AddShape;
if (EMFR^.emr.iType = EMR_POLYBEZIERTO16) then
begin
// BeginPath := LastMoveToXY;
Sh.Edges.MakePolyBezier(PLP, LastMoveToXY);
LastMoveToXY:=Point(PLP[cpts - 1].x, PLP[cpts-1].y);
end else
begin
// BeginPath := PLP[0];
Sh.Edges.MakePolyBezier(PLP, Point(-1, -1));
end;
Sh.CalcBounds;
ShapeSetStyle(true, false, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
PLP:=nil;
end;
end;
procedure TFlashCanvas.DoPOLYBEZIERTO16(EMFR: PEMRPOLYBEZIERTO16);
begin
DoPOLYBEZIER16(EMFR);
end;
type
PEMRSetTextJustidication = ^TEMRSetTextJustidication;
TEMRSetTextJustidication = packed record
emr: TEMR;
nBreakExtra: Integer;
nBreakCount: Integer;
end;
procedure TFlashCanvas.DoSETTEXTJUSTIFICATION(EMFR: PEnhMetaRecord);
begin
with PEMRSetTextJustidication(EMFR)^ do
FTextJustification := Point(nBreakExtra, nBreakCount);
end;
procedure TFlashCanvas.DoANGLEARC(EMFR: PEMRANGLEARC);
begin
if DrawMode = dmPath then exit;
with EMFR^ do
begin
Sh:=Owner.AddShape;
Sh.Edges.IgnoreMovieSettings:=True;
// --- to begin arc ---
if ((LastMoveToXY.X <> Round(ptlCenter.X+nRadius*Cos(eStartAngle+90))) or
(LastMoveToXY.Y <> Round(ptlCenter.Y+nRadius*Sin(eStartAngle+90)))) Then
begin
Sh.Edges.MoveTo(twips * LastMoveToXY.X, twips * LastMoveToXY.Y);
with MapPoint(ptlCenter) do
Sh.Edges.LineTo(twips * X + Trunc(twips * nRadius*cos(DegToRad(eStartAngle))),
twips * Y - Trunc(twips * nRadius*sin(DegToRad(eStartAngle))));
end;
// --- draw arc ---
with MapPoint(ptlCenter) do
sh.Edges.MakeArc(twips * X, twips * Y,
twips * nRadius, twips * nRadius,
eStartAngle, eStartAngle+eSweepAngle, false, false);
ShapeSetStyle(true, false, Sh);
Sh.CalcBounds;
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
LastMoveToXY.X := Sh.Edges.CurrentPos.X div twips;
LastMoveToXY.Y := Sh.Edges.CurrentPos.Y div twips;
Sh.Edges.IgnoreMovieSettings:=False;
end;
end;
procedure TFlashCanvas.DoCREATEBRUSHINDIRECT(EMFR: PEMRCREATEBRUSHINDIRECT);
begin
with EMFR^ do
begin
if HTables[ihBrush] <> nil then HTables[ihBrush].Free;
HTables[ihBrush] := TGDIHandleBrush.Create(lb);
end;
end;
procedure TFlashCanvas.DoDELETECOLORSPACE(EMFR: PEMRDELETECOLORSPACE);
begin
end;
procedure TFlashCanvas.DoPOLYTEXTOUTA(EMFR: PEMRPOLYTEXTOUT);
begin
end;
procedure TFlashCanvas.DoRECTANGLE(EMFR: PEMRRECTANGLE);
var R2: TRect;
begin
if DrawMode = dmPath then exit;
with EMFR^ do
begin
R2 := MapRect(rclBox);
// if ((ViewportExt.Left <> 0) or (ViewportExt.Top <> 0)) and (WindowExt.Right = 0)
// then
// OffsetRect(R2, ViewportExt.Left, ViewportExt.Top);
Sh := Owner.AddRectangle(R2);
ShapeSetStyle(true, true, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
end;
end;
procedure TFlashCanvas.DoSETBKCOLOR(EMFR: PEMRSETBKCOLOR);
begin
BgColor := EMFR^.crColor;
end;
procedure TFlashCanvas.DoSETBKMODE(EMFR: PEMRSETBKMODE);
begin
BgTransparent := EMFR^.iMode = TRANSPARENT;
end;
procedure TFlashCanvas.DoTRANSPARENTDIB(EMFR: PEnhMetaRecord);
begin
end;
type
PEMRCOLORCORRECTPALETTE = ^TEMRCOLORCORRECTPALETTE;
TEMRCOLORCORRECTPALETTE = Record
emr: TEMR;
ihPalette: DWORD;
nFirstEntry: DWORD; // Index of first entry to correct
nPalEntries: DWORD; // Number of palette entries to correct
nReserved: DWORD;
end;
procedure TFlashCanvas.DoCOLORCORRECTPALETTE(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoEXCLUDECLIPRECT(EMFR: PEMREXCLUDECLIPRECT);
begin
end;
procedure TFlashCanvas.DoSETICMMODE(EMFR: PEMRSETICMMODE);
begin
end;
procedure TFlashCanvas.DoEXTFLOODFILL(EMFR: PEMREXTFLOODFILL);
begin
// no support
end;
procedure TFlashCanvas.DoRESTOREDC(EMFR: PEMRRESTOREDC);
begin
if ClippSprite <> nil then CloseActiveSprite;
ReInitViewPort;
end;
procedure TFlashCanvas.DoSETMITERLIMIT(EMFR: PEMRSETMITERLIMIT);
begin
end;
procedure TFlashCanvas.DoELLIPSE(EMFR: PEMRELLIPSE);
var R2: TRect;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
R2 := NormalizeRect(MapRect(rclBox));
if (R2.Right - R2.Left) = 0 then inc(R2.Right);
if (R2.Bottom - R2.Top) = 0 then inc(R2.Bottom);
Sh := Owner.AddEllipse(R2);
ShapeSetStyle(true, true, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
end;
end;
procedure TFlashCanvas.DoFORCEUFIMAPPING(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoRESIZEPALETTE(EMFR: PEMRRESIZEPALETTE);
begin
end;
procedure TFlashCanvas.DoCREATECOLORSPACEW(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoEXTESCAPE(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoSELECTOBJECT(EMFR: PEMRSELECTOBJECT);
begin
with EMFR^ do
begin
if (ihObject and $80000000)<>0 then
begin
Case (ihObject and $FF) of
WHITE_BRUSH, LTGRAY_BRUSH, GRAY_BRUSH, DKGRAY_BRUSH, BLACK_BRUSH, NULL_BRUSH, DC_BRUSH:
CurrentBrush := -(ihObject and $FF);
WHITE_PEN, BLACK_PEN, NULL_PEN, DC_PEN:
CurrentPen := -(ihObject and $FF);
OEM_FIXED_FONT, ANSI_FIXED_FONT, ANSI_VAR_FONT, SYSTEM_FONT, DEVICE_DEFAULT_FONT,
SYSTEM_FIXED_FONT, DEFAULT_GUI_FONT:
begin
CurrentFont := -(ihObject and $FF);
PrevFont := nil;
end;
DEFAULT_PALETTE: ;
end;
end else
if HTables[ihObject] <> nil then
Case TGDIHandleInfo(HTables[ihObject]).HandleType of
htPen:
begin
CurrentPen := ihObject;
end;
htBrush:
begin
CurrentBrush := ihObject;
end;
htFont:
begin
CurrentFont := ihObject;
PrevFont := nil;
end;
htMonoBrush:
begin
CurrentBrush:=ihObject;
end;
htDibBrush:
begin
PreviusBrush := CurrentBrush;
CurrentBrush := ihObject;
end;
end;
end;
end;
procedure TFlashCanvas.DoDELETEOBJECT(EMFR: PEMRDELETEOBJECT);
var ind: integer;
begin
if HTables[EMFR^.ihObject] = nil then Exit; {bug of metafile}
Case TGDIHandleInfo(HTables[EMFR^.ihObject]).HandleType of
htPen: ind := CurrentPen;
htBrush: ind := CurrentBrush;
htFont: ind := CurrentFont;
end;
if (EMFR^.ihObject < HTables.Count) and (ind = EMFR^.ihObject) then
Case TGDIHandleInfo(HTables[EMFR^.ihObject]).HandleType of
htPen: CurrentPen := -1;
htBrush: CurrentBrush := -1;
htFont: CurrentFont := -1;
end;
HTables[EMFR^.ihObject].Free;
HTables[EMFR^.ihObject] := nil;
end;
procedure TFlashCanvas.DoPOLYPOLYGON(EMFR: PEMRPOLYPOLYGON);
begin
DoPOLYPOLYLINE(EMFR);
end;
procedure TFlashCanvas.DoSELECTPALETTE(EMFR: PEMRSELECTPALETTE);
begin
end;
procedure TFlashCanvas.DoSETTEXTALIGN(EMFR: PEMRSETTEXTALIGN);
begin
TextAlign := EMFR^.iMode;
end;
procedure TFlashCanvas.DoALPHABLEND(EMFR: PEMRALPHABLEND);
var
BgRect: TRect;
BMP: TBMPReader;
PBits: PByte;
begin
// if EMFR^.dwRop = $00AA0029 then exit; {empty ROP}
with EMFR^ do
begin
BgRect := MapRect(Rect(xDest, yDest, xDest + cxDest, yDest + cyDest));
if (BgRect.Bottom - BgRect.Top) = 0 then BgRect.Bottom := BgRect.Bottom + 1;
if (roUseBuffer in RenderOptions) and TObjMFRecord(ListMFRecords[CurrentRec-1]).FromRend then
begin
BMP := GetCopyFromRender(BgRect);
end else
if cbBitsSrc > 0 then
begin
BMP := TBMPReader.Create;
BMP.SetSizeIndirect(PBMInfo(Longint(EMFR) + offBmiSrc)^);
PBits := Pointer(Longint(EMFR) + offBitsSrc);
Move(PBits^, BMP.Bits^, BMP.SizeImage);
end else
BMP := nil;
PlaceROP(BMP, BgRect, dwRop, crBkColorSrc);
if BMP <> nil then BMP.Free;
end;
end;
procedure TFlashCanvas.DoFILLRGN(EMFR: PEMRFILLRGN);
var TmpRGN: THandle;
RgnRect: TRect;
RgnIm: TBitmap;
Im: TFlashImage;
begin
with EMFR^ do
begin
rclBounds:= NormalizeRect(rclBounds);
TmpRGN := ExtCreateRegion(nil, cbRgnData, PRGNDATA(@RgnData)^);
OffsetRgn(TmpRGN, -rclBounds.Left, -rclBounds.Top);
RgnRect:=Rect(0,0,
rclBounds.Right-rclBounds.Left, rclBounds.Bottom-rclBounds.Top);
RgnIm:=TBitmap.Create;
RgnIm.PixelFormat:=pf8bit;
RgnIm.Canvas.Brush.Color:=0;
RgnIm.Width:=rgnRect.Right;
RgnIm.Height:=RgnRect.Bottom;
RgnIm.Canvas.Brush.Color:=$FF;
FillRgn(RgnIm.Canvas.Handle, TmpRGN, RgnIm.Canvas.Brush.Handle);
DeleteObject(TmpRGN);
Im:=Owner.AddImage;
Im.LoadDataFromHandle(RgnIm.Handle);
if Cardinal(Im.BMPStorage.Colors[0])=0
then
begin
Im.BMPStorage.Colors[0]:=TFColorA(SWFRGBA((BgColor and $FF0000) shr 16,
(BgColor and $FF00) shr 8,
BgColor and $FF ,$ff));
Im.SetAlphaIndex(1,0);
end else
begin
Im.BMPStorage.Colors[1]:=TFColorA(SWFRGBA((BgColor and $FF0000) shr 16,
(BgColor and $FF00) shr 8,
BgColor and $FF ,$ff));
Im.SetAlphaIndex(0,0);
end;
Sh := Owner.AddRectangle(rclBounds);
Sh.SetImageFill(Im, fmFit);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
RgnIm.Free;
end;
end;
procedure TFlashCanvas.DoWIDENPATH(EMFR: PEMRWIDENPATH);
begin
end;
procedure TFlashCanvas.DoSETPIXELV(EMFR: PEMRSETPIXELV);
begin
with EMFR^ do
begin
Sh := Owner.AddShape;
with MapPoint(ptlPixel) do
Sh.Edges.MoveTo(X, Y);
Sh.Edges.IgnoreMovieSettings:=True;
Sh.Edges.LineDelta(9, 9);
Sh.Edges.IgnoreMovieSettings := False;
sh.SetLineStyle(1, SWFRGB(crColor));
Sh.CalcBounds;
ActiveSprite.PlaceObject(sh, ActiveSprite.MaxDepth + 1);
end;
end;
procedure TFlashCanvas.DoEOF(EMFR: PEMREOF);
begin
end;
procedure TFlashCanvas.DoGLSRECORD(EMFR: PEMRGLSRECORD);
begin
end;
procedure TFlashCanvas.DoPOLYDRAW(EMFR: PEMRPOLYDRAW);
begin
if DrawMode = dmPath then Exit;
end;
procedure TFlashCanvas.DoSETBRUSHORGEX(EMFR: PEMRSETBRUSHORGEX);
begin
end;
procedure TFlashCanvas.DoCREATECOLORSPACE(EMFR: PEMRSelectColorSpace);
begin
end;
procedure TFlashCanvas.DoSETDIBITSTODEVICE(EMFR: PEMRSETDIBITSTODEVICE);
begin
end;
procedure TFlashCanvas.DoSETCOLORSPACE(EMFR: PEMRSelectColorSpace);
begin
end;
procedure TFlashCanvas.DoCREATEPALETTE(EMFR: PEMRCREATEPALETTE);
begin
end;
procedure TFlashCanvas.DoSAVEDC(EMFR: PEMRSAVEDC);
begin
//
end;
procedure TFlashCanvas.DoPOLYPOLYLINE(EMFR: PEMRPOLYPOLYLINE);
var dX, dY, i, J, eSt, eEn : integer;
P0, P1: TPoint;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
dY := Cardinal(@aPolyCounts); // aPolyCounts
dX:= dY + 4*nPolys; // apts
sh:=nil;
for J:=0 to nPolys -1 do
begin
if J = 0 then eSt:=0
else eSt:=eEn+1;
if J=nPolys-1 then eEn:=cptl-1
else eEn:=eSt+aPolyCounts[J]-1;
P0 := MapPoint(AsmP(dX)[eSt]);
if sh = nil then
with MapPoint(AsmP(dX)[eSt+1]) do
sh:=Owner.AddLine(P0.X, P0.Y, X, Y)
else begin
sh.Edges.MoveTo(P0.x, P0.y);
with MapPoint(AsmP(dX)[eSt+1]) do
sh.Edges.LineTo(X, Y);
end;
for I := eSt + 2 to eEn do
begin
P1 := MapPoint(AsmP(dX)[i]);
sh.Edges.LineTo(P1.X, P1.Y);
end;
if (EMFR^.emr.iType = EMR_POLYPOLYGON) and ((P1.X <> P0.X) or (P1.Y <> P0.Y)) then
sh.Edges.LineTo(P0.X, P0.Y);
end;
Sh.CalcBounds;
ShapeSetStyle(true, EMFR^.emr.iType = EMR_POLYPOLYGON, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
if EMFR^.emr.iType = EMR_POLYPOLYLINE then
LastMoveToXY := MapPoint(AsmP(dX)[eEn]);
end;
end;
procedure TFlashCanvas.DoPOLYBEZIER(EMFR: PEMRPOLYBEZIER);
var PLP: ALnP;
i, j: integer;
PBP: array[0..3] of TPoint;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
PLP := @aptl;
for J:=0 to (cptl div 3)-1 do
begin
for I := 0 to 3 do // Iterate
begin
PBP[i] := MapPoint(PLP[i+3*j]);
end; // for
sh:=Owner.AddCubicBezier(PBP[0], PBP[1], PBP[2], PBP[3]);
Sh.CalcBounds;
ShapeSetStyle(true, EMFR^.emr.iType = EMR_POLYBEZIER, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
end;
if (EMFR^.emr.iType = EMR_POLYBEZIER) and
((aptl[0].x <> PBP[cptl - 1].x) or (aptl[0].y <> PBP[cptl-1].y)) then
sh.Edges.LineTo(aptl[0].x,aptl[0].y);
end;
end;
procedure TFlashCanvas.DoPOLYBEZIERTO(EMFR: PEMRPOLYBEZIERTO);
begin
DoPOLYBEZIER(EMFR);
end;
procedure TFlashCanvas.DoGRADIENTFILL(EMFR: PEnhMetaRecord);
var Vr: FVer;
il, i: integer;
begin
WIth PEMGradientFill(EMFR)^ do
begin
sh:=Owner.AddRectangle(rclBounds);
ShapeSetStyle(false, true, Sh);
Vr:=@ver;
i:=Vr[0].Green + (Vr[0].Red shr 8)+ (Vr[0].Blue shl 8) + $FF000000;
il:=Vr[1].Green + (Vr[1].Red shr 8)+ (Vr[1].Blue shl 8) + $FF000000;
if Boolean(ulMode) then sh.SetLinearGradient(recRGBA(il),recRGBA(i),90)
else sh.SetLinearGradient(recRGBA(i), recRGBA(il), 0);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
end;
end;
procedure TFlashCanvas.DoPOLYLINE16(EMFR: PEMRPOLYLINE16);
var i: integer;
PSP: ASmP;
P0: TPoint;
im: TFlashImage;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
if cpts = 1 then
begin
LastMoveToXY := MapPoint(apts[0]);
Exit;
end;
PSP := @apts;
P0 := MapPoint(apts[0]);
if (roUseBuffer in RenderOptions) and TObjMFRecord(ListMFRecords[CurrentRec-1]).FromRend then
begin
im := GetImageFromRender(rclBounds);
sh := Owner.AddRectangle(rclBounds);
sh.SetImageFill(Im, fmFit);
end else
begin
with MapPoint(PSP[1]) do
sh:=Owner.AddLine(P0.x, P0.y, x, y);
for I := 2 to cpts - 1 do
with MapPoint(PSP[i]) do
sh.Edges.LineTo(x, y);
Sh.CalcBounds;
if (emr.iType = EMR_POLYGON16) and
((apts[0].x <> PSP[cpts - 1].x) or (apts[0].y <> PSP[cpts-1].y)) then
sh.Edges.LineTo(P0.x, P0.y);
ShapeSetStyle(true, (emr.iType = EMR_POLYGON16), Sh);
if (emr.iType = EMR_POLYGON16) and (not Sh.Edges.isClockWise) and
(sh.FillStyleRight > 0) then
begin
sh.FillStyleLeft := sh.FillStyleRight;
sh.FillStyleRight := 0;
end;
end;
with ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1) do
begin
end;
if emr.iType = EMR_POLYLINETO16 then
LastMoveToXY := MapPoint(PSP[cpts - 1]);
end;
end;
procedure TFlashCanvas.DoPOLYLINETO16(EMFR: PEMRPOLYLINETO16);
begin
DoPOLYLINE16(EMFR);
end;
procedure TFlashCanvas.DoPOLYGON16(EMFR: PEMRPOLYGON16);
begin
DoPOLYLINE16(EMFR);
end;
procedure TFlashCanvas.DoGDICOMMENT(EMFR: PEMRGDICOMMENT);
begin
end;
procedure TFlashCanvas.DoINTERSECTCLIPRECT(EMFR: PEMRINTERSECTCLIPRECT);
var Sh: TFlashShape;
begin
if ClippSprite <> nil then CloseActiveSprite;
ClippSprite := AddActiveSprite(csClipp);
with EMFR^ do
Sh := Owner.AddRectangle(MapRect(rclClip));
Sh.SetSolidColor(cswfBlack);
ClipperSprite.PlaceObject(Sh, ClipperSprite.MaxDepth + 1);
end;
procedure TFlashCanvas.DoSETMETARGN(EMFR: PEMRSETMETARGN);
begin
end;
procedure TFlashCanvas.DoFRAMERGN(EMFR: PEMRFRAMERGN);
begin
end;
procedure TFlashCanvas.DoSCALEWINDOWEXTEX(EMFR: PEMRSCALEWINDOWEXTEX);
begin
end;
procedure TFlashCanvas.DoEXTCREATEFONTINDIRECTW(EMFR: PEMREXTCREATEFONTINDIRECT);
begin
with EMFR^ do
begin
if HTables[ihFont] <> nil then HTables[ihFont].Free;
HTables[ihFont] := TGDIHandleFont.Create(elfw);
With TGDIHandleFont(HTables[ihFont]).Info.elfLogFont do
begin
// lfHeight := -MapLen(lfHeight, true);
// if lfHeight < 0
// then lfHeight := MapLen(lfHeight, true)
// else lfHeight := -MulDiv(lfHeight, 72, GetDeviceCaps(BufferBMP.DC, LOGPIXELSY));
end;
end;
end;
procedure TFlashCanvas.DoSELECTCLIPPATH(EMFR: PEMRSELECTCLIPPATH);
var path: TFlashShape;
begin
if (EMFR^.iMode = RGN_COPY) and (ClippSprite <> nil) then CloseActiveSprite;
if ClippSprite = nil then ClippSprite := AddActiveSprite(csClipp);
if pathShape <> nil then
begin
path := GetPathShape;
path.SetSolidColor(cswfBlack);
ClipperSprite.PlaceObject(path, ClipperSprite.MaxDepth + 1);
end;
end;
procedure TFlashCanvas.DoBEGINPATH(EMFR: PEMRBEGINPATH);
begin
DrawMode := dmPath;
pathShape := nil;
end;
procedure TFlashCanvas.DoENDPATH(EMFR: PEMRENDPATH);
var nPoints, il, err, prevind, SummA: longint;
PPoints: PPoint;
PTypes: PByte;
APoints: ALnP absolute PPoints;
ATypes: Abytes absolute PTypes;
Flag: byte;
CLastPoint: TPoint;
// oldSC: TSWFSystemCoord;
function SimpleAngle(X, Y: longint): double;
begin
if X = 0 then Result := 90 * Sign(Y) else
if Y = 0 then Result := byte(X < 0) * 180 * Sign(X)
else
begin
Result := RadToDeg(ArcTan(Y / X));
if (X < 0) and (Y < 0) then Result := Result - 180 else
if (X < 0) then Result := Result + 180;
end;
end;
function CalcAngle(P1, P0, P2: TPoint): double;
begin
Result := SimpleAngle(P2.X - P0.X, P2.Y - P0.Y) - SimpleAngle(P0.X - P1.X, P0.Y - P1.Y);
if Result < 0 then Result := 360 + Result;
end;
function SummAngle(ind: integer): double;
var iind, iStep: longint;
PPrev, PCur, PNext: TPoint;
begin
Result := 0;
iind := ind + 1;
PCur := APoints[ind];
iStep := 1;
while (iind <= nPoints) do
begin
if (iind = (nPoints - 1)) and (APoints[nPoints - 1].X = APoints[ind].X) and
(APoints[nPoints - 1].Y = APoints[ind].Y) then inc(iind);
if (iStep > 1) and ((PCur.X <> PNext.X) or (PCur.Y <> PNext.Y)) then
begin
PPrev := PCur;
PCur := PNext;
end;
if iind = nPoints then PNext := APoints[ind]
else
case (ATypes[iind] and 6) of
PT_MOVETO:
begin
PNext := APoints[ind];
iind := nPoints;
end;
PT_LINETO:
PNext := APoints[iind];
PT_BEZIERTO:
begin
PNext := APoints[iind + 2];
inc(iind, 2);
if (iind = (nPoints - 1)) then
with APoints[ind] do
if (PNext.X = X) and (PNext.Y = Y) then inc(iind);
end;
end;
if (istep > 1) and ((PCur.X <> PNext.X) or (PCur.Y <> PNext.Y)) then
Result := Result + CalcAngle(PPrev, PCur, PNext);
inc(iind);
inc(istep);
end;
PPrev := PCur;
PCur := PNext;
PNext := APoints[ind+1];
Result := Result + CalcAngle(PPrev, PCur, PNext);
end;
begin
DrawMode := dmNormal;
nPoints := GetPath(BufferBMP.DC, APoints, ATypes, 0);
GetMem(PPoints, SizeOf(TPoint)*nPoints);
GetMem(PTypes, nPoints);
err := GetPath(BufferBMP.DC, PPoints^, PTypes^, nPoints);
if err <> nPoints then exit;
il := 0;
IsUsesPathShape := false;
pathShape := Owner.AddShape;
pathConturCount := 0;
pathShape.Edges.OptimizeMode := true;
prevind := 0;
// oldSC := Owner.SystemCoord;
// Owner.SystemCoord := scTwips;
While il < nPoints do
begin
Flag := ATypes[il] and 6;
Case Flag of
PT_MOVETO:
begin
with MapPoint(APoints[il]), pathShape.Edges.MoveTo(X, Y) do
if (PolyFillMode = WINDING) and (pathConturCount < 63) then
begin
if (il > 0) and ((pathShape.Edges.ListEdges.Count - prevind - 1) < 3) then
begin
// TSWFStyleChangeRecord(pathShape.Edges.ListEdges[prevind - 1]).Fill1Id := 0;
// TSWFStyleChangeRecord(pathShape.Edges.ListEdges[prevind - 1]).StateFillStyle1 := false;
end else
begin
inc(pathConturCount);
end;
if (il > 0) then
begin
SummA := Round(SummAngle(il));
if EnableTransparentFill or (SummA = 360) or
((SummA = 720) and (il = 4) or (il >= 100)) then
Fill1Id := pathConturCount;
end;
end;
prevind := pathShape.Edges.ListEdges.Count;
end;
PT_LINETO:
begin
with MapPoint(APoints[il]) do
pathShape.Edges.LineTo(X, Y);
end;
PT_BEZIERTO:
begin
if (il + 2) = nPoints then CLastPoint := MapPoint(APoints[0])
else CLastPoint := MapPoint(APoints[il + 2]);
pathShape.Edges.MakeCubicBezier(MapPoint(APoints[il]), MapPoint(APoints[il + 1]), CLastPoint);
inc(il, 2);
end;
end;
if boolean(ATypes[il] and 1) then {close figure}
pathShape.Edges.CloseShape;
inc(il);
end;
// pathShape.Edges.CloseShape;
pathShape.CalcBounds;
// Owner.SystemCoord := oldSC;
FreeMem(PPoints, SizeOf(TPoint)*nPoints);
FreeMem(PTypes, nPoints);
end;
procedure TFlashCanvas.DoFILLPATH(EMFR: PEMRFILLPATH);
begin
DoSTROKEANDFILLPATH(EMFR);
end;
procedure TFlashCanvas.DoSTROKEPATH(EMFR: PEMRSTROKEPATH);
begin
DoSTROKEANDFILLPATH(EMFR);
end;
procedure TFlashCanvas.DoSTROKEANDFILLPATH(EMFR: PEMRSTROKEANDFILLPATH);
var path, bgPath: TFlashShape;
FS: TSWFFillStyle;
B, il: byte;
pathSP: TFlashSprite;
procedure SplitPath;
var il: integer;
tmpS: TFlashShape;
oldSC: TSWFSystemCoord;
procedure EndAndAddShape;
begin
if (tmpS.EdgesStore.Count < 2) or
(TSWFShapeRecord(tmpS.EdgesStore[tmpS.EdgesStore.Count - 1]).ShapeRecType <> EndShapeRecord) then
tmpS.Edges.EndEdges;
tmpS.SetSolidColor(cswfWhite);
pathSP.PlaceObject(tmpS, pathSP.MaxDepth + 1);
end;
begin
pathSP := Owner.AddSprite;
tmpS := nil;
oldSC := Owner.SystemCoord;
Owner.SystemCoord := scTwips;
for il := 0 to path.EdgesStore.Count - 1 do
begin
case TSWFShapeRecord(path.EdgesStore[il]).ShapeRecType of
StyleChangeRecord:
with TSWFStyleChangeRecord(path.EdgesStore[il]) do
if StateMoveTo then
begin
if tmpS <> nil then EndAndAddShape;
tmpS := Owner.AddShape();
tmpS.Edges.MoveTo(X, Y);
end;
StraightEdgeRecord:
with TSWFStraightEdgeRecord(path.EdgesStore[il]) do
tmpS.Edges.LineDelta(X, Y);
CurvedEdgeRecord:
with TSWFCurvedEdgeRecord(path.EdgesStore[il]) do
tmpS.Edges.CurveDelta(ControlX, ControlY, AnchorX, AnchorY);
EndShapeRecord:
EndAndAddShape;
end;
end;
if TSWFShapeRecord(path.EdgesStore[path.EdgesStore.Count - 1]).ShapeRecType <> EndShapeRecord
then EndAndAddShape;
Owner.SystemCoord := oldSC;
end;
begin
if pathShape <> nil then
begin
path := GetPathShape;
if (EMFR^.emr.iType in [EMR_FILLPATH, EMR_STROKEANDFILLPATH])
then path.Edges.CloseAllConturs;
if {false and} EnableTransparentFill and (pathConturCount > 1) and
(EMFR^.emr.iType in [EMR_FILLPATH, EMR_STROKEANDFILLPATH]) then
begin
Owner.SystemCoord := scTwips;
bgPath := Owner.AddRectangle(path.Bounds.Rect);
Owner.SystemCoord := scPix;
ShapeSetStyle(false, true, bgPath);
SplitPath;
// Path.SetSolidColor(cswfWhite);
ActiveSprite.PlaceObject(bgPath, pathSP, ActiveSprite.MaxDepth + 1);
end else
begin
ShapeSetStyle(EMFR^.emr.iType in [EMR_STROKEPATH, EMR_STROKEANDFILLPATH],
EMFR^.emr.iType in [EMR_FILLPATH, EMR_STROKEANDFILLPATH], path);
end;
if (pathConturCount > 1) and (path.FillStyles.Count > 0) then
begin
for il := 1 to pathConturCount - 1 do
begin
if EMFR^.emr.iType in [EMR_FILLPATH, EMR_STROKEANDFILLPATH] then
begin
B := TSWFFillStyle(path.FillStyles.Items[0]).SWFFillType;
case B of
SWFFillSolid:
FS := TSWFColorFill.Create;
SWFFillLinearGradient, SWFFillRadialGradient:
FS := TSWFGradientFill.Create;
SWFFillFocalGradient:
FS := TSWFFocalGradientFill.Create;
SWFFillTileBitmap, SWFFillClipBitmap,
SWFFillNonSmoothTileBitmap, SWFFillNonSmoothClipBitmap:
FS := TSWFImageFill.Create;
else FS := nil;
end;
FS.SWFFillType := B;
FS.Assign(TSWFFillStyle(path.FillStyles.Items[0]));
path.FillStyles.Add(FS);
end;
end;
// if (EMFR^.emr.iType in [EMR_STROKEPATH, EMR_STROKEANDFILLPATH]) and
// (path.LineStyles.Count > 0) then
// begin
// LS := TSWFLineStyle.Create;
// LS.Assign(TSWFLineStyle(path.LineStyles.Items[0]));
// path.LineStyles.Add(LS);
// end;
end;
IsUsesPathShape := true;
end;
end;
procedure TFlashCanvas.DoCLOSEFIGURE(EMFR: PEMRCLOSEFIGURE);
begin
if DrawMode = dmPath then Exit;
end;
procedure TFlashCanvas.DoFLATTENPATH(EMFR: PEMRFLATTENPATH);
begin
if DrawMode = dmPath then Exit;
end;
procedure TFlashCanvas.DoPOLYTEXTOUTW(EMFR: PEMRPOLYTEXTOUT);
begin
end;
procedure TFlashCanvas.DoEXTCREATEPEN(EMFR: PEMREXTCREATEPEN);
begin
with EMFR^ do
begin
if HTables[ihPen] <> nil then HTables[ihPen].Free;
HTables[ihPen] := TGDIHandlePen.Create(elp);
with TGDIHandlePen(HTables[ihPen]).Info do
begin
lopnWidth.X := MapLen(lopnWidth.X, false);
lopnWidth.Y := MapLen(lopnWidth.Y, true);
end;
end;
end;
procedure TFlashCanvas.DoCREATEDIBPATTERNBRUSHPT(EMFR: PEMRCREATEDIBPATTERNBRUSHPT);
begin
with EMFR^ do
begin
if HTables[ihBrush] <> nil then HTables[ihBrush].Free;
HTables[ihBrush] := TGDIHandleDibBrush.Create(Cardinal(EMFR));
end;
end;
procedure TFlashCanvas.DoCREATEMONOBRUSH(EMFR: PEMRCREATEMONOBRUSH);
begin
with EMFR^ do
begin
if HTables[ihBrush] <> nil then HTables[ihBrush].Free;
HTables[ihBrush] := TGDIHandleMonoBrush.Create(Cardinal(EMFR));
end;
end;
procedure TFlashCanvas.DoEXTSELECTCLIPRGN(EMFR: PEMREXTSELECTCLIPRGN);
var il: integer;
RGN: PRgnData;
R: PRect;
Sh: TFlashShape;
begin
if (ClippSprite <> nil) then CloseActiveSprite;
if EMFR^.cbRgnData > 0 then
begin
RGN := @(EMFR^.RgnData);
With RGN^.rdh, rcBound do
begin
if (nCount = 0) and (ClippSprite <> nil) then CloseActiveSprite
else
begin
ClippSprite := AddActiveSprite(csClipp);
R := @(RGN^.Buffer);
for il := 0 to nCount - 1 do
begin
Sh := Owner.AddRectangle(MapRect(R^)); {MapX(R^.Left), MapY(R^.Top), MapX(R^.Right), MapY(R^.Bottom)}
Sh.SetSolidColor(cswfBlack);
ClipperSprite.PlaceObject(Sh, ClipperSprite.MaxDepth + 1);
Inc(R);
end;
end;
end;
end;
end;
procedure TFlashCanvas.DoINVERTRGN(EMFR: PEMRINVERTRGN);
begin
end;
procedure TFlashCanvas.DoSETTEXTCOLOR(EMFR: PEMRSETTEXTCOLOR);
begin
TextColor := EMFR^.crColor;
end;
procedure TFlashCanvas.DoSETMAPPERFLAGS(EMFR: PEMRSETMAPPERFLAGS);
begin
end;
procedure TFlashCanvas.DoDRAWESCAPE(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoPIE(EMFR: PEMRPIE);
var dX, dY, eSt, eEn: integer;
R2: TRect;
begin
if DrawMode = dmPath then Exit;
with EMFR^ do
begin
if ClockWs then
begin
dX := ptlStart.X;
dY := ptlStart.Y;
ptlStart := ptlEnd;
ptlEnd.X:= dX;
ptlEnd.Y:= dY;
end;
Sh:=Owner.AddShape;
// Sh.Edges.IgnoreMovieSettings:=True;
R2 := MapRect(rclBox);
dX := MapLen((rclBox.Right-rclBox.Left) div 2, false);
dY := MapLen((rclBox.Bottom-rclBox.Top) div 2, true);
with MapPoint(ptlStart) do
eSt := Ceil(RadToDeg(ArcTan2((R2.Top+dY) - Y, X - (R2.Left+dX))));
with MapPoint(ptlEnd) do
eEn := Ceil(RadToDeg(ArcTan2((R2.Top+dY) - Y, X - (R2.Left+dX))));
with MapPoint(rclBox.TopLeft) do
Sh.Edges.MoveTo(X + dX, Y + dY);
Sh.Edges.MakePie(dX, dY, eSt, eEn, ClockWs);
Sh.CalcBounds;
ShapeSetStyle(true, true, Sh);
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
// Sh.Edges.IgnoreMovieSettings:=False;
end;
end;
procedure TFlashCanvas.DoTRANSPARENTBLT(EMFR: PEMRTRANSPARENTBLT);
begin
end;
procedure TFlashCanvas.DoABORTPATH(EMFR: PEMRABORTPATH);
begin
DrawMode := dmNormal;
pathShape := nil;
end;
procedure TFlashCanvas.DoARC(EMFR: PEMRARC);
var R2: TRect;
dX, dY, eSt, eEn: integer;
begin
if DrawMode = dmPath then exit;
with EMFR^ do
begin
if ClockWs then
begin
dX:=ptlStart.X;
dY:=ptlStart.Y;
ptlStart:=ptlEnd;
ptlEnd.X:=dX;
ptlEnd.Y:=dY;
end;
R2 := MapRect(rclBox);
dX := MapLen((rclBox.Right-rclBox.Left) div 2, false);
dY := MapLen((rclBox.Bottom-rclBox.Top) div 2, true);
if (dx = 0) or (dy = 0) then exit;
with MapPoint(ptlStart) do
eSt := Ceil(RadToDeg(ArcTan2((R2.Top+dY) - Y, X - (R2.Left+dX))));
with MapPoint(ptlEnd) do
eEn := Ceil(RadToDeg(ArcTan2((R2.Top+dY) - Y, X - (R2.Left+dX))));
Sh:=Owner.AddShape;
sh.Edges.MakeArc(R2.Left+dX, R2.Top+dY, dX, dY, eSt, eEn, false, false);
ShapeSetStyle(true, false, Sh);
Sh.CalcBounds;
ActiveSprite.PlaceObject(Sh, ActiveSprite.MaxDepth + 1);
if EMFR^.emr.iType = EMR_ARCTO then
LastMoveToXY := Sh.Edges.FCurrentPos;
end;
end;
procedure TFlashCanvas.DoARCTO(EMFR: PEMRARCTO);
begin
DoArc(EMFR);
end;
procedure TFlashCanvas.DoSETLINKEDUFIS(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoPAINTRGN(EMFR: PEMRPAINTRGN);
begin
end;
procedure TFlashCanvas.DoOFFSETCLIPRGN(EMFR: PEMROFFSETCLIPRGN);
begin
end;
procedure TFlashCanvas.DoSTARTDOC(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoCREATEPEN(EMFR: PEMRCREATEPEN);
begin
with EMFR^ do
begin
if HTables[ihPen] <> nil then HTables[ihPen].Free;
HTables[ihPen] := TGDIHandlePen.Create(lopn);
with TGDIHandlePen(HTables[ihPen]).Info do
begin
lopnWidth.X := MapLen(lopnWidth.X, false);
lopnWidth.Y := MapLen(lopnWidth.Y, true);
end;
end;
end;
procedure TFlashCanvas.DoSETCOLORADJUSTMENT(EMFR: PEMRSETCOLORADJUSTMENT);
begin
end;
procedure TFlashCanvas.DoNAMEDESCAPE(EMFR: PEnhMetaRecord);
begin
end;
procedure TFlashCanvas.DoSETARCDIRECTION(EMFR: PEMRSETARCDIRECTION);
// var W: TX
begin
ClockWs := boolean(EMFR^.iArcDirection-1);
GetWorldTransform(BufferBMP.DC, FCWorldTransform);
if FCWorldTransform.eM22 < 0 then ClockWs := not ClockWs;
end;
procedure TFlashCanvas.DoSETPALETTEENTRIES(EMFR: PEMRSETPALETTEENTRIES);
begin
end;
procedure TFlashCanvas.DoSETROP2(EMFR: PEMRSETROP2);
begin
end;
procedure TFlashCanvas.Clear;
begin
//owner.Clear;
FRootSprite := nil;
end;
procedure TFlashCanvas.CloseHandle;
begin
MetaHandle := CloseEnhMetaFile(Handle);
Handle := 0;
end;
procedure TFlashCanvas.InitHandle;
var
TmpDC, WinDC: HDC;
R: TRect;
il: integer;
begin
DeleteEnhMetaFile(MetaHandle);
WinDC := GetDC(0);
TmpDC := CreateCompatibleDC(WinDC);
// DPI := GetDeviceCaps(TmpDC, LOGPIXELSX);
DPI := 96;
if Owner = nil then
SetRect(R, 0, 0, Round(GetSystemMetrics(SM_CXSCREEN)/dpi * 2540),
Round(GetSystemMetrics(SM_CYSCREEN)/dpi * 2540))
else
SetRect(R, 0, 0, Round(Owner.SWFHeader.MovieRect.Right/dpi*127),
Round(Owner.SWFHeader.MovieRect.Bottom/dpi*127)); {127 = 2540 / 20}
Handle := CreateEnhMetafile(TmpDC, nil, @R, nil);
DeleteDC (TmpDC);
ReleaseDC(0, WinDC);
FCworldTransform.eM11 := 1;
FCworldTransform.eM22 := 1;
PrivateTransform := FCWorldTransform;
ClippSprite := nil;
FActiveSprite := nil;
PrevFont := nil;
FillChar(ViewportExt, sizeOf(TRect), 0);
hasInitViewport := false;
FillChar(WindowExt, sizeOf(TRect), 0);
hasInitWindow := false;
TextAlign:=0;
SetIgnoreMovieSettingsFlag:=False;
CurrentPen := -1;
CurrentBrush := -1;
CurrentFont := -1;
LastMoveToXY := Point(0, 0);
BgTransparent := false;
EnableTransparentFill := false;
for il := 0 to HTables.Count - 1 do
if HTables[il] <> nil then HTables[il].Free;
HTables.Clear;
end;
procedure TFlashCanvas.StretchDraw(const R: TRect; Graphic: TGraphic);
begin
if Graphic is TMetaFile then
begin
DrawMetafile(R, TMetaFile(Graphic), true);
end else
inherited ;
// RootScaleX := (R.Right-R.Left)/Graphic.Width;
// RootScaleY := (R.Bottom-R.Top)/Graphic.Height;
// Draw(r.Left, r.Top, Graphic);
end;
procedure TFlashCanvas.DrawMetafile(Dest: TRect; MF: TMetafile; stretch: boolean);
var
MHeader: EnhMetaHeader;
TMPStream: TMemoryStream;
TMPMetafile: TMetaFile;
MHandle: THandle;
procedure CalcScaleXY;
begin
GetEnhMetaFileHeader(MHandle, Sizeof(MHeader), @MHeader);
with MHeader do
MetafileRect := Rect(MulDiv( rclFrame.Left, szlDevice.cx, szlMillimeters.cx * 100),
MulDiv( rclFrame.Top, szlDevice.cy, szlMillimeters.cy * 100),
MulDiv( rclFrame.Right, szlDevice.cx, szlMillimeters.cx * 100),
MulDiv( rclFrame.Bottom, szlDevice.cy, szlMillimeters.cy * 100));
RootScaleX := RootScaleX*(Dest.Right-Dest.Left)/(MF.Width);
RootScaleY := RootScaleY*(Dest.Bottom-Dest.Top)/(MF.Height);
end;
begin
Finished;
InitHandle;
// GetEnhMetaFileHeader(MF.Handle, SizeOf(MHeader), @MHeader);
if MF.Enhanced then
begin
MHandle := MF.Handle;
TMPMetafile := nil;
RootScaleX := 1;
RootScaleY := 1;
end else
begin
TMPStream := TMemoryStream.Create;
MF.Enhanced := true;
MF.SaveToStream(TMPStream);
TMPMetafile := TMetaFile.Create;
TMPStream.Position := 0;
TMPMetafile.LoadFromStream(TMPStream);
// TMPMetafile.SaveToFile('kvart.emf');
TMPStream.Free;
MHandle := TMPMetafile.Handle;
RootScaleX := (MF.Width) / (TMPMetafile.Width);
RootScaleY := (MF.Height) /(TMPMetafile.Height);
MF.Enhanced := false;
end;
MakeListMFRecords(MHandle, Rect(0, 0, Dest.Right-Dest.Left, Dest.Bottom-Dest.Top));
if not IsEmptyMetafile then
begin
if stretch and (not ((roUseBuffer in RenderOptions) and isNeedBuffer{(MHandle)}))
then CalcScaleXY;
ProcessingRecords(MHandle, Dest.Right-Dest.Left, Dest.Bottom-Dest.Top, stretch);
if stretch and (roUseBuffer in RenderOptions) and (roHiQualityBuffer in RenderOptions)
and UseBMPRender
then CalcScaleXY;
With MetafileSprite.PlaceParam do
begin
SetTranslate(Dest.Left, Dest.Top);
if ((RootScaleX <> 1) or (RootScaleY <> 1)) and not StretchedBMPRender then
SetScale(RootScaleX, RootScaleY);
end;
end;
if TMPMetafile <> nil then TMPMetafile.Free;
with owner do
MoveResource(CurrentFrameNum, CurrentFrameNum, CurrentFrameNum);
end;
procedure TFlashCanvas.Draw(X, Y: Integer; Graphic: TGraphic);
begin
if Graphic is TMetaFile then
begin
DrawMetafile(Rect(X, Y, 0, 0), TMetaFile(Graphic), false);
end else
inherited ;
end;
procedure TFlashCanvas.Finished;
var nBits: integer;
begin
CloseHandle;
nBits := GetEnhMetaFileBits(MetaHandle, 0, nil);
if (nBits > 0) and (not IsEmptyMetafile(MetaHandle)) then
begin
FActiveSprite := nil;
RootScaleX := 1;
RootScaleY := 1;
MakeListMFRecords(MetaHandle, Rect(0,0,0,0));
ProcessingRecords(MetaHandle, 0, 0, false);
end;
end;
function TFlashCanvas.Place(depth: word; clear: boolean = true; dest: TFlashSprite = nil): TFlashPlaceObject;
begin
Finished;
Result := nil;
if FRootSprite <> nil then
begin
RootSprite.ShowFrame;
if dest <> nil
then Result := dest.PlaceObject(RootSprite, Depth)
else Result := Owner.PlaceObject(RootSprite, Depth);
end;
InitHandle;
if clear then FRootSprite := nil;
end;
procedure TFlashCanvas.SetWTransform(xForm: TxForm; Flag: word);
begin
CopyMemory(@FCWorldTransform, @PrivateTransform, Sizeof(PrivateTransform));
case Flag of
0: FCWorldTransform := xForm;
MWT_IDENTITY:
begin
FillChar(FCWorldTransform, 0, SizeOf(FCWorldTransform));
FCWorldTransform.eM11 := 1;
FCWorldTransform.eM21 := 1;
end;
MWT_LEFTMULTIPLY:
CombineTransform(FCWorldTransform, XForm, FCWorldTransform);
MWT_RIGHTMULTIPLY:
CombineTransform(FCWorldTransform, FCWorldTransform, XForm);
end;
CopyMemory(@PrivateTransform, @FCWorldTransform, Sizeof(PrivateTransform));
end;
procedure TFlashCanvas.ReInitViewPort;
var P: TPoint;
S: TSize;
begin
// Exit;
if hasInitViewportOrg then
begin
GetViewportOrgEx(BufferBMP.DC, P);
ViewportExt.TopLeft := P;
end;
if hasInitViewportOrg then
begin
GetViewportExtEx(BufferBMP.DC, S);
ViewportExt.BottomRight := Point(S.cx, S.cy);
end;
if hasInitWindowOrg then
begin
GetWindowOrgEx(BufferBMP.DC, P);
WindowExt.TopLeft := P;
end;
if hasInitWindow then
begin
GetWindowExtEx(BufferBMP.DC, S);
WindowExt.BottomRight := Point(S.cx, S.cy);
end;
end;
function TFlashCanvas.MapPoint(P: TPoint): TPoint;
begin
Result := P;
LPToDP(BufferBMP.DC, Result, 1);
end;
function TFlashCanvas.MapPoint(P: TSmallPoint): TPoint;
begin
Result := MapPoint(Point(P.X, P.Y));
end;
function TFlashCanvas.MapRect(R: TRect): TRect;
begin
Result := R;
LPToDP(BufferBMP.DC, Result, 2);
end;
function TFlashCanvas.MapLen(L: integer; Vert: boolean): longint;
var R: TRect;
begin
if Vert then R := Rect(0, 0, 0, L)
else R := Rect(0, 0, L, 0);
LPToDP(BufferBMP.DC, R, 2);
if Vert then Result := R.Bottom - R.Top
else Result := R.Right - R.Left;
end;
procedure TFlashCanvas.ShapeSetStyle(ShowOutLine, ShowFill: boolean; fsh: TFlashShape = nil);
var il, icol: integer;
I: Integer;
OISize: integer;
H, OldBrush, NewBrush, OldPen: HGDIOBJ;
// LP: TLogPen;
// ELP: TExtLogPen;
tmpLB: TLogBrush;
Bm: TBITMAPINFOHEADER;
Mem2Im: TFlashImage;
MStream: TMemoryStream;
Im: TFlashImage;
tmpColor: longint;
DibBrush: TGDIHandleDibBrush;
MonoBrush: TGDIHandleMonoBrush;
ROP2: DWord;
function GetGradientAlpha: integer;
var ix, iy: integer;
BMP: TBMPReader;
begin
BMP := TBMPReader.Create;
with DibBrush do
begin
Info.Position := 0;
BMP.LoadFromStream(Info);
end;
Result := 0;
for iy := 0 to 7 do
for ix := 0 to 7 do
if BMP.PixelsB[iy, ix] = 1 then Inc(Result);
Result := 255 - Round(Result/64*255);
BMP.Free;
end;
begin
if fsh = nil then fsh := Sh;
if ShowFill then
begin
Im := nil;
if CurrentBrush > 0 then
begin
if CurrentBrush < HTables.Count then
Case TGDIHandleInfo(HTables[CurrentBrush]).HandleType of
htBrush:
with TGDIHandleBrush(HTables[CurrentBrush]), Info do
case lbStyle of
BS_NULL: ;
BS_SOLID: fSh.SetSolidColor(SWFRGB(lbColor));
BS_HATCHED:
begin
tmpLB := Info;
tmpLB.lbColor := $FFFFFF;
NewBrush := CreateBrushIndirect(tmpLB);
Im := Owner.AddImage;
with Im.BMPStorage do
begin
SetSize(8, 8, 1);
SetBkColor(DC, $0);
OldBrush := SelectObject(DC, NewBrush);
OldPen := SelectObject(DC, GetStockObject(NULL_PEN));
windows.Rectangle(DC, 0, 0, 9, 9);
Colors[0] := TFColorA(SWFRGBA((BgColor and $FF0000) shr 16,
(BgColor and $FF00) shr 8,
BgColor and $FF, $ff));
Colors[1] := TFColorA(SWFRGBA((lbColor and $FF0000) shr 16,
(lbColor and $FF00) shr 8,
lbColor and $FF, $ff));
DeleteObject(SelectObject(DC, OldBrush));
SelectObject(DC, OldPen);
Im.GetBMPInfo;
if BgTransparent then Im.SetAlphaIndex(0, 0);
end;
end else
begin
NewBrush := CreateBrushIndirect(Info);
Im := Owner.AddImage;
with Im.BMPStorage do
begin
SetSize(8, 8, 24);
SetBkColor(DC, BgColor);
OldBrush := SelectObject(DC, NewBrush);
OldPen := SelectObject(DC, GetStockObject(NULL_PEN));
windows.Rectangle(DC, 0, 0, 9, 9);
DeleteObject(SelectObject(DC, OldBrush));
SelectObject(DC, OldPen);
Im.GetBMPInfo;
end;
end;
end;
htMonoBrush:
begin
MonoBrush := TGDIHandleMonoBrush(HTables[CurrentBrush]);
if MonoBrush.Img <> nil then Im := MonoBrush.Img
else
begin
Im := Owner.AddImage;
Im.LoadDataFromStream(MonoBrush.Info);
if not bgTransparent then
Im.HasUseAlpha := false;// TransparentIndex := -1;
tmpColor := GetBkColor(BufferBMP.DC);
with im.BMPStorage.Colors[0] do
begin
R := GetRValue(tmpColor);
G := GetGValue(tmpColor);
B := GetBValue(tmpColor);
end;
tmpColor := GetTextColor(BufferBMP.DC);
with im.BMPStorage.Colors[1] do
begin
R := GetRValue(tmpColor);
G := GetGValue(tmpColor);
B := GetBValue(tmpColor);
end;
MonoBrush.Img := Im;
end;
end;
htDibBrush:
begin
DibBrush := TGDIHandleDibBrush(HTables[CurrentBrush]);
if isEMFPlus and (roOptimization in RenderOptions) and EnableTransparentFill then
begin
tmpColor := $FFFFFF;
if (PreviusBrush > 0) and (HTables[PreviusBrush] is TGDIHandleBrush) then
tmpColor := TGDIHandleBrush(HTables[PreviusBrush]).Info.lbColor;
fSh.SetSolidColor(SWFRGBA(tmpColor, GetGradientAlpha));
end else
begin
with DibBrush do
if Img <> nil then Im := Img
else
begin
Im := Owner.AddImage;
Info.Position := 0;
Im.LoadDataFromStream(Info);
end;
if DibBrush.Img = nil then
case Im.BMPStorage.Bpp of
1: begin
if (PreviusBrush > 0) and (HTables[PreviusBrush] is TGDIHandleBrush) then
tmpColor := TGDIHandleBrush(HTables[PreviusBrush]).Info.lbColor;
ROP2 := GetRop2(BufferBMP.DC);
for icol:= 0 to Im.ColorCount - 1 do
with Im.BMPStorage.Colors[icol] do
case ROP2 of
R2_MASKPEN:
if (R = 0) and (G = 0) and (B = 0) then
begin
R := {255 -} GetRValue(tmpColor);
G := {255 -} GetGValue(tmpColor);
B := {255 -} GetBValue(tmpColor);
end else
if (R = $FF) and (G = $FF) and (B = $FF) then
Im.SetAlphaIndex(icol, 0);
R2_COPYPEN:
// if (R = 0) and (G = 0) and (B = 0) then
// begin
// R := {255 -} GetRValue(tmpColor);
// G := {255 -} GetGValue(tmpColor);
// B := {255 -} GetBValue(tmpColor);
// end else
if (R = $FF) and (G = $FF) and (B = $FF) then
Im.SetAlphaIndex(icol, 0);
end;
end;
32: FillAlpha(Im.BMPStorage, 255);
end;
DibBrush.Img := Im;
end;
end;
end;
end else
begin
tmpColor := -1;
case Abs(CurrentBrush) of
WHITE_BRUSH: tmpColor := $FFFFFF;
LTGRAY_BRUSH: tmpColor := $C0C0C0;
GRAY_BRUSH: tmpColor := $808080;
DKGRAY_BRUSH: tmpColor := $404040;
BLACK_BRUSH: tmpColor := $000000;
NULL_BRUSH: ;
end;
if tmpColor > -1 then fSh.SetSolidColor(SWFRGB(tmpColor));
end;
if Im <> nil then
begin
fSh.SetImageFill(Im, fmTile, 1/RootScaleX, 1/RootScaleY);// {20/}CWorldTransform.eM11, {20/}CWorldTransform.eM22);
end;
end;
if ShowOutLine then
begin
if CurrentPen >= 0 then
with TGDIHandlePen(HTables[CurrentPen]) do
begin
// if Info.lopnWidth.X > 0 then
case Info.lopnStyle of
PS_NULL: begin
fsh.HasExtLineStyle := False;
fsh.FExtLineStyle := nil;
end;
PS_SOLID: begin
// fsh.HasExtLineStyle:=False; fsh.FExtLineStyle:=nil;
// if Info.lopnWidth.X > 0 then
fSh.SetLineStyle(Info.lopnWidth.X, SWFRGB(TColor(Info.lopnColor)));
end;
PS_DASH: // = 1; { ------- }
with fsh do
begin
HasExtLineStyle:=True;
ExtLineStyle.Count := 2;
ExtLineStyle[0]:= 18; ExtLineStyle[1] := 6;
SetLineStyle(Info.lopnWidth.X, SWFRGB(TColor(Info.lopnColor)));
end;
PS_DOT: // = 2; { ....... }
with fsh do
begin
HasExtLineStyle:=True;
ExtLineStyle.Count := 2;
ExtLineStyle[0]:= 3; ExtLineStyle[1] := 3;
SetLineStyle(Info.lopnWidth.X, SWFRGB(TColor(Info.lopnColor)));
end;
PS_DASHDOT: // = 3; { _._._._ }
with fsh do
begin
HasExtLineStyle:=True;
ExtLineStyle.Count := 4;
ExtLineStyle[0]:=9; ExtLineStyle[1] := 6;
ExtLineStyle[2]:=3; ExtLineStyle[3] := 6;
SetLineStyle(Info.lopnWidth.X, SWFRGB(TColor(Info.lopnColor)));
end;
PS_DASHDOTDOT: // = 4; { _.._.._ }
with fsh do
begin
HasExtLineStyle:=True;
ExtLineStyle.Count := 6;
ExtLineStyle[0]:=9; ExtLineStyle[1] := 3;
ExtLineStyle[2]:=3; ExtLineStyle[3] := 3;
ExtLineStyle[4]:=3; ExtLineStyle[5] := 3;
SetLineStyle(Info.lopnWidth.X, SWFRGB(TColor(Info.lopnColor)));
end;
end;
if fSh.HasExtLineStyle then
begin
fSh.ExtLineTransparent := BgTransparent;
if not BgTransparent then fSh.LineBgColor.RGB := SWFRGB(BgColor);
end;
end else
begin
Case Abs(CurrentPen) of
WHITE_PEN: fSh.SetLineStyle(1, SWFRGB($FFFFFF));
BLACK_PEN: fSh.SetLineStyle(1, SWFRGB($0));
NULL_PEN: ;
end;
end;
end;
end;
function TFlashCanvas.GetActiveSprite: TFSpriteCanvas;
begin
if FActiveSprite = nil then
FActiveSprite := AddActiveSprite(csMetaFile);
Result := FActiveSprite;
end;
function TFlashCanvas.AddActiveSprite(ftype: TSpriteManagerType): TFSpriteCanvas;
begin
Result := TFSpriteCanvas.Create(Owner);
owner.AddFlashObject(Result);
Result.FType := ftype;
Result.CharacterId := Owner.CurrentObjID;
inc(Owner.FCurrentObjID);
if ftype = csMetaFile then
begin
Result.Parent := nil;
Result.PlaceParam := RootSprite.PlaceObject(Result, RootSprite.MaxDepth + 1);
end else
if FActiveSprite <> nil then
begin
Result.Parent := ActiveSprite;
Result.PlaceParam := ActiveSprite.PlaceObject(Result, ActiveSprite.MaxDepth + 1);
end;
if ftype = csClipp then
begin
ClipperSprite := Owner.AddSprite;
Result.PlaceObject(ClipperSprite, 1).ClipDepth := 2;
FActiveSprite := Result;
ClippedSprite := AddActiveSprite(csDefault);
FActiveSprite := ClippedSprite;
end;
if ftype = csWorldTransform then HasWorldTransform := true;
end;
procedure TFlashCanvas.CloseActiveSprite;
begin
if FActiveSprite = nil then Exit;
if FActiveSprite.FType = csWorldTransform then HasWorldTransform := false else
if (FActiveSprite.FType = csDefault) and
(FActiveSprite.Parent <> nil) and (FActiveSprite.Parent.FType = csClipp)
then
begin
FActiveSprite := ActiveSprite.Parent.Parent;
ClippSprite := nil;
ClipperSprite := nil;
end
else
FActiveSprite := ActiveSprite.Parent;
end;
function TFlashCanvas.GetPathShape: TFlashShape;
begin
if pathShape = nil then Result := nil
else
begin
if IsUsesPathShape then
begin
Result := Owner.AddShape;
Result.Assign(pathShape);
Result.LineStyles.Clear;
Result.FillStyles.Clear;
end else Result := pathShape;
end;
end;
function TFlashCanvas.GetRootSprite: TFlashSprite;
begin
if FRootSprite = nil then
begin
FRootSprite := Owner.AddSprite;
end;
Result := FRootSprite;
end;
procedure TFlashCanvas.GetMetrixFont(F: TFont);
var
FontDC, OldFont, DC: HDC;
Size, OldFontHeight, tmpSize: integer;
TmpTextMetric: POutlineTextmetricW;
tmpLogFont: TLogFont;
x_Size: TSize;
begin
FillChar(LogFontInfo, sizeof(LogFontInfo), 0);
{..$DEFINE Release205}
{$IFDEF Release205}
if CurrentFont < 0 then
begin
FontDC := GetStockObject(Abs(CurrentFont));
GetObject(FontDC, sizeof(LogFontInfo), @LogFontInfo);
end else
with LogFontInfo, TGDIHandleFont(HTables[CurrentFont]).Info do
begin
lfHeight := elfLogFont.lfHeight;
lfWidth := 0;
lfEscapement := elfLogFont.lfEscapement;
lfOrientation := elfLogFont.lfOrientation;
lfWeight := elfLogFont.lfWeight;
if lfWeight = -1 then lfWeight := 400; // fixed bug metafile
lfItalic := Byte(elfLogFont.lfItalic>0);
lfUnderline := Byte(elfLogFont.lfUnderline>0);
lfStrikeOut := Byte(elfLogFont.lfStrikeOut>0);
lfCharSet := elfLogFont.lfCharSet;
lfOutPrecision := elfLogFont.lfOutPrecision;
lfClipPrecision := elfLogFont.lfClipPrecision;
lfQuality := elfLogFont.lfQuality;
lfPitchAndFamily := elfLogFont.lfPitchAndFamily;
StrPcopy(lfFaceName, WideCharToString(elfLogFont.lfFaceName));
FontDC := CreateFontIndirect(LogFontInfo);
lfWidth := Abs(elfLogFont.lfWidth);
end;
F.Handle := FontDC;
DC:=GetDC(0);
OldFont := SelectObject(DC, FontDC);
Size := GetOutlineTextMetricsW(DC, 0, nil);
if Size <> FTextMetricSize then
begin
if FTextMetricSize > 0 then FreeMem(FTextMetric, FTextMetricSize);
FTextMetricSize := Size;
GetMem(FTextMetric, FTextMetricSize);
end;
GetOutlineTextMetricsW(DC, FTextMetricSize, FTextMetric);
// GetTextMetricsW(DC, FTextMetric);
GetObject(GetCurrentObject(DC,OBJ_FONT),SizeOf(LogFontInfo),@LogFontInfo);
if CurrentFont >= 0 then
with LogFontInfo, TGDIHandleFont(HTables[CurrentFont]).Info do
begin
lfWidth := Abs(elfLogFont.lfWidth);
end;
SelectObject(DC, OldFont);
DeleteObject(FontDC);
ReleaseDC(0, DC);
{$ELSE}
//
DC := GetDC(0);
OldFont := GetCurrentObject(BufferBMP.DC, OBJ_FONT);
GetObject(OldFont, SizeOf(LogFontInfo), @LogFontInfo);
tmpLogFont := LogFontInfo;
with LogFontInfo do
begin
lfItalic := Byte(lfItalic > 0);
lfUnderline := Byte(lfUnderline>0);
lfStrikeOut := Byte(lfStrikeOut>0);
OldFontHeight := lfHeight;
if lfHeight < 0
then
lfHeight := - MapLen(Abs(lfHeight), true)
else
lfHeight := - Abs(MulDiv(MapLen(lfHeight, true), 72, GetDeviceCaps(DC, LOGPIXELSY)));
if (lfOutPrecision and $F) in [OUT_STRING_PRECIS, OUT_RASTER_PRECIS] then
lfOutPrecision := lfOutPrecision and $F0 + OUT_TT_PRECIS;
end;
tmpSize := 0;
if LogFontInfo.lfWidth <> 0 then
begin
tmpLogFont.lfWidth := 0;
FontDC := CreateFontIndirect(tmpLogFont);
OldFont := SelectObject(DC, FontDC);
tmpSize := GetOutlineTextMetricsW(DC, 0, nil);
GetMem(TmpTextMetric, tmpSize);
GetOutlineTextMetricsW(DC, tmpSize, TmpTextMetric);
FontScale := Abs(LogFontInfo.lfWidth) / TmpTextMetric.otmTextMetrics.tmAveCharWidth;
FreeMem(TmpTextMetric, tmpSize);
DeleteObject(SelectObject(DC, OldFont));
end
else FontScale := 1;
FontDC := CreateFontIndirect(LogFontInfo);
F.Handle := FontDC;
OldFont := SelectObject(DC, FontDC);
Size := GetOutlineTextMetricsW(DC, 0, nil);
if Size <> FTextMetricSize then
begin
if FTextMetricSize > 0 then FreeMem(FTextMetric, FTextMetricSize);
FTextMetricSize := Size;
GetMem(FTextMetric, FTextMetricSize);
end;
if Size > 0
then
GetOutlineTextMetricsW(DC, FTextMetricSize, FTextMetric)
else
begin // no installing font
FTextMetricSize := SizeOf(TOutlineTextmetricW);
GetMem(FTextMetric, FTextMetricSize);
FTextMetric.otmTextMetrics.tmHeight := Abs(F.Height);
FTextMetric.otmTextMetrics.tmAscent := Abs(F.Size);
GetTextExtentPoint32(DC, 'x', 1, x_Size);
FTextMetric.otmTextMetrics.tmAveCharWidth := x_Size.cx;
FTextMetric.otmsStrikeoutSize := 1;
FTextMetric.otmsStrikeoutPosition := FTextMetric.otmTextMetrics.tmHeight div 2;
FTextMetric.otmsUnderscoreSize := 1;
FTextMetric.otmsUnderscorePosition := FTextMetric.otmTextMetrics.tmHeight div 10;
end;
SelectObject(DC, OldFont);
DeleteObject(FontDC);
ReleaseDC(0, DC);
{$ENDIF}
end;
// =============================================================//
// FlashObjectLists //
// =============================================================//
{
***************************************************** TFlashObjectList ******************************************************
}
constructor TFlashObjectList.Create;
begin
ObjectList := TObjectList.Create(false);
end;
destructor TFlashObjectList.Destroy;
begin
ObjectList.Free;
inherited Destroy;
end;
procedure TFlashObjectList.Add(Obj: TFlashIDObject);
begin
ObjectList.Add(Obj);
end;
function TFlashObjectList.FGetFromID(ID: word): TFlashIDObject;
var
il: Word;
begin
Result := nil;
if ObjectList.Count > 0 then
for il := 0 to ObjectList.Count - 1 do
if TFlashIDObject(ObjectList[il]).CharacterID = ID then
begin
Result := TFlashIDObject(ObjectList[il]);
Break;
end;
end;
function TFlashObjectList.GetCount: Word;
begin
Result := ObjectList.Count;
end;
{
***************************************************** TFlashButtonList ******************************************************
}
function TFlashButtonList.GetButton(Index: word): TFlashButton;
begin
Result := TFlashButton(ObjectList[Index]);
end;
function TFlashButtonList.GetFromID(ID: word): TFlashButton;
begin
Result := TFlashButton(FGetFromID(ID));
end;
function TFlashButtonList.Last: TFlashButton;
begin
if Count = 0 then Result := nil
else Result := TFlashButton(ObjectList[Count - 1]);
end;
{
****************************************************** TFlashFontList *******************************************************
}
function TFlashFontList.GetFont(Index: word): TFlashFont;
begin
Result := TFlashFont(ObjectList[Index]);
end;
function TFlashFontList.GetFromID(ID: word): TFlashFont;
begin
Result := TFlashFont(FGetFromID(ID));
end;
function TFlashFontList.FindByFont(F: TFont; CompareSize: boolean): TFlashFont;
var il: integer;
begin
Result := nil;
if Count > 0 then
for il := 0 to Count - 1 do
With Font[il] do
if (F.Name = Name) and (Bold = (fsBold in F.Style)) and (Italic = (fsItalic in F.Style))
and (not CompareSize or (F.Size = Size)) then
begin
Result := Font[il];
Break;
end;
end;
function TFlashFontList.Last: TFlashFont;
begin
if Count = 0 then Result := nil
else Result := TFlashFont(ObjectList[Count - 1]);
end;
{
****************************************************** TFlashImageList ******************************************************
}
function TFlashImageList.GetFromID(ID: word): TFlashImage;
begin
Result := TFlashImage(FGetFromID(ID));
end;
function TFlashImageList.GetImage(Index: word): TFlashImage;
begin
Result := TFlashImage(ObjectList[Index]);
end;
function TFlashImageList.Last: TFlashImage;
begin
if Count = 0 then Result := nil
else Result := TFlashImage(ObjectList[Count - 1]);
end;
{
*************************************************** TFlashMorphShapeList ****************************************************
}
function TFlashMorphShapeList.GetFromID(ID: word): TFlashMorphShape;
begin
Result := TFlashMorphShape(FGetFromID(ID));
end;
function TFlashMorphShapeList.GetShape(Index: word): TFlashMorphShape;
begin
Result := TFlashMorphShape(ObjectList[Index]);
end;
function TFlashMorphShapeList.Last: TFlashMorphShape;
begin
if Count = 0 then Result := nil
else Result := TFlashMorphShape(ObjectList[Count - 1]);
end;
{
****************************************************** TFlashShapeList ******************************************************
}
function TFlashShapeList.GetFromID(ID: word): TFlashShape;
begin
Result := TFlashShape(FGetFromID(ID));
end;
function TFlashShapeList.GetShape(Index: word): TFlashShape;
begin
Result := TFlashShape(ObjectList[Index]);
end;
function TFlashShapeList.Last: TFlashShape;
begin
if Count = 0 then Result := nil
else Result := TFlashShape(ObjectList[Count - 1]);
end;
{
****************************************************** TFlashSoundList ******************************************************
}
function TFlashSoundList.GetFromID(ID: word): TFlashSound;
begin
Result := TFlashSound(FGetFromID(ID));
end;
function TFlashSoundList.GetSound(Index: word): TFlashSound;
begin
Result := TFlashSound(ObjectList[Index]);
end;
function TFlashSoundList.Last: TFlashSound;
begin
if Count = 0 then Result := nil
else Result := TFlashSound(ObjectList[Count - 1]);
end;
{
***************************************************** TFlashSpriteList ******************************************************
}
function TFlashSpriteList.GetFromID(ID: word): TFlashSprite;
begin
Result := TFlashSprite(FGetFromID(ID));
end;
function TFlashSpriteList.GetSprite(Index: word): TFlashSprite;
begin
Result := TFlashSprite(ObjectList[Index]);
end;
function TFlashSpriteList.Last: TFlashSprite;
begin
if Count = 0 then Result := nil
else Result := TFlashSprite(ObjectList[Count - 1]);
end;
{
****************************************************** TFlashTextList *******************************************************
}
function TFlashTextList.GetFromID(ID: word): TFlashText;
begin
Result := TFlashText(FGetFromID(ID));
end;
function TFlashTextList.GetText(Index: word): TFlashText;
begin
Result := TFlashText(ObjectList[Index]);
end;
function TFlashTextList.Last: TFlashText;
begin
if Count = 0 then Result := nil
else Result := TFlashText(ObjectList[Count - 1]);
end;
{
****************************************************** TFlashVideoList ******************************************************
}
function TFlashVideoList.GetFromID(ID: word): TFlashVideo;
begin
Result := TFlashVideo(FGetFromID(ID));
end;
function TFlashVideoList.GetVideo(Index: word): TFlashVideo;
begin
Result := TFlashVideo(ObjectList[Index]);
end;
function TFlashVideoList.Last: TFlashVideo;
begin
if Count = 0 then Result := nil
else Result := TFlashVideo(ObjectList[Count - 1]);
end;
{
**************************************************** TFlashExternalMovie ****************************************************
}
constructor TFlashExternalMovie.Create(owner: TFlashMovie; src: string);
begin
inherited Create(owner);
FReader := TSWFStreamReader.Create(src);
FRenameFontName := true;
end;
constructor TFlashExternalMovie.Create(owner: TFlashMovie; src: TStream);
begin
inherited Create(owner);
FReader := TSWFStreamReader.Create(src);
FRenameFontName := true;
end;
destructor TFlashExternalMovie.Destroy;
begin
FReader.Free;
if FSprite <> nil then FSprite.Free;
inherited;
end;
function TFlashExternalMovie.IDObjectsCount: Word;
var
il: integer;
begin
Result := 0;
if FReader.TagList.Count = 0 then Exit;
for il := 0 to FReader.TagList.Count - 1 do
With FReader.TagInfo[il] do
Case TagID of
tagDefineShape, tagDefineShape2, tagDefineShape3, tagDefineShape4,
tagDefineMorphShape, tagDefineMorphShape2,
tagDefineBits, tagDefineBitsJPEG2, tagDefineBitsJPEG3,
tagDefineBitsLossless, tagDefineBitsLossless2,
tagDefineFont, tagDefineFont2, tagDefineFont3,
tagDefineText, tagDefineText2,
tagDefineEditText,
tagDefineSound,
tagDefineButton, tagDefineButton2,
tagDefineSprite,
tagDefineVideoStream: inc(Result);
tagImportAssets, tagImportAssets2:
if SWFObject <> nil then
with TSWFImportAssets(SWFObject) do
if Assets.Count > 0 then
inc(Result, Assets.Count);
end;
end;
procedure TFlashExternalMovie.Renumber(start: word);
begin
FReader.Renumber(start);
end;
procedure TFlashExternalMovie.WriteToStream(be: TBitsEngine);
var
il: Word;
isWrite, UserIsWrite: Boolean;
O: TSWFObject;
fontPrefix, noRenameName: string;
ils: integer;
sflag: byte;
begin
if FReader.TagList.Count > 0 then
begin
if RenameFontName then fontPrefix := IntToStr(random($FFFF));
if (IncludeMode = eimSprite) then
begin
if FSprite = nil then
begin
FSprite := TFlashSprite.Create(owner);
FSprite.Owner := Owner;
FSprite.CharacterId := CharacterId;
end else
begin
FSprite.Sprite.ControlTags.Clear;
FSprite.FrameCount := 0;
end;
end;
noRenameName := '"';
For il := 0 to FReader.TagList.Count - 1 do
With FReader.TagInfo[il] do
if SWFObject = nil then
begin
FReader.BodyStream.Position := Position;
be.BitsStream.CopyFrom(FReader.BodyStream, GetFullSize);
end else
begin
isWrite := true;
UserIsWrite := true;
Case TagID of
tagSetBackgroundColor, tagProtect, tagEnd,
tagMetadata, tagFileAttributes,
tagEnableDebugger, tagEnableDebugger2:
isWrite := false;
tagPlaceObject, tagPlaceObject2, tagPlaceObject3,
tagRemoveObject, tagRemoveObject2,
tagStartSound:
if IncludeMode = eimResource then isWrite := false;
tagShowFrame:
if IncludeMode in [eimResource, eimNoFrameRoot] then isWrite := false;
end;
// eimResource, eimNoFrameRoot, eimSprite
if isWrite and Assigned(FOnWriteTag) then OnWriteTag(SWFObject, UserIsWrite);
if isWrite and UserIsWrite then
case TagID of
tagShowFrame:
if IncludeMode = eimSprite then FSprite.ShowFrame else
begin
SWFObject.WriteToStream(be);
Owner.SWFHeader.FramesCount := Owner.SWFHeader.FramesCount + 1;
end;
tagDefineFontInfo, tagDefineFontInfo2:
with TSWFDefineFontInfo(SWFObject) do
begin
if RenameFontName and (CodeTable.Count > 0)
then FontName := fontPrefix + FontName
else noRenameName := noRenameName + FontName + '"';
WriteToStream(be);
end;
tagDefineFont2, tagDefineFont3:
with TSWFDefineFont2(SWFObject) do
begin
if RenameFontName and (GlyphShapeTable.Count > 0)
then FontName := fontPrefix + FontName
else noRenameName := noRenameName + FontName + '"';
WriteToStream(be);
end;
tagDefineEditText:
with TSWFDefineEditText(SWFObject) do
begin
// replace <font face="name"> to <font face="prefix+name">
if RenameFontName and HasText and HTML and (InitialText <> '') then
begin
ils := 1;
sflag := 0; // begin search "face"
while ils < Length(InitialText) do
begin
if (sflag = 0) and
(LowerCase(InitialText[ils])='f') and
(LowerCase(InitialText[ils+1])='a') and
(LowerCase(InitialText[ils+2])='c') and
(LowerCase(InitialText[ils+3])='e')
then
begin
sflag := 1;
inc(ils, 4);
end;
if (sflag = 1) and (InitialText[ils] in ['"', '''']) then
begin
InitialText := Copy(InitialText, 1, ils) + fontPrefix +
Copy(InitialText, ils + 1, Length(InitialText) - ils);
if InitialText[ils] = '"' then sflag := 2 else sflag := 3;
inc(ils, length(fontPrefix) + 1);
end;
if (sflag = 2) and (InitialText[ils] = '"') then sflag := 0 else
if (sflag = 3) and (InitialText[ils] = '''') then sflag := 0;
inc(ils);
end;
end;
WriteToStream(be);
end;
tagStartSound, tagPlaceObject, tagPlaceObject2, tagPlaceObject3, tagFrameLabel,
tagSoundStreamHead, tagSoundStreamHead2, tagSoundStreamBlock,
tagRemoveObject, tagRemoveObject2, tagDoAction:
if IncludeMode = eimSprite then
begin
O := GenerateSWFObject(TagID);
O.Assign(SWFObject);
FSprite.ObjectList.Add(O);
end else SWFObject.WriteToStream(be);
else SWFObject.WriteToStream(be);
end;
end;
if (IncludeMode = eimSprite) then FSprite.WriteToStream(be);
end;
end;
{
******************************************************** TFlashMovie ********************************************************
}
constructor TFlashFilterSettings.Create;
begin
inherited;
FShadowColor := TSWFRGBA.Create(true);
FGlowColor := TSWFRGBA.Create(true);
FShadowColor.RGBA := cswfBlack;
FGlowColor.RGBA := cswfWhite;
BlurX := 5;
BlurY := 5;
Distance := 5;
Angle := 45;
Strength := 100;
OnTop := true;
end;
destructor TFlashFilterSettings.Destroy;
begin
FShadowColor.Free;
FGlowColor.Free;
inherited;
end;
{$IFDEF ASCompiler}
constructor TBaseCompileContext.Create(owner: TFlashMovie);
begin
inherited Create;
FMovie := owner;
end;
function TBaseCompileContext.GetListing: TStream;
begin
Result := FMovie.ASCompilerLog;
end;
{$ENDIF}
// =============================================================//
// TFlashMovie //
// =============================================================//
{
******************************************************** TFlashMovie ********************************************************
}
constructor TFlashMovie.Create(XMin, YMin, XMax, YMax: integer; fps: single; sc: TSWFSystemCoord = scTwips);
begin
inherited ;
FFix32bitImage := True;//yangrh
CorrectImageFill := true;
FObjectList := TObjectList.Create;
CurrentObjID := 1;
{$IFDEF ASCompiler}
FSelfDestroyASLog := false;
{$ENDIF}
end;
destructor TFlashMovie.Destroy;
begin
if FGlobalFilterSettings <> nil then FGlobalFilterSettings.Free;
if FBackgroundColor <> nil then FBackgroundColor.Free;
if FBackgroundSound <> nil then FBackgroundSound.Free;
if FVideoList <> nil then FVideoList.Free;
if FButtons <> nil then FButtons.Free;
if FFonts <> nil then FFonts.Free;
if FImages <> nil then FImages.Free;
if FMorphShapes <> nil then FMorphShapes.Free;
if FShapes <> nil then FShapes.Free;
if FSounds <> nil then FSounds.Free;
if FSprites <> nil then FSprites.Free;
if FTexts <> nil then FTexts.Free;
if FVideos <> nil then FVideos.Free;
if FCanvas <> nil then FCanvas.Free;
if FFileAttributes <> nil then FFileAttributes.Free;
{$IFDEF ASCompiler}
if FASCompiler <> nil then FASCompiler.Free;
if FSelfDestroyASLog and (FASCompilerLog <> nil) then FASCompilerLog.Free;
{$ENDIF}
FObjectList.Free;
inherited ;
end;
procedure TFlashMovie.DoChangeHeader;
begin
inherited;
if Version > 7 then CorrectImageFill := false;
end;
function TFlashMovie.AddArc(XCenter, YCenter, RadiusX, RadiusY: longint; StartAngle, EndAngle: single; closed: boolean =
true): TFlashShape;
begin
result := AddShape;
result.SetShapeBound(XCenter - RadiusX, YCenter - RadiusY, XCenter + RadiusX, YCenter + RadiusY);
result.Edges.MakeArc(XCenter, YCenter, RadiusX, RadiusY, StartAngle, EndAngle, closed);
result.Edges.EndEdges;
end;
function TFlashMovie.AddArc(XCenter, YCenter, Radius: longint; StartAngle, EndAngle: single; closed: boolean = true):
TFlashShape;
begin
result := AddArc(XCenter, YCenter, Radius, Radius, StartAngle, EndAngle, closed);
end;
function TFlashMovie.AddButton(hasmenu: boolean = false; advMode: boolean = true): TFlashButton;
begin
Result := TFlashButton.Create(self, hasmenu, advMode);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Buttons.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddCircle(XCenter, YCenter, Radius: integer): TFlashShape;
begin
Result := AddEllipse(XCenter - Radius, YCenter - Radius,
XCenter + Radius, YCenter + Radius);
end;
function TFlashMovie.AddCubicBezier(P0, P1, P2, P3: TPoint): TFlashShape;
begin
result := AddShape;
result.SetShapeBound( MinIntValue([P0.X, P1.X, P2.X, P3.X]),
MinIntValue([P0.Y, P1.Y, P2.Y, P3.Y]),
MaxIntValue([P0.X, P1.X, P2.X, P3.X]),
MaxIntValue([P0.Y, P1.Y, P2.Y, P3.Y]));
With Result.Edges do
begin
MoveTo(P0.X, P0.Y);
MakeCubicBezier(P1, P2, P3);
EndEdges;
end;
end;
function TFlashMovie.AddCurve(P1, P2, P3: TPoint): TFlashShape;
begin
result := AddShape;
result.SetShapeBound( MinIntValue([P1.X, P2.X, P3.X]),
MinIntValue([P1.Y, P2.Y, P3.Y]),
MaxIntValue([P1.X, P2.X, P3.X]),
MaxIntValue([P1.Y, P2.Y, P3.Y]));
With Result.Edges do
begin
MoveTo(P1.X, P1.Y);
CurveTo(P2.X, P2.Y, P3.X, P3.Y);
EndEdges;
end;
end;
function TFlashMovie.AddDiamond(XMin, YMin, XMax, YMax: integer): TFlashShape;
begin
result := AddShape;
result.SetShapeBound(XMin, YMin, XMax, YMax);
With Result.Edges do
begin
MoveTo(XMin + (XMax - XMin) div 2, YMin);
MakeDiamond(XMax - XMin, YMax - YMin);
EndEdges;
end;
end;
function TFlashMovie.AddDynamicText(varname, init: ansistring; c: recRGBA; f: TFlashFont; R: TRect): TFlashText;
var
fu: TFontUsing;
begin
fu := f.FontUsing;
Result := AddText(init, c, f, R);
Result.DynamicText := true;
f.FontUsing := fu + [fuDynamicText];
Result.VarName := varname;
end;
{$IFNDEF VER130}
function TFlashMovie.AddDynamicText(varname: ansistring; init: WideString; c: recRGBA; f: TFlashFont; R: TRect): TFlashText;
begin
Result := AddDynamicTextW(varname, init, c, f, R);
end;
{$ENDIF}
function TFlashMovie.AddDynamicTextW(varname: ansistring; init: WideString; c: recRGBA; f: TFlashFont; R: TRect): TFlashText;
var
fu: TFontUsing;
begin
fu := f.FontUsing;
Result := AddText(init, c, f, R);
Result.DynamicText := true;
f.FontUsing := fu + [fuDynamicText];
Result.VarName := varname;
end;
function TFlashMovie.AddEllipse(XMin, YMin, XMax, YMax: integer): TFlashShape;
var
W, H: LongInt;
begin
result := AddShape;
result.SetShapeBound(XMin, YMin, XMax, YMax);
W := Xmax - Xmin;
H := Ymax - Ymin;
with Result.Edges do
begin
MoveTo(Xmin, Ymin);
MakeEllipse(W, H);
EndEdges;
end;
end;
function TFlashMovie.AddEllipse(R: TRect): TFlashShape;
begin
Result := AddEllipse(R.Left, R.Top, R.Right, R.Bottom);
end;
function TFlashMovie.AddExternalMovie(src: string; IM: TExternalIncludeMode; autorenum: boolean = true): TFlashExternalMovie;
begin
Result := TFlashExternalMovie.Create(self, src);
ExtMoviePrepare(Result, IM, autorenum);
end;
function TFlashMovie.AddExternalMovie(src: TStream; IM: TExternalIncludeMode; autorenum: boolean = true):
TFlashExternalMovie;
begin
Result := TFlashExternalMovie.Create(self, src);
ExtMoviePrepare(Result, IM, autorenum);
end;
procedure TFlashMovie.AddFlashObject(Obj: TBasedSWFObject);
var ind: longint;
begin
if CurrentFramePosIndex = -1 then CurrentFramePosIndex := ObjectList.Count -1;
if (AddObjectMode = amEnd) or
(CurrentFramePosIndex >= (ObjectList.Count -1)) then
begin
ObjectList.Add(Obj);
CurrentFramePosIndex := ObjectList.Count - 1;
end else
begin
ind := CurrentFramePosIndex;
case AddObjectMode of
amHomeCurrentFrame:
begin
while ind > 0 do
if (TBasedSWFObject(ObjectList[ind]).LibraryLevel = SWFLevel) and
(TSWFObject(ObjectList[ind]).TagID = tagShowFrame)
then Break
else dec(ind);
end;
end;
ObjectList.Insert(ind, Obj);
inc(CurrentFramePosIndex);
end;
end;
function TFlashMovie.AddFont: TFlashFont;
begin
Result := TFlashFont.Create(self);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Fonts.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddFont(FontInfo: TFont; device: boolean = true): TFlashFont;
begin
Result := TFlashFont.Create(self, device, FontInfo.Name, fsbold in FontInfo.Style,
fsItalic in FontInfo.Style, Abs(FontInfo.Height));
Result.CharacterId := CurrentObjID;
Result.FontCharset := FontInfo.Charset;
AddFlashObject(Result);
Fonts.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddFont(LogFont: TLogFont; device: boolean = true): TFlashFont;
begin
Result := TFlashFont.Create(self);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Fonts.Add(Result);
inc(FCurrentObjID);
Result.AsDevice := device;
Result.SetFontInfo(LogFont);
end;
function TFlashMovie.AddFont(Name: string; bold, italic: boolean; size: integer; device: boolean = true): TFlashFont;
begin
Result := TFlashFont.Create(self, device, Name, bold, Italic, size);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Fonts.Add(Result);
inc(FCurrentObjID);
end;
procedure TFlashMovie.AddIDObject(Obj: TFlashIDObject; SetID: boolean = true);
begin
AddFlashObject(Obj);
Obj.Owner := self;
if SetID then
begin
Obj.CharacterID := CurrentObjID;
inc(FCurrentObjID);
end;
end;
function TFlashMovie.AddImage(fn: string = ''): TFlashImage;
begin
result := TFlashImage.Create(self, fn);
Result.CharacterID := CurrentObjID;
AddFlashObject(Result);
Images.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddLine(X1, Y1, X2, Y2: longint): TFlashShape;
begin
result := AddShape;
result.SetShapeBound(X1, Y1, X2, Y2);
With result.Edges do
begin
MoveTo(X1, Y1);
LineTo(X2, Y2);
end;
end;
function TFlashMovie.AddMorphShape(shape: TFlashMorphShape = nil): TFlashMorphShape;
begin
if Shape = nil then Result := TFlashMorphShape.Create(self) else Result := Shape;
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
MorphShapes.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddPie(XCenter, YCenter, Radius: longint; StartAngle, EndAngle: single): TFlashShape;
begin
Result := AddPie(XCenter, YCenter, Radius, Radius, StartAngle, EndAngle);
end;
function TFlashMovie.AddPie(XCenter, YCenter, RadiusX, RadiusY: longint; StartAngle, EndAngle: single): TFlashShape;
begin
result := AddShape;
result.SetShapeBound(XCenter - RadiusX, YCenter - RadiusY, XCenter + RadiusX, YCenter + RadiusY);
With result.Edges do
begin
MoveTo(XCenter, YCenter);
MakePie(RadiusX, RadiusY, StartAngle, EndAngle);
EndEdges;
end;
end;
function TFlashMovie.AddPolygon(AP: array of TPoint): TFlashShape;
var
il: Integer;
XMin, YMin, XMax, YMax: Integer;
begin
result := AddShape;
For il := low(AP) to High(AP) do
begin
if il = low(AP) then
begin
XMin := AP[il].X;
YMin := AP[il].Y;
XMax := AP[il].X;
YMax := AP[il].Y;
end else
begin
if XMin > AP[il].X then XMin := AP[il].X else
if XMax < AP[il].X then XMax := AP[il].X;
if YMin > AP[il].Y then YMin := AP[il].Y else
if YMax < AP[il].Y then YMax := AP[il].Y;
end;
end;
result.SetShapeBound(XMin, YMin, XMax, YMax);
With result.Edges do
begin
MakePolyline(AP);
CloseShape;
EndEdges;
end;
end;
function TFlashMovie.AddPolyline(AP: array of TPoint): TFlashShape;
var
il: Integer;
XMin, YMin, XMax, YMax: Integer;
begin
result := AddShape;
For il := low(AP) to High(AP) do
begin
if il = low(AP) then
begin
XMin := AP[il].X;
YMin := AP[il].Y;
XMax := AP[il].X;
YMax := AP[il].Y;
end else
begin
if XMin > AP[il].X then XMin := AP[il].X else
if XMax < AP[il].X then XMax := AP[il].X;
if YMin > AP[il].Y then YMin := AP[il].Y else
if YMax < AP[il].Y then YMax := AP[il].Y;
end;
end;
result.SetShapeBound(XMin, YMin, XMax, YMax);
result.Edges.MakePolyline(AP);
result.Edges.EndEdges;
end;
function TFlashMovie.AddRectangle(XMin, YMin, XMax, YMax: longint): TFlashShape;
begin
result := AddShape;
result.SetShapeBound(XMin, YMin, XMax, YMax);
With result.Edges do
begin
MoveTo(XMin, YMin);
MakeRectangle(XMax-XMin, YMax-YMin);
EndEdges;
end;
end;
function TFlashMovie.AddRectangle(R: TRect): TFlashShape;
begin
Result := AddRectangle(R.Left, R.Top, R.Right, R.Bottom);
end;
function TFlashMovie.AddRing(XCenter, YCenter, Radius1, Radius2: integer): TFlashShape;
var
Big, Sm: LongInt;
begin
if Radius1 > Radius2 then
begin
Big := Radius1;
Sm := Radius2;
end else
begin
Big := Radius2;
Sm := Radius1;
end;
result := AddShape;
result.SetShapeBound(XCenter - Big, YCenter - Big, XCenter + Big, YCenter + Big);
With result.Edges do
begin
MoveTo(XCenter - Big, YCenter - Big);
MakeEllipse(2 * Big, 2 * Big);
MoveTo(XCenter - Sm, YCenter - Sm);
MakeEllipse(2 * Sm, 2 * Sm);
EndEdges;
end;
end;
function TFlashMovie.AddRoundRect(XMin, YMin, XMax, YMax, Radius: longint): TFlashShape;
begin
result := AddShape;
result.SetShapeBound(XMin, YMin, XMax, YMax);
With result.Edges do
begin
MoveTo(XMin, YMin);
MakeRoundRect(XMax-XMin, YMax-YMin, Radius);
EndEdges;
end;
end;
function TFlashMovie.AddRoundRect(R: TRect; Radius: longint): TFlashShape;
begin
Result := AddRoundRect(R.Left, R.Top, R.Right, R.Bottom, Radius);
end;
function TFlashMovie.AddShape(shape: TFlashShape = nil): TFlashShape;
begin
if Shape = nil then Result := TFlashShape.Create(self) else Result := Shape;
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Shapes.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddShapeImage(fn: string): TFlashShape;
var
img: TFlashImage;
begin
img := AddImage(fn);
Result := AddRectangle(0, 0, Img.Width, Img.Height);
Result.SetImageFill(img, fmFit);
end;
function TFlashMovie.AddShapeImage(img: TFlashImage): TFlashShape;
begin
Result := AddRectangle(0, 0, Img.Width, Img.Height);
Result.SetImageFill(img, fmFit)
end;
function TFlashMovie.AddSound(fn: string): TFlashSound;
begin
Result := TFlashSound.Create(self, fn);
result.CharacterID := CurrentObjID;
AddFlashObject(Result);
Sounds.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddSound(Src: TMemoryStream; isMP3: boolean): TFlashSound;
begin
Result := TFlashSound.Create(self, '');
Result.LoadFromMemory(Src, isMP3);
result.CharacterID := CurrentObjID;
AddFlashObject(Result);
Sounds.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddSprite(VO: TFlashVisualObject = nil): TFlashSprite;
begin
Result := TFlashSprite.Create(self);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Sprites.Add(Result);
inc(FCurrentObjID);
if VO <> nil then Result.PlaceObject(VO, 1);
end;
function TFlashMovie.AddSquare(XMin, YMin, Side: integer): TFlashShape;
begin
Result := AddRectangle(XMin, YMin, XMin + Side, YMin + Side);
end;
function TFlashMovie.AddSquare(XMin, YMin, XMax, YMax: integer): TFlashShape;
begin
if (YMax - YMin) < (XMax - XMin)
then
Result := AddRectangle(XMin, YMin, XMin + (YMax - YMin), YMax)
else
Result := AddRectangle(XMin, YMin, XMax, YMin + (XMax - XMin));
end;
function TFlashMovie.AddStar(X, Y, R1, R2: longint; NumPoint: word; curve: boolean = false): TFlashShape;
var
RMax: LongInt;
begin
Result := AddShape;
RMax := Max(R1, R2);
Result.SetShapeBound(X - RMax, Y - RMax, X + RMax, Y + RMax);
Result.Edges.MakeStar(X, Y, R1, R2, NumPoint, curve);
Result.Edges.EndEdges;
end;
function TFlashMovie.AddText: TFlashText;
begin
Result := TFlashText.Create(self, '');
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Texts.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddText(s: ansistring; c: recRGBA; f: TFlashFont; P: TPoint; Align: TSWFTextAlign = taLeft): TFlashText;
begin
Result := TFlashText.Create(self, s, c, f, P, Align);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Texts.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddText(s: ansistring; c: recRGBA; f: TFlashFont; R: TRect): TFlashText;
begin
Result := TFlashText.Create(self, s, c, f, R);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Texts.Add(Result);
inc(FCurrentObjID);
end;
{$IFNDEF VER130}
function TFlashMovie.AddText(s: WideString; c: recRGBA; f: TFlashFont; P: TPoint; Align: TSWFTextAlign = taLeft): TFlashText;
begin
Result := AddTextW(s, c, f, P, Align);
end;
function TFlashMovie.AddText(s: WideString; c: recRGBA; f: TFlashFont; R: TRect): TFlashText;
begin
Result := AddTextW(s, c, f, R);
end;
{$ENDIF}
function TFlashMovie.AddTextW(s: WideString; c: recRGBA; f: TFlashFont; P: TPoint; Align: TSWFTextAlign = taLeft):
TFlashText;
begin
Result := TFlashText.CreateW(self, s, c, f, P, Align);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Texts.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddTextW(s: WideString; c: recRGBA; f: TFlashFont; R: TRect): TFlashText;
begin
Result := TFlashText.CreateW(self, s, c, f, R);
Result.CharacterId := CurrentObjID;
AddFlashObject(Result);
Texts.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddVideo(FileName: string): TFlashVideo;
begin
Result := TFlashVideo.Create(self, FileName);
Result.CharacterID := CurrentObjID;
AddFlashObject(Result);
Videos.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.AddVideoFromStream(MS: TMemoryStream): TFlashVideo;
begin
Result := TFlashVideo.Create(self, MS);
Result.CharacterID := CurrentObjID;
AddFlashObject(Result);
Videos.Add(Result);
inc(FCurrentObjID);
end;
function TFlashMovie.CalcFramesCount: Word;
var
il: Word;
begin
Result := 0;
if ObjectList.Count > 0 then
for il := 0 to ObjectList.Count - 1 do
if (TBasedSWFObject(ObjectList[il]).LibraryLevel = SWFLevel) and
(TSWFObject(ObjectList[il]).TagID = tagShowFrame) then Inc(Result);
if Result <> FramesCount then SWFHeader.FramesCount := Result;
end;
procedure TFlashMovie.Clear;
begin
Protect := false;
BackgroundMode := bmNone;
ObjectList.Clear;
Texts.ObjectList.Clear;
Fonts.ObjectList.Clear;
Shapes.ObjectList.Clear;
Images.ObjectList.Clear;
Sounds.ObjectList.Clear;
Buttons.ObjectList.Clear;
MorphShapes.ObjectList.Clear;
Sprites.ObjectList.Clear;
Videos.ObjectList.Clear;
CurrentObjID := 1;
end;
function TFlashMovie.ExportAssets(name: string; id: word): TSWFExportAssets;
begin
Result := TSWFExportAssets.Create;
Result.SetAsset(name, id);
AddFlashObject(Result);
end;
function TFlashMovie.ExportAssets(name: string; Sprite: TFlashSprite): TSWFExportAssets;
begin
Result := ExportAssets(name, Sprite.CharacterId);
end;
procedure TFlashMovie.ExtMoviePrepare(EM: TFlashExternalMovie; IM: TExternalIncludeMode; autorenum: boolean);
begin
EM.IncludeMode := IM;
AddIDObject(EM);
EM.Reader.ReadBody(true{autorenum}, false);
if autorenum then EM.Renumber(EM.CharacterId + 1 * byte(EM.IncludeMode = eimSprite));
FCurrentObjID := EM.IDObjectsCount + EM.CharacterId + 1 + 1 * byte(EM.IncludeMode = eimSprite);
if EM.IncludeMode = eimSprite then
begin
EM.FSprite := TFlashSprite.Create(self);
EM.FSprite.CharacterId := EM.CharacterId;
EM.FSprite.FrameCount := EM.Reader.FramesCount;
Sprites.Add(EM.FSprite);
end;
end;
function TFlashMovie.FindObjectFromID(ID: word): TFlashIDObject;
var
il: Integer;
begin
Result := nil;
if ObjectList.Count > 0 then
For il := 0 to ObjectList.Count -1 do
if (ObjectList[il] is TFlashIdObject) and (TFlashIdObject(ObjectList[il]).CharacterID = ID) then
Result := TFlashIdObject(ObjectList[il]);
end;
function TFlashMovie.FramePos(num: word): longint;
var il, cur: longint;
begin
cur := 0;
Result := 0;
if (num = 0) or (ObjectList.Count = 0) then Exit;
Result := -1;
for il := 0 to ObjectList.Count - 1 do
if (ObjectList[il] is TSWFShowFrame) then
begin
inc(cur);
if num = cur then
begin
Result := il;
Break;
end;
end;
if Result = -1 then Result := ObjectList.Count - 1;
end;
{$IFDEF ASCompiler}
function TFlashMovie.GetASCompilerLog: TStream;
begin
if FASCompilerLog = nil then
begin
FASCompilerLog := TMemoryStream.Create;
FSelfDestroyASLog := true;
end;
Result := FASCompilerLog;
end;
function TFlashMovie.GetASCompiler: TBaseCompileContext;
begin
if FASCompiler = nil then
begin
FASCompiler := TCompileContext.Create(self);
end;
Result := FASCompiler;
end;
procedure TFlashMovie.SetCompilerOptions(value: TCompileOptions);
begin
if FASCompilerOptions <> Value then
begin
TCompileContext(ASCompiler).CompileOptions := Value;
end;
end;
{$ENDIF}
function TFlashMovie.GetBackgrondSound: TFlashSound;
begin
if fBackgroundSound = nil then
begin
fBackgroundSound := TFlashSound.Create(self);
fBackgroundSound.AutoLoop := true;
EnableBGSound := true;
end;
Result := fBackgroundSound;
end;
function TFlashMovie.GetBackgroundColor: TSWFRGB;
begin
if fBackgroundColor = nil then fBackgroundColor := TSWFRGB.Create;
result := fBackgroundColor;
BackgroundMode := bmColor;
end;
function TFlashMovie.GetButtons: TFlashButtonList;
begin
if FButtons = nil then FButtons := TFlashButtonList.Create;
Result := FButtons;
end;
function TFlashMovie.GetCanvas: TFlashCanvas;
begin
if FCanvas = nil then
FCanvas := TFlashCanvas.Create(self);
Result := FCanvas;
end;
function TFlashMovie.GetFileAttributes: TSWFFileAttributes;
begin
if FFileAttributes = nil then FFileAttributes := TSWFFileAttributes.Create;
Result := FFileAttributes;
end;
function TFlashMovie.GetFonts: TFlashFontList;
begin
if FFonts = nil then FFonts := TFlashFontList.Create;
Result := FFonts;
end;
function TFlashMovie.GetFrameActions: TFlashActionScript;
begin
if fFrameActions = nil then fFrameActions := TFlashActionScript.Create(self);
Result:=fFrameActions;
end;
function TFlashMovie.GetGlobalFilterSettings: TFlashFilterSettings;
begin
if FGlobalFilterSettings = nil then FGlobalFilterSettings := TFlashFilterSettings.Create;
Result := FGlobalFilterSettings;
end;
function TFlashMovie.GetHasMetadata: boolean;
begin
Result := GetFileAttributes.HasMetadata;
end;
function TFlashMovie.GetImages: TFlashImageList;
begin
if FImages = nil then FImages := TFlashImageList.Create;
Result := FImages;
end;
function TFlashMovie.GetMinVersion: Byte;
var
il: Integer;
SWFObject: TBasedSWFObject;
begin
Result := SWFVer1;
if UseFileAttributes then Result := SWFVer8 else
if ObjectList.Count > 0 then
for il:=0 to ObjectList.Count - 1 do
begin
SWFObject := TBasedSWFObject(ObjectList[il]);
if (SWFObject<>nil) and (Result < SWFObject.MinVersion) then
Result := SWFObject.MinVersion;
end;
end;
function TFlashMovie.GetMorphShapes: TFlashMorphShapeList;
begin
if FMorphShapes = nil then FMorphShapes := TFlashMorphShapeList.Create;
Result := FMorphShapes;
end;
function TFlashMovie.GetObjectList: TObjectList;
begin
Result := FObjectList;
end;
function TFlashMovie.GetShapes: TFlashShapeList;
begin
if FShapes = nil then FShapes := TFlashShapeList.Create;
Result := FShapes;
end;
function TFlashMovie.GetSounds: TFlashSoundList;
begin
if FSounds = nil then FSounds := TFlashSoundList.Create;
Result := FSounds;
end;
function TFlashMovie.GetSprites: TFlashSpriteList;
begin
if FSprites = nil then FSprites := TFlashSpriteList.Create;
Result := FSprites;
end;
function TFlashMovie.GetTexts: TFlashTextList;
begin
if FTexts = nil then FTexts := TFlashTextList.Create;
Result := FTexts;
end;
function TFlashMovie.GetUseNetwork: boolean;
begin
Result := GetFileAttributes.UseNetwork;
end;
function TFlashMovie.GetVideoListCount: Integer;
begin
if FVideoList = nil then Result := 0
else Result := FVideoList.Count;
end;
function TFlashMovie.GetVideos: TFlashVideoList;
begin
if FVideos = nil then FVideos := TFlashVideoList.Create;
Result := FVideos;
end;
function TFlashMovie.GetVideoStream(index: LongInt): TFlashPlaceVideo;
begin
result := nil;
if VideoListCount > 0 then
Result := TFlashPlaceVideo(FVideoList[index]);
end;
function TFlashMovie.ImportAssets(filename: string): TSWFImportAssets;
var R: TSWFStreamReader;
il: longint;
il2: byte;
EA: TSWFExportAssets;
BE: TBitsEngine;
begin
Result := TSWFImportAssets.Create;
Result.URL := ExtractFileName(filename);
R := TSWFStreamReader.Create(filename);
R.ReadBody(false, false);
if R.TagList.Count > 0 then
for il := 0 to R.TagList.Count - 1 do
if R.TagInfo[il].TagID = tagExportAssets then
begin
EA := TSWFExportAssets.Create;
BE := TBitsEngine.Create(R.BodyStream);
R.BodyStream.Position := R.TagInfo[il].Position;
EA.ReadFromStream(BE);
if EA.Assets.Count > 0 then
for il2 := 0 to EA.Assets.Count - 1 do
begin
Result.SetAsset(EA.Assets[il2], FCurrentObjID);
inc(FCurrentObjID);
end;
BE.Free;
EA.Free;
end;
R.Free;
AddFlashObject(Result);
end;
function TFlashMovie.ImportAssets(URL, name: string): TSWFImportAssets;
begin
Result := TSWFImportAssets.Create;
Result.URL := URL;
Result.SetAsset(name, CurrentObjID);
inc(FCurrentObjID);
AddFlashObject(Result);
end;
procedure TFlashMovie.MakeStream;
var
BE: TBitsEngine;
il, il2: LongInt;
SH: TSWFSoundStreamHead2;
fMin: Byte;
FrCount: Word;
PlaceExist: boolean;
{$IFDEF UNREGISTRED}
R: TFlashShape;
Txt: TFlashText;
s: string;
DF: TFlashFont;
l: word;
{$ENDIF}
begin
if (BodyStream.Size > 0) then
begin
if (BodyStream is TMemoryStream) then TMemoryStream(BodyStream).Clear
else BodyStream.Size := 0;
end;
fMin := Version;
FrCount := 0;
{$IFDEF UNREGISTRED}
AddObjectMode := amCurrentFrame;
CurrentFrameNum := 0;
SystemCoord := scTwips;
R := AddRectangle(twips, twips, 195*twips, 25*twips);
R.SetLineStyle(twips, cswfBlack);
R.SetSolidColor(255, 255, 255, 190);
l := Random($F9) + $FF00;
PlaceObject(R, l);
S := 'Vosfhjtusfe!wfstjpo!Efmqij!TXG!TEL"';
//'Unregistred version Delphi SWF SDK!';
for il := 1 to length(S) do S[il] := CHR(Ord(S[il])-1);
DF := AddFont;
DF.Name := 'Times New Roman';
DF.FSize := 12 * twips;
Txt := AddText(S, cswfBlue, DF, Rect(4*twips, 6*twips, 195*twips, 30*twips));
PlaceObject(Txt, l + 1 + Random(3));
{$ENDIF}
BE:=TBitsEngine.Create(BodyStream);
if UseFileAttributes then
begin
GetFileAttributes.WriteToStream(BE);
if HasMetadata then
with TSWFMetadata.Create do
begin
Metadata := self.Metadata;
WriteToStream(BE);
end;
end;
if BackgroundMode = bmColor then
With TSWFSetBackgroundColor.Create do
begin
Color.RGB := BackgroundColor.RGB;
WriteToStream(BE);
free;
end;
if EnableBGSound and (fBackgroundSound <> nil) then
begin
if fMin < BackgroundSound.MinVersion then fMin := BackgroundSound.MinVersion;
SH := TSWFSoundStreamHead2.Create;
BackgroundSound.FillHeader(SH, FPS);
SH.WriteToStream(BE);
SH.Free;
end;
if Protect then
with TSWFProtect.Create do
begin
Password := self.Password;
WriteToStream(BE);
if fMin < MinVersion then fMin := MinVersion;
Free;
end;
PlaceExist := false;
if ObjectList.Count > 0 then
begin
For il:=0 to ObjectList.Count - 1 do
with TBasedSWFObject(ObjectList[il]) do
begin
if Assigned(OnProgress) then OnProgress(self, Round((il+1)/ObjectList.Count*100), pwtMakeStream);
if fMin < MinVersion then fMin := MinVersion;
Case LibraryLevel of
SWFLevel:
begin
case TSWFObject(ObjectList[il]).TagID of
tagShowFrame:
begin
if VideoListCount > 0 then
for il2 := 0 to VideoListCount-1 do
With VideoList[il2] do
WriteToStream(BE, FrCount);
if EnableBGSound and (fBackgroundSound <> nil) and
(fBackgroundSound.StartFrame <= SWFHeader.FramesCount) then
fBackgroundSound.WriteSoundBlock(BE);
inc(FrCount);
end;
tagPlaceObject, tagPlaceObject2, tagPlaceObject3:
PlaceExist := true;
end;
end;
FlashLevel:
begin
if (ObjectList[il] is TFlashPlaceObject) then
begin
TFlashPlaceObject(ObjectList[il]).PlaceObject.SWFVersion := fMin;
PlaceExist := true;
end;
if (ObjectList[il] is TFlashExternalMovie) and
(TFlashExternalMovie(ObjectList[il]).IncludeMode = eimRoot)
then
FrCount := FrCount + TFlashExternalMovie(ObjectList[il]).Reader.FramesCount;
end;
end;
WriteToStream(be);
end;
end;
if (FrCount = 0) and PlaceExist then
begin
BE.WriteWord(tagShowFrame shl 6);
FrCount := 1;
end;
if (ObjectList.Count = 0) or not (ObjectList[ObjectList.Count-1] is TSWFEnd) then BE.WriteWord(tagEnd);
BE.Free;
SWFHeader.FramesCount := FrCount;
if Version < fMin then Version := fMin;
end;
procedure TFlashMovie.MoveResource(ToFrame, StartFrom, EndFrom: integer);
var il, iDelta, iTo, iStart, iEnd: longint;
Obj: TBasedSWFObject;
begin
if ToFrame > StartFrom then ToFrame := StartFrom;
if EndFrom = -1 then EndFrom := FramesCount else
if (EndFrom = 0) or (EndFrom < StartFrom) then EndFrom := StartFrom;
iDelta := 0;
iTo := FramePos(ToFrame);
if ObjectList[iTo] is TSWFShowFrame then inc(iTo);
if ToFrame = StartFrom
then iStart := iTo + 1
else iStart := FramePos(StartFrom) + 1;
iEnd := FramePos(EndFrom + 1);
if ObjectList[iEnd] is TSWFShowFrame then dec(iEnd);
if iStart < iEnd then
for il := iStart to iEnd do
begin
Obj := TBasedSWFObject(ObjectList[il]);
if (Obj is TFlashImage) or (Obj is TFlashSound) or (Obj is TFlashFont) or
(Obj is TSWFDefineBits) or (Obj is TSWFJPEGTables) or (Obj is TSWFDefineBitsJPEG2) or
(Obj is TSWFDefineBitsJPEG3) or (Obj is TSWFDefineBitsLossless) or (Obj is TSWFDefineBitsLossless2) or
(Obj is TSWFDefineFont) or (Obj is TSWFDefineFont2) or (Obj is TSWFDefineFont3) or
(Obj is TSWFDefineFont) or (Obj is TSWFDefineSound)
then
begin
ObjectList.Move(il, iTo + iDelta);
inc(iDelta);
end;
end;
end;
function TFlashMovie.PlaceObject(shape, mask: TFlashVisualObject; depth: word): TFlashPlaceObject;
var
S: TFlashSprite;
begin
S := AddSprite;
S.PlaceObject(mask, 1).ClipDepth := 2;
//S.PlaceObject(shape, 2);
S.PlaceObject(shape, 2).Name := 'mc_swf';//yangrh
Result := TFlashPlaceObject.Create(self, S, depth);
AddFlashObject(Result);
if FMaxDepth < depth then FMaxDepth := depth;
end;
function TFlashMovie.PlaceObject(shape: TFlashVisualObject; depth: word): TFlashPlaceObject;
begin
Result := TFlashPlaceObject.Create(self, shape, depth);
AddFlashObject(Result);
if FMaxDepth < depth then FMaxDepth := depth;
end;
function TFlashMovie.PlaceObject(depth: word): TFlashPlaceObject;
begin
Result := TFlashPlaceObject.Create(self, nil, depth);
AddFlashObject(Result);
if FMaxDepth < depth then FMaxDepth := depth;
end;
function TFlashMovie.PlaceVideo(F: TFlashVideo; depth: word): TFlashPlaceVideo;
begin
Result:= TFlashPlaceVideo.Create(self, F, Depth);
Result.StartFrame := FramesCount;
if FVideoList = nil then FVideoList := TObjectList.Create;
FVideoList.Add(Result);
if FMaxDepth < depth then FMaxDepth := depth;
end;
procedure TFlashMovie.RemoveObject(depth: word; shape: TFlashVisualObject = nil);
var
RO: TSWFRemoveObject;
RO2: TSWFRemoveObject2;
begin
if shape = nil then
begin
RO2 := TSWFRemoveObject2.Create;
RO2.depth := depth;
AddFlashObject(RO2);
end else
begin
RO := TSWFRemoveObject.Create;
RO.CharacterID := shape.CharacterId;
RO.depth := depth;
AddFlashObject(RO);
end;
end;
procedure TFlashMovie.SetAddObjectMode(Value: TAddObjectMode);
begin
if (FAddObjectMode <> Value) or (FAddObjectMode = amFromStartFrame) then
begin
FAddObjectMode := Value;
if FAddObjectMode = amEnd then
begin
FCurrentFrameNum := SWFHeader.FramesCount - 1;
CurrentFramePosIndex := ObjectList.Count - 1;
end else
SetCurrentFrameNum(FCurrentFrameNum);
end;
end;
procedure TFlashMovie.SetCorrectImageFill(const Value: boolean);
begin
FCorrectImageFill := Value;
end;
procedure TFlashMovie.SetCurrentFrameNum(Value: Integer);
begin
if (AddObjectMode <> amEnd) and (ObjectList.Count > 0) then
begin
if ((AddObjectMode = amCurrentFrame) and (Value = SWFHeader.FramesCount)) or
(Value > SWFHeader.FramesCount) then
begin
FCurrentFrameNum := SWFHeader.FramesCount - 1;
CurrentFramePosIndex := ObjectList.Count - 1;
end else
begin
if (AddObjectMode = amCurrentFrame) then CurrentFramePosIndex := FramePos(Value)
else
if Value = 0 then CurrentFramePosIndex := 0
else CurrentFramePosIndex := FramePos(Value - 1) + 1;
// FCurrentFrameNum := 0;
// for il := 0 to ObjectList.Count - 1 do
// if (TBasedSWFObject(ObjectList[il]).LibraryLevel = SWFLevel) and
// (TSWFObject(ObjectList[il]).TagID = tagShowFrame) then
// begin
// Inc(FCurrentFrameNum);
// if FCurrentFrameNum = Value then
// begin
// CurrentFramePosIndex := il;
// Break;
// end;
// end;
end;
end;
end;
procedure TFlashMovie.SetHasMetadata(const Value: boolean);
begin
GetFileAttributes.HasMetadata := Value;
end;
procedure TFlashMovie.SetMetadata(const Value: ansistring);
begin
FMetaData := Value;
HasMetadata := Value <> '';
UseFileAttributes := true;
end;
procedure TFlashMovie.SetObjectList(const Value: TObjectList);
begin
if FObjectList <> nil then FObjectList.Free;
FObjectList := Value;
end;
procedure TFlashMovie.SetPassword(Value: string);
begin
fProtect := true;
fPassword := value;
end;
procedure TFlashMovie.SetTabIndex(Depth, TabIndex: word);
var
TI: TSWFSetTabIndex;
begin
TI := TSWFSetTabIndex.Create;
TI.Depth := Depth;
TI.TabIndex := TabIndex;
AddFlashObject(TI);
end;
procedure TFlashMovie.SetUseFileAttributes(const Value: boolean);
begin
FUseFileAttributes := Value;
Version := SWFVer8;
end;
procedure TFlashMovie.SetUseNetwork(const Value: boolean);
begin
GetFileAttributes.UseNetwork := Value;
UseFileAttributes := true;
end;
procedure TFlashMovie.ShowFrame(c: word = 1);
var
il: Integer;
begin
if C = 0 then C := 1;
if FrameLabel<>'' then
begin
ObjectList.Add(TSWFFrameLabel.Create(FrameLabel));
FrameLabel := '';
end;
if fFrameActions <> nil then
begin
ObjectList.Add(fFrameActions);
fFrameActions := nil;
end;
For il:=1 to C do
begin
SWFHeader.FramesCount := SWFHeader.FramesCount + 1;
ObjectList.Add(TSWFShowFrame.Create);
end;
FCurrentFrameNum := SWFHeader.FramesCount - 1;
end;
function TFlashMovie.StartSound(snd: TFlashSound; Loop: word = 1): TSWFStartSound;
begin
Result := StartSound(snd.CharacterID, Loop);
end;
function TFlashMovie.StartSound(ID: word; Loop: word = 1): TSWFStartSound;
begin
Result := TSWFStartSound.Create;
Result.SoundId := ID;
AddFlashObject(Result);
end;
procedure TFlashMovie.StoreFrameActions;
begin
if fFrameActions <> nil then
begin
AddFlashObject(fFrameActions);
fFrameActions := nil;
end;
end;
Procedure CreateEmptySWF(fn: string; bg: recRGB);
begin
With TFlashMovie.Create(0,0,1,1,10) do
begin
BackgroundColor.RGB := bg;
ShowFrame;
MakeStream;
SaveToFile(fn);
free;
end;
end;
end.
|
{***************************************************************************}
{ }
{ Delphi Package Manager - DPM }
{ }
{ Copyright © 2019 Vincent Parrett and contributors }
{ }
{ vincent@finalbuilder.com }
{ https://www.finalbuilder.com }
{ }
{ }
{***************************************************************************}
{ }
{ Licensed under the Apache License, Version 2.0 (the "License"); }
{ you may not use this file except in compliance with the License. }
{ You may obtain a copy of the License at }
{ }
{ http://www.apache.org/licenses/LICENSE-2.0 }
{ }
{ Unless required by applicable law or agreed to in writing, software }
{ distributed under the License is distributed on an "AS IS" BASIS, }
{ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }
{ See the License for the specific language governing permissions and }
{ limitations under the License. }
{ }
{***************************************************************************}
unit DPM.IDE.Logger;
interface
uses
ToolsApi,
VSoft.Awaitable,
DPM.Core.Types,
DPM.Core.Logging,
DPM.IDE.MessageService;
type
IDPMIDELogger = interface(ILogger)
['{02CA41D0-F46A-4FB7-A743-DFCFA3E0EAD9}']
procedure ShowMessageTab;
procedure StartRestore(const cancellationTokenSource : ICancellationTokenSource);
procedure EndRestore(const success : boolean);
procedure StartInstall(const cancellationTokenSource : ICancellationTokenSource);
procedure EndInstall(const success : boolean);
procedure StartUnInstall(const cancellationTokenSource : ICancellationTokenSource);
procedure EndUnInstall(const success : boolean);
end;
TDPMIDELogger = class(TInterfacedObject, IDPMIDELogger, ILogger )
private
{$IFDEF DEBUG}
FMessageServices : IOTAMessageServices;
FMessageGroup : IOTAMessageGroup;
{$ENDIF}
FVerbosity : TVerbosity;
FDPMMessageService : IDPMIDEMessageService;
protected
procedure Debug(const data : string);
procedure Error(const data : string);
procedure Information(const data : string; const important : Boolean = False);
procedure Success(const data : string; const important : Boolean = False);
procedure Verbose(const data : string; const important : Boolean = False);
procedure Warning(const data : string; const important : Boolean = False);
procedure NewLine;
function GetVerbosity : TVerbosity;
procedure SetVerbosity(const value : TVerbosity);
procedure Clear;
procedure ShowMessageTab;
procedure StartProject(const fileName : string; const msg : string = '');
procedure EndProject(const fileName : string; const msg : string = '');
procedure StartRestore(const cancellationTokenSource : ICancellationTokenSource);
procedure EndRestore(const success : boolean);
procedure StartInstall(const cancellationTokenSource : ICancellationTokenSource);
procedure EndInstall(const success : boolean);
procedure StartUnInstall(const cancellationTokenSource : ICancellationTokenSource);
procedure EndUnInstall(const success : boolean);
public
constructor Create(const dpmMessageService : IDPMIDEMessageService);
destructor Destroy; override;
end;
implementation
uses
System.SysUtils,
System.Classes;
{ TDPMIDELogger }
procedure TDPMIDELogger.Clear;
begin
{$IFDEF DEBUG}
FMessageServices.ClearMessageGroup(FMessageGroup);
{$ENDIF}
FDPMMessageService.Clear;
end;
constructor TDPMIDELogger.Create(const dpmMessageService : IDPMIDEMessageService);
begin
FDPMMessageService := dpmMessageService;
{$IFDEF DEBUG}
FMessageServices := BorlandIDEServices as IOTAMessageServices;
FMessageGroup := FMessageServices.AddMessageGroup('DPM');
FMessageGroup.CanClose := false;
FMessageGroup.AutoScroll := true;
{$ENDIF}
FVerbosity := TVerbosity.Normal; // we can set this from the options.
end;
procedure TDPMIDELogger.Debug(const data : string);
{$IFDEF DEBUG}
var
lineRef : Pointer;
{$ENDIF}
begin
if (FVerbosity < TVerbosity.Debug) then
exit;
{$IFDEF DEBUG}
FMessageServices.AddToolMessage('', 'DEBUG: ' + data, '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
FDPMMessageService.Debug('DEBUG: ' + data);
end;
destructor TDPMIDELogger.Destroy;
begin
{$IFDEF DEBUG}
FMessageGroup := nil;
FMessageServices := nil;
{$ENDIF}
inherited;
end;
procedure TDPMIDELogger.EndInstall(const success : boolean);
begin
FDPMMessageService.TaskDone(success);
end;
procedure TDPMIDELogger.EndProject(const fileName : string; const msg : string);
{$IFDEF DEBUG}
var
lineRef : Pointer;
{$ENDIF}
begin
{$IFDEF DEBUG}
FMessageServices.AddToolMessage(fileName, 'Done.' + msg, '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
end;
procedure TDPMIDELogger.EndRestore(const success : boolean);
begin
{$IFDEF DEBUG}
FMessageServices.AddTitleMessage('DPM Restore done.', FMessageGroup);
{$ENDIF}
FDPMMessageService.TaskDone(success);
end;
procedure TDPMIDELogger.EndUnInstall(const success : boolean);
begin
{$IFDEF DEBUG}
FMessageServices.AddTitleMessage('DPM Install done.', FMessageGroup);
{$ENDIF}
FDPMMessageService.TaskDone(success);
end;
procedure TDPMIDELogger.Error(const data : string);
{$IFDEF DEBUG}
var
lineRef : Pointer;
{$ENDIF}
begin
{$IFDEF DEBUG}
FMessageServices.AddToolMessage('', 'ERR: ' + data, '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
FDPMMessageService.Error(data);
end;
function TDPMIDELogger.GetVerbosity : TVerbosity;
begin
result := FVerbosity;
end;
procedure TDPMIDELogger.Information(const data : string; const important : Boolean);
{$IFDEF DEBUG}
var
lineRef : Pointer;
{$ENDIF}
begin
if (FVerbosity < TVerbosity.Normal) and (not important) then
exit;
{$IFDEF DEBUG}
FMessageServices.AddToolMessage('', data, '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
FDPMMessageService.Information(data, important);
end;
procedure TDPMIDELogger.NewLine;
{$IFDEF DEBUG}
var
lineRef : Pointer;
{$ENDIF}
begin
{$IFDEF DEBUG}
FMessageServices.AddToolMessage('', ' ', '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
FDPMMessageService.NewLine;
end;
procedure TDPMIDELogger.SetVerbosity(const value : TVerbosity);
begin
FVerbosity := value;
end;
procedure TDPMIDELogger.ShowMessageTab;
begin
{$IFDEF DEBUG}
FMessageServices.ShowMessageView(FMessageGroup);
{$ENDIF}
end;
procedure TDPMIDELogger.StartInstall(const cancellationTokenSource : ICancellationTokenSource);
begin
FDPMMessageService.TaskStarted(cancellationTokenSource, mtInstall);
end;
procedure TDPMIDELogger.StartProject(const fileName : string; const msg : string);
var
lineRef : Pointer;
begin
{$IFDEF DEBUG}
FMessageServices.AddToolMessage(fileName, 'Restoring packages...' + msg, '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
end;
procedure TDPMIDELogger.StartRestore(const cancellationTokenSource : ICancellationTokenSource);
begin
{$IFDEF DEBUG}
FMessageServices.AddTitleMessage('Restoring DPM packages', FMessageGroup);
{$ENDIF}
FDPMMessageService.TaskStarted(cancellationTokenSource, mtRestore);
end;
procedure TDPMIDELogger.StartUnInstall(const cancellationTokenSource : ICancellationTokenSource);
begin
FDPMMessageService.TaskStarted(cancellationTokenSource, mtUninstall);
end;
procedure TDPMIDELogger.Success(const data: string; const important: Boolean);
{$IFDEF DEBUG}
var
lineRef : Pointer;
{$ENDIF}
begin
if (FVerbosity < TVerbosity.Normal) and (not important) then
exit;
{$IFDEF DEBUG}
FMessageServices.AddToolMessage('', data, '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
FDPMMessageService.Success(data, important);
end;
procedure TDPMIDELogger.Verbose(const data : string; const important : Boolean);
{$IFDEF DEBUG}
var
lineRef : Pointer;
{$ENDIF}
begin
if (FVerbosity < TVerbosity.Detailed) then
exit;
{$IFDEF DEBUG}
FMessageServices.AddToolMessage('', data, '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
FDPMMessageService.Verbose(data, important);
end;
procedure TDPMIDELogger.Warning(const data : string; const important : Boolean);
{$IFDEF DEBUG}
var
lineRef : Pointer;
{$ENDIF}
begin
{$IFDEF DEBUG}
FMessageServices.AddToolMessage('', data, '', 0, 0, nil, lineRef, FMessageGroup);
{$ENDIF}
FDPMMessageService.Warning(data, important);
end;
end.
|
unit uICCProfile;
interface
uses
System.Classes,
System.SyncObjs,
System.SysUtils,
Generics.Collections,
Winapi.Windows,
Vcl.Graphics,
Vcl.Imaging.PngImage,
uMemory,
lcms2dll;
const
IS_INPUT = $1;
IS_DISPLAY = $2;
IS_COLORSPACE = $4;
IS_OUTPUT = $8;
IS_ABSTRACT = $10;
DEFAULT_ICC_DISPLAY_PROFILE = 'sRGB IEC61966-2.1';
type
TICCProfileInfo = class(TObject)
FileName: string;
Name: string;
end;
function InSignatures(Signature: cmsProfileClassSignature; dwFlags: DWORD): Boolean;
function ConvertBitmapToDisplayICCProfile(ThreadContext: Pointer; Bitmap: TBitmap; SourceMem: Pointer; MemSize: Cardinal; SourceICCProfileName: string; DisplayProfileName: string = DEFAULT_ICC_DISPLAY_PROFILE): Boolean;
function ConvertPngToDisplayICCProfile(ThreadContext: Pointer; Png: TPngImage; SourceMem: Pointer; MemSize: Cardinal; DestinationICCProfileFile: string = DEFAULT_ICC_DISPLAY_PROFILE): Boolean;
function FillDisplayProfileList(List: TStrings): Boolean;
function GetICCProfileName(ThreadContext: Pointer; SourceMem: Pointer; MemSize: Cardinal): string;
implementation
var
IntentNames: array [0 .. 20] of PAnsiChar;
IntentCodes: array [0 .. 20] of cmsUInt32Number;
InputICCProfileList, OutputICCProfileList: TList<TICCProfileInfo>;
IsICCInitialized: Boolean = False;
IsICCEnabled: Boolean = False;
FSync: TCriticalSection = nil;
function InSignatures(Signature: cmsProfileClassSignature; dwFlags: DWORD): Boolean;
begin
if (((dwFlags and IS_DISPLAY) <> 0) and (Signature = cmsSigDisplayClass)) then
InSignatures := TRUE
else if (((dwFlags and IS_OUTPUT) <> 0) and (Signature = cmsSigOutputClass))
then
InSignatures := TRUE
else if (((dwFlags and IS_INPUT) <> 0) and (Signature = cmsSigInputClass))
then
InSignatures := TRUE
else if (((dwFlags and IS_COLORSPACE) <> 0) and
(Signature = cmsSigColorSpaceClass)) then
InSignatures := TRUE
else if (((dwFlags and IS_ABSTRACT) <> 0) and
(Signature = cmsSigAbstractClass)) then
InSignatures := TRUE
else
InSignatures := FALSE
end;
function GetICCDisplayProfileFileName(ProfileName: string): string;
var
I: Integer;
begin
Result := '';
ProfileName := AnsiLowerCase(ProfileName);
for I := 0 to OutputICCProfileList.Count - 1 do
begin
if AnsiLowerCase(OutputICCProfileList[I].Name) = ProfileName then
Exit(OutputICCProfileList[I].FileName);
end;
end;
procedure FillCCProfileList(var List: TList<TICCProfileInfo>; Signatures: DWORD);
var
Found: Integer;
SearchRec: TSearchRec;
Path, Profile: string;
Dir: array [0 .. 1024] of Char;
hProfile: cmsHPROFILE;
Descrip: array [0 .. 256] of Char;
Info: TICCProfileInfo;
begin
GetSystemDirectory(Dir, 1023);
Path := string(Dir) + '\SPOOL\DRIVERS\COLOR\';
Found := FindFirst(Path + '*.ic?', faAnyFile, SearchRec);
while Found = 0 do
begin
Profile := Path + SearchRec.Name;
hProfile := cmsOpenProfileFromFile(PAnsiChar(AnsiString(Profile)), 'r');
if (hProfile <> nil) then
begin
if ((cmsGetColorSpace(hProfile) = cmsSigRgbData) and InSignatures(cmsGetDeviceClass(hProfile), Signatures)) then
begin
cmsGetProfileInfo(hProfile, cmsInfoDescription, 'EN', 'us', Descrip, 256);
Info := TICCProfileInfo.Create;
Info.FileName := Profile;
Info.Name := Descrip;
List.Add(Info);
end;
cmsCloseProfile(hProfile);
end;
Found := FindNext(SearchRec);
end;
System.SysUtils.FindClose(SearchRec);
end;
function InitICCProfiles: Boolean;
var
SupportedIntents: Integer;
lcmsHandle: THandle;
begin
//should be faster for multithreadng, no enter to critical section
if IsICCInitialized then
Exit(IsICCEnabled);
FSync.Enter;
try
if IsICCInitialized then
Exit(IsICCEnabled);
lcmsHandle := LoadLibrary('lcms2.dll');
if lcmsHandle = 0 then
begin
Exit(False);
end else
FreeLibrary(lcmsHandle);
IsICCEnabled := True;
cmsSetAdaptationState(0);
InputICCProfileList := TList<TICCProfileInfo>.Create;
OutputICCProfileList := TList<TICCProfileInfo>.Create;
FillCCProfileList(InputICCProfileList, IS_INPUT OR IS_COLORSPACE OR IS_DISPLAY);
FillCCProfileList(OutputICCProfileList, $FFFF);
// Get the supported intents
SupportedIntents := cmsGetSupportedIntents(20, @IntentCodes, @IntentNames);
//first IntentCode is used, so it should exists
Result := SupportedIntents > 0;
IsICCInitialized := True;
finally
FSync.Leave;
end;
end;
function ConvertBitmapICCProfile(ThreadContext: Pointer; Bitmap: TBitmap; SourceMem: Pointer; MemSize: Cardinal; SourceICCProfileName, DestinationICCProfileFile: string): Boolean;
var
hSrc, hDest: cmsHPROFILE;
xform: cmsHTRANSFORM;
I, PicW, PicH: Integer;
Intent: Integer;
dwFlags: DWORD;
Line: Pointer;
SourceICCProfileFile: string;
Info: TICCProfileInfo;
begin
Result := False;
SourceICCProfileFile := '';
SourceICCProfileName := AnsiLowerCase(SourceICCProfileName);
for I := 0 to InputICCProfileList.Count - 1 do
begin
Info := InputICCProfileList[I];
if Info.Name = SourceICCProfileName then
SourceICCProfileFile := Info.FileName;
end;
DestinationICCProfileFile := GetICCDisplayProfileFileName(DestinationICCProfileFile);
dwFlags := cmsFLAGS_BLACKPOINTCOMPENSATION;
Intent := IntentCodes[0];
if ((SourceICCProfileFile <> '') or (SourceMem <> nil)) and (DestinationICCProfileFile <> '') then
begin
if SourceMem <> nil then
hSrc := cmsOpenProfileFromMemTHR(ThreadContext, SourceMem, MemSize)
else
hSrc := cmsOpenProfileFromFileTHR(ThreadContext, PAnsiChar(AnsiString(SourceICCProfileFile)), 'r');
hDest := cmsOpenProfileFromFileTHR(ThreadContext, PAnsiChar(AnsiString(DestinationICCProfileFile)), 'r');
xform := nil;
if (hSrc <> nil) and (hDest <> nil) then
xform := cmsCreateTransformTHR(ThreadContext, hSrc, TYPE_BGR_8, hDest, TYPE_BGR_8, Intent, dwFlags);
if hSrc <> nil then
cmsCloseProfile(hSrc);
if hDest <> nil then
cmsCloseProfile(hDest);
if (xform <> nil) then
begin
PicW := Bitmap.Width;
PicH := Bitmap.Height;
for I := 0 to PicH - 1 do
begin
Line := Bitmap.Scanline[I];
cmsDoTransform(xform, Line, Line, PicW);
end;
cmsDeleteTransform(xform);
Result := True;
end;
end
end;
function ConvertPngToDisplayICCProfile(ThreadContext: Pointer; Png: TPngImage; SourceMem: Pointer; MemSize: Cardinal; DestinationICCProfileFile: string = DEFAULT_ICC_DISPLAY_PROFILE): Boolean;
var
hSrc, hDest: cmsHPROFILE;
xform: cmsHTRANSFORM;
I, PicW, PicH: Integer;
Intent: Integer;
dwFlags: DWORD;
Line: Pointer;
begin
Result := False;
if not InitICCProfiles then
Exit;
if (SourceMem = nil) then
Exit;
DestinationICCProfileFile := GetICCDisplayProfileFileName(DestinationICCProfileFile);
dwFlags := cmsFLAGS_BLACKPOINTCOMPENSATION;
Intent := IntentCodes[0];
if (SourceMem <> nil) and (DestinationICCProfileFile <> '') then
begin
hSrc := cmsOpenProfileFromMemTHR(ThreadContext, SourceMem, MemSize);
hDest := cmsOpenProfileFromFileTHR(ThreadContext, PAnsiChar(AnsiString(DestinationICCProfileFile)), 'r');
xform := nil;
if (hSrc <> nil) and (hDest <> nil) then
xform := cmsCreateTransformTHR(ThreadContext, hSrc, TYPE_BGR_8, hDest, TYPE_BGR_8, Intent, dwFlags);
if hSrc <> nil then
cmsCloseProfile(hSrc);
if hDest <> nil then
cmsCloseProfile(hDest);
if (xform <> nil) then
begin
PicW := Png.Width;
PicH := Png.Height;
for I := 0 to PicH - 1 do
begin
Line := Png.Scanline[I];
cmsDoTransform(xform, Line, Line, PicW);
end;
cmsDeleteTransform(xform);
Result := True;
end;
end
end;
function FillDisplayProfileList(List: TStrings): Boolean;
var
ProfileInfo: TICCProfileInfo;
begin
if not InitICCProfiles then
Exit(False);
for ProfileInfo in OutputICCProfileList do
List.Add(ProfileInfo.Name);
Result := True;
end;
function ConvertBitmapToDisplayICCProfile(ThreadContext: Pointer; Bitmap: TBitmap; SourceMem: Pointer; MemSize: Cardinal; SourceICCProfileName: string; DisplayProfileName: string = DEFAULT_ICC_DISPLAY_PROFILE): Boolean;
begin
if DisplayProfileName = '' then
Exit(False);
if (SourceICCProfileName = '') and (SourceMem = nil) then
Exit(False);
if not InitICCProfiles then
Exit(False);
Result := ConvertBitmapICCProfile(ThreadContext, Bitmap, SourceMem, MemSize, SourceICCProfileName, DisplayProfileName);
end;
function GetICCProfileName(ThreadContext: Pointer; SourceMem: Pointer; MemSize: Cardinal): string;
var
hProfile: cmsHPROFILE;
Descrip: array [0 .. 256] of Char;
begin
Result := '';
if not InitICCProfiles then
Exit;
hProfile := cmsOpenProfileFromMemTHR(ThreadContext, SourceMem, MemSize);
if hProfile <> nil then
begin
cmsGetProfileInfo(hProfile, cmsInfoDescription, 'EN', 'us', Descrip, 256);
Result := Descrip;
end;
if hProfile <> nil then
cmsCloseProfile(hProfile);
end;
initialization
FSync := TCriticalSection.Create;
finalization
FreeList(InputICCProfileList);
FreeList(OutputICCProfileList);
F(FSync);
end.
|
unit Shape;
interface
uses Vcl.Graphics, System.Math.Vectors, Ray, Material, Nullable, Intersection,
System.Math, Generics.Collections, SysUtils;
type
TBounds = record
PMin, PMax: TVector;
constructor Create(const PMin, PMax: TVector);
end;
type
EShape = (Sphr, Plne, Tria, Aabb, ObjB);
TShape = record
public
Kind: EShape;
PIdx: Cardinal;
Mtrl: TMaterial;
Shps: TArray<Cardinal>; // Used for AAABBs
Case EShape of
Sphr: (rad, radSqr: Single);
Plne: (PNrm: TVector);
Tria: (TNrm: TVector; Pdx2, Pdx3: Cardinal);
Aabb: (PMax: Cardinal);
end;
type
TShapes = array of TShape;
type
Aabb2 = record
public
PMin, PMax: TVector;
Shps: TShapes;
end;
type
TStore = class
public
VPos: TArray<TVector>;
VNrm: TArray<TVector>;
VTxt: TArray<TVector>;
Shps: TArray<TShape>;
Mtls: TArray<TMaterial>;
end;
type
TDynStore = class
public
VPos: TList<TVector>;
VNrm: TList<TVector>;
VTxt: TList<TVector>;
Shps: TList<TShape>;
Mtls: TList<TMaterial>;
function ToFixStore(): TStore;
constructor Create;
end;
function SphrCreate(PIdx: Cardinal; rad: Single; Mtrl: TMaterial): TShape;
function PlneCreate(PIdx: Cardinal; norm: TVector; Mtrl: TMaterial): TShape;
function TriaCreate(Pdx1, Pdx2, Pdx3: Cardinal; Nrml: TVector; Mtrl: TMaterial): TShape;
function AabbCreate(Pdx1, Pdx2: Cardinal; Shps: TArray<Cardinal>): TShape;
/// <summary>Find the intersection with a ray</summary>
/// <param name="Ray">The ray to intesrsect with</param>
/// <returns>A non-null point after intersection</returns>
function Intersect(const Stre: TStore; const Shpe: TShape; const Ray: TRay;
const Dist: Single): TNullable<TIntersection>;
/// <summary>Calculate the bounds of this shape</summary>
/// <returns>The object bounds</returns>
// TODO: Only return PMAX, we do not need PMin for splitting the bounds
function Bound(const Stre: TDynStore; const Shpe: TShape): TBounds;
implementation
{ TDynStore }
constructor TDynStore.Create;
begin
VPos := TList<TVector>.Create;
VNrm := TList<TVector>.Create;
VTxt := TList<TVector>.Create;
Shps := TList<TShape>.Create;
Mtls := TList<TMaterial>.Create;
end;
function TDynStore.ToFixStore: TStore;
begin
Result := TStore.Create;
Result.VPos := VPos.ToArray;
Result.VNrm := VNrm.ToArray;
Result.VTxt := VTxt.ToArray;
Result.Shps := Shps.ToArray;
Result.Mtls := Mtls.ToArray;
end;
{ TShpere }
function SphrCreate(PIdx: Cardinal; rad: Single; Mtrl: TMaterial): TShape;
begin
Result.Kind := EShape.Sphr;
Result.PIdx := PIdx;
Result.Mtrl := Mtrl;
Result.rad := rad;
Result.radSqr := rad * rad;
end;
function SphrBound(const Stre: TDynStore; const Shpe: TShape): TBounds;
begin
// Todo: calculate pointer instead of [] again and again?
Result := TBounds.Create(
Stre.VPos[Shpe.PIdx] - TVector.Create(Shpe.rad, Shpe.rad, Shpe.rad),
Stre.VPos[Shpe.PIdx] + TVector.Create(Shpe.rad, Shpe.rad, Shpe.rad));
end;
function SphrIntersect(const Stre: TStore; const Shpe: TShape; const Ray: TRay;
const Dist: Single): TNullable<TIntersection>;
var
v: TVector;
b, det, d: Single;
begin
Result := Default (TNullable<TIntersection>);
v := Ray.org - Stre.VPos[Shpe.PIdx];
b := -(v.DotProduct(Ray.dir));
det := (b * b) - v.DotProduct(v) + Shpe.radSqr;
// Sphere was not hit
if det <= 0 then
Exit;
det := Sqrt(det);
// Sphere was not hit
d := b - det;
if d > Dist then
Exit;
if b + det <= 0 then
Exit;
Result.Value := TIntersection.Create();
Result.Value.d := b - det;
Result.Value.mat := Shpe.Mtrl;
Result.Value.point := Ray.org + Result.Value.d * Ray.dir;
Result.Value.normal := (Result.Value.point - Stre.VPos[Shpe.PIdx]).Normalize;
end;
{ TPlane }
function PlneCreate(PIdx: Cardinal; norm: TVector; Mtrl: TMaterial): TShape;
begin
Result.kind := EShape.Plne;
Result.Mtrl := Mtrl;
Result.PIdx := PIdx;
Result.pnrm := norm.Normalize;
end;
function PlneBound(const Stre: TDynStore; const shpe: TShape): TBounds;
begin
raise Exception.Create('A plane does not have a finite bounding box');
end;
function PlneIntersect(const Stre: TStore; const Shpe: TShape; const Ray: TRay;
const Dist: Single): TNullable<TIntersection>;
var
cosi, d: Single;
begin
Result := Default (TNullable<TIntersection>);
cosi := Ray.dir.DotProduct(Shpe.pnrm);
if (cosi = 0) then Exit;
d := (Stre.VPos[Shpe.PIdx] - Ray.org).DotProduct(Shpe.pnrm) / cosi;
if (d > dist) or (d < 0) then
Exit;
Result.Value := TIntersection.Create();
Result.Value.d := d;
Result.Value.mat := Shpe.Mtrl;
Result.Value.point := Ray.org + d * Ray.dir;
Result.Value.normal := Shpe.pnrm * -Sign(cosi);;
end;
{ TTraingle }
function TriaCreate(Pdx1, Pdx2, Pdx3: Cardinal; Nrml: TVector; Mtrl: TMaterial): TShape;
begin
Result.kind := EShape.Tria;
Result.PIdx := Pdx1;
Result.Pdx2 := Pdx2;
Result.Pdx3 := Pdx3;
Result.Mtrl := Mtrl;
Result.TNrm := Nrml.Normalize;
end;
function TriaBound(const Stre: TDynStore; const Sphe: TShape): TBounds;
var pos1, pos2, pos3: TVector;
begin
pos1 := Stre.VPos[Sphe.PIdx];
pos2 := Stre.VPos[Sphe.Pdx2];
pos3 := Stre.VPos[Sphe.Pdx3];
Result := TBounds.Create(
TVector.Create(
Min(pos1.X, Min(pos2.X, pos3.X)),
Min(pos1.Y, Min(pos2.Y, pos3.Y)),
Min(pos1.W, Min(pos2.W, pos3.W))
),
TVector.Create(
Max(pos1.X, Max(pos2.X, pos3.X)),
Max(pos1.Y, Max(pos2.Y, pos3.Y)),
Max(pos1.W, Max(pos2.W, pos3.W))
)
);
end;
function TriaIntersect(const Stre: TStore; const Shpe: TShape; const Ray: TRay;
const Dist: Single): TNullable<TIntersection>;
var
pHit: TVector;
cosi, d, u, v, w: Single;
pos1, pos2, pos3: TVector;
begin
Result := Default (TNullable<TIntersection>);
pos1 := Stre.VPos[Shpe.PIdx];
pos2 := Stre.VPos[Shpe.Pdx2];
pos3 := Stre.VPos[Shpe.Pdx3];
cosi := Ray.dir.DotProduct(Shpe.tnrm);
// Parralel to the plane
if (cosi = 0) then Exit;
d := (pos1 - Ray.org).DotProduct(Shpe.tnrm) / cosi;
// Dit not hit plane traingle lies in
if (d > Dist) or (d < 0) then Exit;
pHit := Ray.org + d * Ray.dir;
w := Shpe.tnrm.DotProduct((pos2 - pos1).CrossProduct(pHit - pos1));
if (w <= 0) then
Exit;
u := Shpe.tnrm.DotProduct((pos3 - pos2).CrossProduct(pHit - pos2));
if (u <= 0) then
Exit;
v := Shpe.tnrm.DotProduct((pos1 - pos3).CrossProduct(pHit - pos3));
if (v <= 0) then
Exit;
Result.Value := TIntersection.Create();
Result.Value.d := d;
Result.Value.mat := Shpe.Mtrl;
Result.Value.point := Ray.org + d * Ray.dir;
Result.Value.normal := -Sign(cosi) * Shpe.tnrm;
end;
{ TAabb }
function AabbCreate(Pdx1, Pdx2: Cardinal; Shps: TArray<Cardinal>): TShape;
begin
Result.Kind := EShape.Aabb;
Result.PIdx := Pdx1;
Result.PMax := Pdx2;
Result.Shps := Shps;
end;
function AabbBound(const Stre: TDynStore; const Shpe: TShape): TBounds;
begin
Result := TBounds.Create(Stre.VPos[Shpe.PIdx], Stre.VPos[Shpe.PMax]);
end;
function AabbIntersect(const Stre: TStore; const Shpe: TShape; const Ray: TRay;
const Dist: Single): TNullable<TIntersection>;
var
PMin, PMax: TVector;
VMin, VMax: Single;
TMin, TMax: Single;
d: Single;
intsct: TNullable<TIntersection>;
indx: Cardinal;
begin
Result := Default (TNullable<TIntersection>);
PMin := Stre.VPos[Shpe.PIdx];
PMax := Stre.VPos[Shpe.PMax];
VMin := (PMin.X - Ray.org.X) * Ray.invDir.X;
VMax := (PMax.X - Ray.org.X) * Ray.invDir.X;
TMin := Min(VMin, VMax);
TMax := Max(VMin, VMax);
VMin := (PMin.Y - Ray.org.Y) * Ray.invDir.Y;
VMax := (PMax.Y - Ray.org.Y) * Ray.invDir.Y;
TMin := Max(TMin, Min(VMin, VMax));
TMax := Min(TMax, Max(VMin, VMax));
VMin := (PMin.W - Ray.org.W) * Ray.invDir.W;
VMax := (PMax.W - Ray.org.W) * Ray.invDir.W;
TMin := Max(TMin, Min(VMin, VMax));
TMax := Min(TMax, Max(VMin, VMax));
if (TMax < TMin) or (TMax < 0) or (TMin > Dist) then
Exit;
d := Dist;
indx := 0;
while indx < Length(Shpe.Shps) do
begin
intsct := Intersect(Stre, Stre.Shps[Shpe.Shps[indx]], Ray, d);
if intsct.HasValue and (intsct.Value.d < d) then
begin
d := intsct.Value.d;
Result := intsct;
end;
indx := indx + 1;
end;
end;
{ TBounds }
constructor TBounds.Create(const PMin, PMax: TVector);
begin
Self.PMin := PMin;
Self.PMax := PMax;
end;
{ TShape }
function Bound(const Stre: TDynStore; const Shpe: TShape): TBounds;
begin
case Shpe.Kind of
Sphr: Result := SphrBound(Stre, Shpe);
Plne: Result := PlneBound(Stre, Shpe);
Tria: Result := TriaBound(Stre, Shpe);
Aabb: Result := AabbBound(Stre, Shpe);
end;
end;
function Intersect(const Stre: TStore; const Shpe: TShape; const Ray: TRay;
const Dist: Single): TNullable<TIntersection>;
begin
case Shpe.Kind of
Sphr: Result := SphrIntersect(Stre, Shpe, Ray, Dist);
Plne: Result := PlneIntersect(Stre, Shpe, Ray, Dist);
Tria: Result := TriaIntersect(Stre, Shpe, Ray, Dist);
Aabb: Result := AabbIntersect(Stre, Shpe, Ray, Dist);
end;
end;
end.
|
unit MVVM.Messages.Engine.Scheduler;
interface
uses
System.Classes,
System.SyncObjs,
System.Generics.Defaults,
Spring.Collections,
MVVM.Patched.ThreadedQueue,
MVVM.Messages.Engine.Interfaces;
type
TMessagesScheduler = class sealed(TThread)
const
CTE_INITIAL_QUEUE_SIZE = 10;
CTE_PUSH_TIMEOUT = 100;
private
FIndex : Int64;
FSC : TCriticalSection;
FTaskQueue : TThreadedQueue<ISchedulerTask>;
FTaskList : IList<ISchedulerTask>;
FComparer : IComparer<ISchedulerTask>;
FTaskListToRemove: IList<ISchedulerTask>;
procedure Execute; override;
function Checks: Boolean;
procedure RecalcScheduling;
function GetIndex: Int64;
procedure DoScheduling;
function GetNewTask(out AQueueSize: Integer; out ATask: ISchedulerTask): TWaitResult; overload;
function GetNewTask(out AQueueSize: Integer; out ATask: ISchedulerTask; const ATimeOut: Cardinal): TWaitResult; overload;
public
constructor Create;
destructor Destroy; override;
procedure ScheduleMessage(AMessage: IMessage; const AWhenPassedNextMilliseconds: Int64); overload;
procedure ScheduleMessage(AMessage: IMessage; const AWhenPassedNextDateTime: TDateTime); overload;
end;
implementation
uses
System.SysUtils,
System.DateUtils,
MVVM.Utils,
MVVM.Core,
MVVM.Interfaces;
type
TSchedulerTask = class sealed(TInterfacedObject, ISchedulerTask)
private
FTaskID : Int64;
FTimeStampCreation : Int64;
FTimeStampAwake : Int64;
FMilisecondsToAwake : Int64;
FIsDone : Boolean;
FMessage : IMessage;
function GetTaskID: Int64;
function GetMilisecondsToAwake: Int64;
procedure CalculateAwakeTime;
procedure Notify;
public
constructor Create(const ATaskID: Int64; const AEllapsedMilisecondsToExecute: Int64; AMessage: IMessage); overload;
destructor Destroy; override;
function IsDone: Boolean;
function CheckAndNotify: Boolean;
property TaskID: Int64 read GetTaskID;
property MilisecondsToAwake: Int64 read GetMilisecondsToAwake;
end;
{ TMessagesScheduler }
function TMessagesScheduler.Checks: Boolean;
var
LTask: ISchedulerTask;
begin
Result := False;
if FTaskList.Count <> 0 then
begin
FTaskListToRemove.Clear;
for LTask in FTaskList do
begin
if LTask.CheckAndNotify then
begin
Result := True;
end;
if LTask.IsDone then
begin
Result := True;
FTaskListToRemove.Add(LTask);
end;
end;
for LTask in FTaskListToRemove do
begin
FTaskList.Remove(LTask);
end;
FTaskListToRemove.Clear;
if (Result) then
begin
if FTaskList.Count = 0 then
begin
Result := False;
end
end;
end;
end;
constructor TMessagesScheduler.Create;
begin
inherited Create(False);
FSC := TCriticalSection.Create;
FIndex := 0;
FTaskQueue := TThreadedQueue<ISchedulerTask>.Create(CTE_INITIAL_QUEUE_SIZE, CTE_PUSH_TIMEOUT, INFINITE);
FTaskList := TCollections.CreateList<ISchedulerTask>;
FTaskListToRemove := TCollections.CreateList<ISchedulerTask>;
FComparer := TComparerSchedulerTask.Create;
end;
destructor TMessagesScheduler.Destroy;
begin
Terminate;
FTaskQueue.DoShutDown;
WaitFor;
FComparer := nil;
FTaskList := nil;
FTaskListToRemove := nil;
FTaskQueue.Destroy;
FSC.Destroy;
inherited;
end;
procedure TMessagesScheduler.Execute;
begin
DoScheduling;
end;
function TMessagesScheduler.GetIndex: Int64;
begin
FSC.Enter;
try
Inc(FIndex);
Result := FIndex;
finally
FSC.Leave;
end;
end;
function TMessagesScheduler.GetNewTask(out AQueueSize: Integer; out ATask: ISchedulerTask): TWaitResult;
begin
Result := FTaskQueue.PopItem(AQueueSize, ATask);
end;
function TMessagesScheduler.GetNewTask(out AQueueSize: Integer; out ATask: ISchedulerTask; const ATimeOut: Cardinal): TWaitResult;
begin
Result := FTaskQueue.PopItem(AQueueSize, ATask, ATimeOut);
end;
procedure TMessagesScheduler.DoScheduling;
var
LTarea : ISchedulerTask;
LNoTarea : Int64;
LTimeToSleep : Int64;
LWaitingTask : ISchedulerTask;
LRes : TWaitResult;
LSize : Integer;
LRecalcChecks : Boolean;
begin
LRecalcChecks := False;
while not(Terminated) do
begin
repeat
case FTaskList.Count of
0:
begin
LRes := GetNewTask(LSize, LTarea);
end
else
begin
LWaitingTask := FTaskList[0];
LTimeToSleep := LWaitingTask.MiliSecondsToAwake;
LWaitingTask := nil;
if LTimeToSleep <= 0 then
begin
if Checks then
begin
RecalcScheduling;
end;
Continue;
end
else begin
LRecalcChecks := True;
LRes := GetNewTask(LSize, LTarea, LTimeToSleep);
end;
end;
end;
case LRes of
wrSignaled:
begin
if (not Terminated) then
begin
FTaskList.Add(LTarea);
RecalcScheduling;
LRecalcChecks := True;
LTarea := nil;
end
else
begin
Exit;
end;
end;
wrAbandoned:
begin
Exit;
end;
end;
until (LSize = 0) or (LRes = TWaitResult.wrTimeout);
if LRecalcChecks then
begin
if Checks then
begin
RecalcScheduling;
end;
LRecalcChecks := False;
end;
end;
end;
procedure TMessagesScheduler.RecalcScheduling;
var
LComparison: TComparison<ISchedulerTask>;
begin
if (FTaskList.Count > 1) then
begin
FTaskList.Sort(FComparer);
end;
end;
procedure TMessagesScheduler.ScheduleMessage(AMessage: IMessage; const AWhenPassedNextDateTime: TDateTime);
var
LPassedMiliseconds: Int64;
begin
LPassedMiliseconds := MilliSecondsBetween(Now, AWhenPassedNextDateTime);
if (LPassedMiliseconds <= 0) then
AMessage.Post
else ScheduleMessage(AMessage, LPassedMiliseconds);
end;
procedure TMessagesScheduler.ScheduleMessage(AMessage: IMessage; const AWhenPassedNextMilliseconds: Int64);
var
LTask: ISchedulerTask;
LSize: Integer;
LRes : TWaitResult;
begin
LTask := TSchedulerTask.Create(GetIndex, AWhenPassedNextMilliseconds, AMessage);
repeat
LRes := FTaskQueue.PushItem(LTask, LSize);
case LRes of
wrTimeout:
begin
FTaskQueue.Grow(LSize);
if Terminated then Exit;
end;
end;
until LRes = TWaitResult.wrSignaled;
end;
{ TSchedulerTask }
procedure TSchedulerTask.CalculateAwakeTime;
begin
FTimeStampAwake := FTimeStampCreation + FMilisecondsToAwake;
end;
function TSchedulerTask.CheckAndNotify: Boolean;
var
LElapsed: Int64;
begin
Result := False;
if not(FIsDone) then
begin
LElapsed := MVVMCore.PlatformServices.ElapsedMiliseconds;
FIsDone := (LElapsed >= FTimeStampAwake);
Result := FIsDone;
if FIsDone then
Notify;
end;
end;
constructor TSchedulerTask.Create(const ATaskID: Int64; const AEllapsedMilisecondsToExecute: Int64; AMessage: IMessage);
begin
inherited Create;
FTaskID := ATaskID;
FTimeStampCreation := MVVMCore.PlatformServices.ElapsedMiliseconds;
FMilisecondsToAwake := AEllapsedMilisecondsToExecute;
FMessage := AMessage;
FIsDone := False;
CalculateAwakeTime;
end;
destructor TSchedulerTask.Destroy;
begin
FMessage := nil;
inherited;
end;
function TSchedulerTask.GetTaskID: Int64;
begin
Result := FTaskID;
end;
function TSchedulerTask.GetMilisecondsToAwake: Int64;
begin
FMilisecondsToAwake := FTimeStampAwake - MVVMCore.PlatformServices.ElapsedMiliseconds;
Result := FMilisecondsToAwake;
end;
function TSchedulerTask.IsDone: Boolean;
begin
Result := FIsDone
end;
procedure TSchedulerTask.Notify;
begin
FMessage.Post;
end;
end.
|
// Inertial navigation system error estimator demo
{$APPTYPE CONSOLE}
program INSErr;
uses Kalman;
const
g = 9.81;
Re = 6378e3;
dt = 0.1;
A = 100.0;
beta = 1e-4;
deg = pi / 180;
hr = 3600;
tstop = 2 * hr;
type
TModel = record
dV, Phi, omega, z: Real;
end;
function GaussRnd(m, sigma: Real): Real;
var
s: Real;
i: SmallInt;
begin
s := 0;
for i := 1 to 12 do
s := s + Random;
Result := m + sigma * (s - 6);
end;
procedure InitModel(var M: TModel);
begin
M.dV := 0;
M.Phi := GaussRnd(0, 0.1 * deg);
M.omega := GaussRnd(0, 0.5 * deg / hr);
end;
procedure ExecuteModel(var M: TModel);
var
dVdot, Phidot, omegadot: Real;
begin
dVdot := -g * M.Phi;
Phidot := M.dV / Re + M.omega;
omegadot := -beta * M.omega + A * sqrt(2 * beta) * GaussRnd(0, 0.0000001);
M.dV := M.dV + dVdot * dt;
M.Phi := M.Phi + Phidot * dt;
M.omega := M.omega + omegadot * dt;
M.z := M.dV + GaussRnd(0, 3.0);
end;
procedure InitSchulerKF(var KF: TKalmanFilter; Q, R: Real);
begin
{
The following INS error model is used:
Velocity error: dV' = -g * F
Attitude error: Phi' = dV / R + omega
Gyro bias : omega' = -beta * omega + A * sqrt(2 * beta) * w
Measurements : z = dV + v
}
KF.n := 3; KF.m := 1; KF.s := 1;
KF.Phi[1, 1] := 1; KF.Phi[1, 2] := -g * dt; KF.Phi[1, 3] := 0;
KF.Phi[2, 1] := dt / Re; KF.Phi[2, 2] := 1; KF.Phi[2, 3] := dt;
KF.Phi[3, 1] := 0; KF.Phi[3, 2] := 0; KF.Phi[3, 3] := 1 - beta * dt;
KF.H[1, 1] := 1; KF.H[1, 2] := 0; KF.H[1, 3] := 0;
KF.G[1, 1] := 0;
KF.G[2, 1] := 0;
KF.G[3, 1] := A * sqrt(2 * beta) * dt;
KF.Q[1, 1] := Q;
KF.R[1, 1] := R;
KF.x[1, 1] := 0; KF.x[2, 1] := 0; KF.x[3, 1] := 0;
KF.P[1, 1] := 1; KF.P[1, 2] := 0; KF.P[1, 3] := 0;
KF.P[2, 1] := 0; KF.P[2, 2] := 1; KF.P[2, 3] := 0;
KF.P[3, 1] := 0; KF.P[3, 2] := 0; KF.P[3, 3] := 1;
end;
var
Model: TModel;
Filter: TKalmanFilter;
i: Integer;
begin
Randomize;
InitModel(Model);
InitSchulerKF(Filter, 1e-10, 1e6);
for i := 0 to Round(tstop / dt) do
begin
ExecuteModel(Model);
Filter.z[1, 1] := Model.z;
ExecuteFilter(Filter);
if i mod 10 = 0 then
WriteLn( 't ', i * dt: 6: 1,
' dVel ', Model.dV: 6: 1, Filter.x[1, 1]: 6: 1,
' dAtt ', Model.Phi / deg: 6: 2, Filter.x[2, 1] / deg: 6: 2,
' Bias ', Model.omega / (deg / hr): 6: 2, Filter.x[3, 1] / (deg / hr): 6: 2);
end; // for
WriteLn('Done.');
ReadLn;
end.
|
unit uFrmEstimatedItemNew;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, PaideTodosGeral, siComp, siLangRT, StdCtrls, Buttons, ExtCtrls,
Mask, SuperComboADO, uFrmBarcodeSearch, uSystemTypes, DB, ADODB,
PowerADOQuery, uFrmEstimated, LblEffct, SuperEdit, SuperEditCurrency,
cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxSpinEdit;
type
TFrmEstimatedItemNew = class(TFrmParentAll)
btOK: TButton;
Label1: TLabel;
cmbModel: TSuperComboADO;
Label2: TLabel;
btnSearchDesc: TBitBtn;
lbSalePrice: TLabel;
quEstimetedItems: TPowerADOQuery;
quEstimetedItemsIDEstimatedItem: TIntegerField;
quEstimetedItemsIDModel: TIntegerField;
quEstimetedItemsModel: TStringField;
quEstimetedItemsDescription: TStringField;
quEstimetedItemsGrandTotal: TCurrencyField;
quEstimetedItemsEstSalePrice: TBCDField;
quEstimetedItemsSellingPrice: TBCDField;
quEstimetedItemsSalePrice: TCurrencyField;
quEstimetedItemsQty: TFloatField;
Panel2: TPanel;
Image3: TImage;
Image1: TImage;
imgTopIni: TImage;
lblSubMenu: TLabelEffect;
lblMenu: TLabel;
Panel4: TPanel;
EEE: TPanel;
pnlAutoInc: TPanel;
Image2: TImage;
btLoopInc: TSpeedButton;
lblModified: TLabel;
edtSalePrice: TSuperEditCurrency;
imgMenu: TImage;
edtQty: TcxSpinEdit;
quEstimetedItemsIDDepartment: TIntegerField;
lblDepartment: TLabel;
scDepartment: TSuperComboADO;
btLoopDepartment: TSpeedButton;
pnlCostPrice: TPanel;
lblCost: TLabel;
btShowCost: TSpeedButton;
editCostPrice: TEdit;
quPrice: TADODataSet;
quPriceSellingPrice: TBCDField;
quPriceFinalCost: TBCDField;
procedure btOKClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnSearchDescClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure edtSalePriceKeyPress(Sender: TObject; var Key: Char);
procedure cmbModelSelectItem(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure edtSalePriceEnter(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btShowCostClick(Sender: TObject);
private
FFrmCommand: TBtnCommandType;
FFrmBarcodeSearch: TFrmBarcodeSearch;
FIDEstimated: Integer;
FIDEstimatedItem: Integer;
fModelCaseQty: Double;
procedure InsertEstimatedItem;
procedure UpdateEstimatedItem;
procedure LoadEstimatedItem;
procedure RefreshPrice(bSale, bCost : Boolean);
procedure LimpaCampos;
procedure RefreshDepartment;
function ValidateItem: Boolean;
public
function Start(AFrmCommand: TBtnCommandType; AIDEstimated, AIDEstimatedItem: Integer): Boolean;
end;
implementation
uses uDM, uSystemConst, uMsgBox, uMsgConstant, uCharFunctions,
uNumericFunctions, StrUtils, uPassword;
{$R *.dfm}
{ TFrmEstimatedItemNew }
procedure TFrmEstimatedItemNew.InsertEstimatedItem;
var
iIDEstimatedItem: Integer;
cSalePrice: Currency;
begin
cSalePrice := MyStrToMoney(edtSalePrice.Text);
if cSalePrice = 0 then
cSalePrice := MyStrToMoney(DM.DescCodigo(['IDModel'], [cmbModel.LookUpValue], 'Model', 'SellingPrice'));
iIDEstimatedItem := DM.GetNextID(MR_INV_ESTIMATED_ITEM_ID);
with DM.quFreeSQL do
begin
if Active then
Close;
SQL.Clear;
SQL.Add('INSERT INTO EstimatedItem (IDEstimatedItem, IDEstimated, Code, IDModel, Qty, SalePrice, IDDepartment)');
SQL.Add('(SELECT ' + IntToStr(iIDEstimatedItem) + ',' + IntToStr(FIDEstimated) + ', IsNull(MAX(Code), 0) + 1, ' + cmbModel.LookUpValue + ',');
SQL.Add(StringReplace(edtQty.Text, ',', '.', [rfReplaceAll]) + ', ' + MyFormatCur(cSalePrice, '.') + ', ' + IfThen(scDepartment.LookUpValue <> '', scDepartment.LookUpValue, '0'));
SQL.Add(' FROM EstimatedItem WHERE IDEstimated = ' + IntToStr(FIDEstimated) + ')');
ExecSQL;
end;
end;
procedure TFrmEstimatedItemNew.UpdateEstimatedItem;
var
iIDEstimatedItem: Integer;
cSalePrice: Currency;
begin
cSalePrice := MyStrToMoney(edtSalePrice.Text);
if cSalePrice = 0 then
cSalePrice := MyStrToMoney(DM.DescCodigo(['IDModel'], [cmbModel.LookUpValue], 'Model', 'SellingPrice'));
with DM.quFreeSQL do
begin
if Active then
Close;
SQL.Clear;
SQL.Add('UPDATE EstimatedItem SET ');
SQL.Add('IDModel = ' + cmbModel.LookUpValue);
SQL.Add(', Qty = ' + StringReplace(edtQty.Text, ',', '.', [rfReplaceAll]));
SQL.Add(', SalePrice = ' + MyFormatCur(cSalePrice, '.'));
SQL.Add(', IDDepartment = ' + IfThen(scDepartment.LookUpValue <> '', scDepartment.LookUpValue, '0'));
SQL.Add('WHERE IDEstimatedItem = ' + IntToStr(FIDEstimatedItem));
ExecSQL;
end;
end;
function TFrmEstimatedItemNew.Start(AFrmCommand: TBtnCommandType;
AIDEstimated, AIDEstimatedItem: Integer): Boolean;
begin
FIDEstimated := AIDEstimated;
FIDEstimatedItem := AIDEstimatedItem;
FFrmCommand := AFrmCommand;
if FFrmCommand = btAlt then
begin
LoadEstimatedItem;
btLoopInc.Down := False;
btLoopInc.Visible := False;
lblModified.Visible := False;
end;
ShowModal;
Result := (ModalResult = mrOK);
end;
function TFrmEstimatedItemNew.ValidateItem: Boolean;
begin
Result := False;
if cmbModel.LookUpValue = '' then
begin
MsgBox(MSG_EXC_SELECT_A_MODEL, vbCritical + vbOkOnly);
Exit;
end;
if (StrToFloatDef(edtQty.Text, 0) = 0) then
begin
MsgBox(MSG_CRT_QTY_NO_ZERO, vbCritical + vbOkOnly);
Exit;
end;
if (scDepartment.LookUpValue = '') and scDepartment.Visible then
begin
scDepartment.SetFocus;
MsgBox(MSG_INF_SELECT_DEPARTMENT , vbOKOnly + vbInformation);
Exit;
end;
if fModelCaseQty > 0 then
if DM.fSystem.SrvParam[PARAM_VALIDATE_CASE_QTY_ON_HOLD] then
if Frac(StrToFloat(edtQty.Text) / fModelCaseQty) <> 0 then
begin
MsgBox(MSG_INF_QTY_NOT_DIF_MULT_CASE, vbCritical + vbOKOnly);
Result := False;
Exit;
end;
Result := True;
end;
procedure TFrmEstimatedItemNew.btOKClick(Sender: TObject);
begin
if not ValidateItem then
begin
ModalResult := mrNone;
Exit;
end;
if FFrmCommand = btInc then
InsertEstimatedItem
else if FFrmCommand = btAlt then
UpdateEstimatedItem;
inherited;
if btLoopInc.Down then
begin
ModalResult := mrNone;
TFrmEstimated(Owner).RefreshEstimatedItem;
LimpaCampos;
end;
cmbModel.SetFocus;
end;
procedure TFrmEstimatedItemNew.FormCreate(Sender: TObject);
begin
inherited;
DM.imgSmall.GetBitmap(BTN18_SEARCH, btnSearchDesc.Glyph);
DM.imgSmall.GetBitmap(BTN18_LAMP, btShowCost.Glyph);
FFrmBarcodeSearch := TFrmBarcodeSearch.Create(Self);
end;
procedure TFrmEstimatedItemNew.btnSearchDescClick(Sender: TObject);
var
R: integer;
begin
inherited;
with FFrmBarcodeSearch do
begin
R := Start(MOV_TYPE_SALE);
if R <> -1 then
begin
cmbModel.LookUpValue := IntToStr(R);
if cmbModel.LookUpValue <> '' then
cmbModelSelectItem(Sender);
end;
end;
end;
procedure TFrmEstimatedItemNew.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
inherited;
if Key = VK_F2 then
btnSearchDesc.Click;
end;
procedure TFrmEstimatedItemNew.edtSalePriceKeyPress(Sender: TObject;
var Key: Char);
begin
inherited;
Key := ValidatePositiveCurrency(Key);
end;
procedure TFrmEstimatedItemNew.cmbModelSelectItem(Sender: TObject);
begin
inherited;
RefreshPrice(True, True);
RefreshDepartment;
fModelCaseQty := StrToFloatDef(VarToStr(cmbModel.GetFieldByName('CaseQty')),0);
edtQty.SetFocus;
end;
procedure TFrmEstimatedItemNew.RefreshPrice(bSale, bCost : Boolean);
begin
if cmbModel.LookUpValue <> '' then
try
quPrice.Parameters.ParamByName('IDModel').Value := cmbModel.LookUpValue;
quPrice.Open;
if bSale then
edtSalePrice.Text := FormatFloat('#0.00', quPriceSellingPrice.AsCurrency);
if bCost then
EditCostPrice.Text := FormatFloat('#0.00', quPriceFinalCost.AsCurrency);
finally
quPrice.Close;
end;
end;
procedure TFrmEstimatedItemNew.FormDestroy(Sender: TObject);
begin
inherited;
FreeAndNil(FFrmBarcodeSearch);
end;
procedure TFrmEstimatedItemNew.LoadEstimatedItem;
begin
with quEstimetedItems do
begin
Parameters.ParamByName('IDEstimatedItem').Value := FIDEstimatedItem;
Open;
cmbModel.LookUpValue := FieldByName('IDModel').Value;
edtQty.Text := FieldByName('Qty').Value;
edtSalePrice.Text := FormatFloat('#0.00', FieldByName('EstSalePrice').AsCurrency);
RefreshPrice(False, True);
end;
end;
procedure TFrmEstimatedItemNew.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
quEstimetedItems.Close;
end;
procedure TFrmEstimatedItemNew.LimpaCampos;
var
i: integer;
begin
for i := 0 to ComponentCount -1 do
if Components[i] is TEdit then
TEdit(Components[i]).Clear;
cmbModel.LookUpValue := '';
if btLoopDepartment.Visible and (not btLoopDepartment.Down) then
scDepartment.LookUpValue := '';
end;
procedure TFrmEstimatedItemNew.edtSalePriceEnter(Sender: TObject);
begin
inherited;
edtSalePrice.SelectAll;
end;
procedure TFrmEstimatedItemNew.FormShow(Sender: TObject);
begin
inherited;
DM.imgSubMenu.GetBitmap(DM.fMainMenu.Image, imgMenu.Picture.Bitmap);
lblSubMenu.Caption := Self.Caption;
// Controla o aparecimento, e o readonly do prešo de custo
if Password.HasFuncRight(36) then
pnlCostPrice.Visible := True
else
pnlCostPrice.Visible := Password.HasFuncRight(11); // fica somente pelo show
end;
procedure TFrmEstimatedItemNew.RefreshDepartment;
var
FilterValue: String;
DepartmentCount: Integer;
begin
with DM.quFreeSQL do
begin
if Active then
Close;
SQL.Clear;
SQL.Text := ' SELECT IDDepartment FROM Inv_ModelDepartment ' +
' WHERE ModelID = ' + cmbModel.LookUpValue + ' AND StoreID = ' + InttoStr(DM.fStore.IDStoreSale);
Open;
DepartmentCount := DM.quFreeSQL.RecordCount;
if IsEmpty then
begin
if Active then
Close;
SQL.Clear;
SQL.Text := ' SELECT T.IDDepartment FROM Model M JOIN TabGroup T ON (T.IDGroup = M.GroupID) ' +
' WHERE M.IDModel = ' + cmbModel.LookUpValue;
Open;
DepartmentCount := 1;
end;
if not(IsEmpty) then
begin
{
First;
while not EOF do
begin
if FilterValue = '' then
FilterValue := 'IDDepartment = ' + FieldByName('IDDepartment').AsString
else
FilterValue := FilterValue + ' or ' + 'IDDepartment = ' + FieldByName('IDDepartment').AsString;
Next;
end;
}
if DepartmentCount = 1 then
scDepartment.LookUpValue := FieldByName('IDDepartment').AsString
else
scDepartment.SpcWhereClause := FilterValue;
end;
Close;
end;
{
if DepartmentCount <= 1 then
begin
scDepartment.Visible := False;
lblDepartment.Visible := False;
btLoopDepartment.Visible := False;
end
else
begin
scDepartment.Visible := True;
lblDepartment.Visible := True;
btLoopDepartment.Visible := True;
end;
}
end;
procedure TFrmEstimatedItemNew.btShowCostClick(Sender: TObject);
begin
inherited;
editCostPrice.Visible := btShowCost.Down;
lblCost.Visible := btShowCost.Down;
end;
end.
|
unit CustomSelectTool;
interface
uses
System.Math,
System.SysUtils,
System.Classes,
Winapi.Windows,
Vcl.Controls,
Vcl.Graphics,
Vcl.StdCtrls,
Vcl.ComCtrls,
Dmitry.Controls.WebLink,
ToolsUnit,
ImageHistoryUnit,
uMemory;
type
TCustomSelectToolClass = class(TToolsPanelClass)
private
{ Private declarations }
EditWidthLabel: TStaticText;
EditHeightLabel: TStaticText;
FFirstPoint: TPoint;
FSecondPoint: TPoint;
FMakingRect: Boolean;
FResizingRect: Boolean;
FxTop: Boolean;
FxLeft: Boolean;
FxRight: Boolean;
FxBottom: Boolean;
FxCenter: boolean;
FBeginDragPoint: TPoint;
FBeginFirstPoint: TPoint;
FBeginSecondPoint: TPoint;
EditLock: Boolean;
FTerminating: Boolean;
FAnyRect: Boolean;
procedure SetFirstPoint(const Value: TPoint);
procedure SetSecondPoint(const Value: TPoint);
procedure SetMakingRect(const Value: Boolean);
procedure SetResizingRect(const Value: Boolean);
procedure SetxBottom(const Value: Boolean);
procedure SetxLeft(const Value: Boolean);
procedure SetxRight(const Value: Boolean);
procedure SetxTop(const Value: Boolean);
procedure SetxCenter(const Value: boolean);
procedure SetBeginDragPoint(const Value: TPoint);
procedure SetBeginFirstPoint(const Value: TPoint);
procedure SetBeginSecondPoint(const Value: TPoint);
procedure EditWidthChanged(Sender : TObject);
procedure EditheightChanged(Sender : TObject);
procedure SetProcRecteateImage(const Value: TNotifyEvent);
procedure SetAnyRect(const Value: boolean);
protected
function LangID: string; override;
public
{ Public declarations }
FProcRecteateImage: TNotifyEvent;
EditWidth: TEdit;
EditHeight: TEdit;
CloseLink: TWebLink;
MakeItLink: TWebLink;
SaveSettingsLink: TWebLink;
function GetProperties: string; override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ClosePanel; override;
procedure ClosePanelEvent(Sender: TObject);
property FirstPoint: TPoint read FFirstPoint write SetFirstPoint;
property SecondPoint: TPoint read FSecondPoint write SetSecondPoint;
property MakingRect: Boolean read FMakingRect write SetMakingRect;
property ResizingRect: Boolean read FResizingRect write SetResizingRect;
procedure DoEffect(Image: TBitmap; Rect: TRect; FullImage: Boolean); virtual; abstract;
procedure DoSaveSettings(Sender: TObject); virtual; abstract;
property XTop: Boolean read FxTop write SetxTop;
property XLeft: Boolean read FxLeft write SetxLeft;
property XBottom: Boolean read FxBottom write SetxBottom;
property XRight: Boolean read FxRight write SetxRight;
property XCenter: Boolean read FxCenter write SetxCenter;
property BeginDragPoint: TPoint read FBeginDragPoint write SetBeginDragPoint;
property BeginFirstPoint: TPoint read FBeginFirstPoint write SetBeginFirstPoint;
property BeginSecondPoint: TPoint read FBeginSecondPoint write SetBeginSecondPoint;
property ProcRecteateImage: TNotifyEvent read FProcRecteateImage write SetProcRecteateImage;
procedure MakeTransform; override;
procedure DoMakeImage(Sender: TObject);
procedure DoBorder(Bitmap: TBitmap; Rect: TRect); virtual; abstract;
function GetZoom: Extended;
function Termnating: Boolean;
property AnyRect: Boolean read FAnyRect write SetAnyRect;
end;
implementation
{ TRedEyeToolPanelClass }
uses
ImEditor;
procedure TCustomSelectToolClass.ClosePanel;
begin
if Assigned(OnClosePanel) then
OnClosePanel(Self);
inherited;
end;
procedure TCustomSelectToolClass.ClosePanelEvent(Sender: TObject);
begin
ClosePanel;
end;
constructor TCustomSelectToolClass.Create(AOwner: TComponent);
begin
inherited;
FAnyRect := False;
FTerminating := False;
Align := AlClient;
FMakingRect := False;
FResizingRect := False;
EditLock := False;
FProcRecteateImage := nil;
EditWidthLabel := TStaticText.Create(AOwner);
EditWidthLabel.Caption := L('Width') + ':';
EditWidthLabel.Top := 8;
EditWidthLabel.Left := 8;
EditWidthLabel.Parent := AOwner as TWinControl;
EditWidth := TEdit.Create(AOwner);
EditWidth.OnChange := EditWidthChanged;
EditWidth.Top := EditWidthLabel.Top + EditWidthLabel.Height + 5;
EditWidth.Width := 60;
EditWidth.Left := 8;
EditWidth.Parent := AOwner as TWinControl;
EditHeight := TEdit.Create(AOwner);
EditHeight.OnChange := EditHeightChanged;
EditHeight.Top := EditWidthLabel.Top + EditWidthLabel.Height + 5;
EditHeight.Width := 60;
EditHeight.Left := EditWidth.Left + EditWidth.Width + 5;
EditHeight.Parent := AOwner as TWinControl;
EditHeightLabel := TStaticText.Create(AOwner);
EditHeightLabel.Caption := L('Height') + ':';
EditHeightLabel.Top := 8;
EditHeightLabel.Left := EditHeight.Left;
EditHeightLabel.Parent := AOwner as TWinControl;
SaveSettingsLink := TWebLink.Create(Self);
SaveSettingsLink.Parent := AOwner as TWinControl;
SaveSettingsLink.Text := L('Save settings');
SaveSettingsLink.Top := 120;
SaveSettingsLink.Left := 10;
SaveSettingsLink.Visible := True;
SaveSettingsLink.Color := ClBtnface;
SaveSettingsLink.OnClick := DoSaveSettings;
SaveSettingsLink.LoadFromResource('SAVETOFILE');
SaveSettingsLink.RefreshBuffer(True);
MakeItLink := TWebLink.Create(Self);
MakeItLink.Parent := AOwner as TWinControl;
MakeItLink.Text := L('Apply');
MakeItLink.Top := 140;
MakeItLink.Left := 10;
MakeItLink.Visible := True;
MakeItLink.Color := ClBtnface;
MakeItLink.OnClick := DoMakeImage;
MakeItLink.LoadFromResource('DOIT');
MakeItLink.RefreshBuffer(True);
CloseLink := TWebLink.Create(Self);
CloseLink.Parent := AOwner as TWinControl;
CloseLink.Text := L('Close tool');
CloseLink.Top := 160;
CloseLink.Left := 10;
CloseLink.Visible := True;
CloseLink.Color := ClBtnface;
CloseLink.OnClick := ClosePanelEvent;
CloseLink.LoadFromResource('CANCELACTION');
CloseLink.RefreshBuffer(True);
end;
destructor TCustomSelectToolClass.Destroy;
begin
F(EditWidthLabel);
F(EditHeightLabel);
F(EditWidth);
F(EditHeight);
F(CloseLink);
F(SaveSettingsLink);
inherited;
end;
procedure TCustomSelectToolClass.DoMakeImage(Sender: TObject);
begin
MakeTransform;
end;
procedure TCustomSelectToolClass.EditheightChanged(Sender: TObject);
begin
if not EditLock then
begin
if FFirstPoint.Y < FSecondPoint.Y then
FSecondPoint.Y := FFirstPoint.Y + StrToIntDef(EditHeight.Text, 10)
else
FFirstPoint.Y := FSecondPoint.Y + StrToIntDef(EditHeight.Text, 10);
if Assigned(FProcRecteateImage) then
FProcRecteateImage(Self);
end;
end;
procedure TCustomSelectToolClass.EditWidthChanged(Sender: TObject);
begin
if not EditLock then
begin
if FFirstPoint.X < FSecondPoint.X then
FSecondPoint.X := FFirstPoint.X + StrToIntDef(EditWidth.Text, 10)
else
FFirstPoint.X := FSecondPoint.X + StrToIntDef(EditWidth.Text, 10);
if Assigned(FProcRecteateImage) then
FProcRecteateImage(Self);
end;
end;
function TCustomSelectToolClass.GetProperties: string;
begin
//
end;
function TCustomSelectToolClass.GetZoom: Extended;
begin
Result := Editor.Zoom;
end;
function TCustomSelectToolClass.LangID: string;
begin
Result := 'SelectionTool';
end;
procedure TCustomSelectToolClass.MakeTransform;
var
Bitmap: TBitmap;
Point1, Point2: TPoint;
begin
inherited;
FTerminating := True;
Bitmap := TBitmap.Create;
Bitmap.PixelFormat := Pf24bit;
Bitmap.Assign(Image);
if FAnyRect then
begin
Point1.X := Min(FirstPoint.X, SecondPoint.X);
Point1.Y := Min(FirstPoint.Y, SecondPoint.Y);
Point2.X := Max(FirstPoint.X, SecondPoint.X);
Point2.Y := Max(FirstPoint.Y, SecondPoint.Y);
end else
begin
Point1.X := Max(1, Min(FirstPoint.X, SecondPoint.X));
Point1.Y := Max(1, Min(FirstPoint.Y, SecondPoint.Y));
Point2.X := Min(Max(FirstPoint.X, SecondPoint.X), Image.Width);
Point2.Y := Min(Max(FirstPoint.Y, SecondPoint.Y), Image.Height);
end;
DoEffect(Bitmap, Rect(Point1, Point2), True);
F(FImage);
ImageHistory.Add(Bitmap, '{' + ID + '}[' + GetProperties + ']');
SetImagePointer(Bitmap);
ClosePanel;
end;
procedure TCustomSelectToolClass.SetAnyRect(const Value: boolean);
begin
FAnyRect := Value;
end;
procedure TCustomSelectToolClass.SetBeginDragPoint(const Value: TPoint);
begin
FBeginDragPoint := Value;
end;
procedure TCustomSelectToolClass.SetBeginFirstPoint(const Value: TPoint);
begin
FBeginFirstPoint := Value;
end;
procedure TCustomSelectToolClass.SetBeginSecondPoint(const Value: TPoint);
begin
FBeginSecondPoint := Value;
end;
procedure TCustomSelectToolClass.SetFirstPoint(const Value: TPoint);
begin
FFirstPoint := Value;
EditLock := True;
EditWidth.Text := IntToStr(Abs(FFirstPoint.X - FSecondPoint.X));
Editheight.Text := IntToStr(Abs(FFirstPoint.Y - FSecondPoint.Y));
EditLock := False;
end;
procedure TCustomSelectToolClass.SetMakingRect(const Value: Boolean);
begin
FMakingRect := Value;
end;
procedure TCustomSelectToolClass.SetProcRecteateImage(
const Value: TNotifyEvent);
begin
FProcRecteateImage := Value;
end;
procedure TCustomSelectToolClass.SetResizingRect(const Value: Boolean);
begin
FResizingRect := Value;
end;
procedure TCustomSelectToolClass.SetSecondPoint(const Value: TPoint);
begin
FSecondPoint := Value;
EditLock := True;
EditWidth.Text := IntToStr(Abs(FFirstPoint.X - FSecondPoint.X));
Editheight.Text := IntToStr(Abs(FFirstPoint.Y - FSecondPoint.Y));
EditLock := False;
end;
procedure TCustomSelectToolClass.SetxBottom(const Value: Boolean);
begin
FxBottom := Value;
end;
procedure TCustomSelectToolClass.SetxCenter(const Value: boolean);
begin
FxCenter := Value;
end;
procedure TCustomSelectToolClass.SetxLeft(const Value: Boolean);
begin
FxLeft := Value;
end;
procedure TCustomSelectToolClass.SetxRight(const Value: Boolean);
begin
FxRight := Value;
end;
procedure TCustomSelectToolClass.SetxTop(const Value: Boolean);
begin
FxTop := Value;
end;
function TCustomSelectToolClass.Termnating: Boolean;
begin
Result := FTerminating;
end;
end.
|
unit ufrmDialogModule;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ufrmMasterDialog, ufraFooterDialog2Button, ExtCtrls, StdCtrls,
cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxButtonEdit, System.Actions,
Vcl.ActnList, ufraFooterDialog3Button;
type
TfrmDialogModule = class(TfrmMasterDialog)
Label4: TLabel;
edtModName: TEdit;
edtModCaption: TEdit;
Label7: TLabel;
Suplier: TLabel;
Label2: TLabel;
Label6: TLabel;
edtModAction: TEdit;
cboModLbl: TComboBox;
Label1: TLabel;
edtModIconPath: TEdit;
edtModID: TcxButtonEdit;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure footerDialogMasterbtnSaveClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure edtModActionKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormShow(Sender: TObject);
procedure edtModIDPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
private
{ Private declarations }
FModId : Integer;
// FMdl : TModule;
procedure ClearData;
procedure SetData;
public
property ModId: Integer read FModId write FModId;
{ Public declarations }
end;
var
frmDialogModule: TfrmDialogModule;
implementation
{$R *.dfm}
uses
uRetnoUnit, uTSCommonDlg;
procedure TfrmDialogModule.ClearData;
begin
edtModID.Clear;
edtModName.Clear;
edtModCaption.Clear;
edtModAction.Clear;
edtModIconPath.Clear;
cboModLbl.ItemIndex := -1;
end;
procedure TfrmDialogModule.SetData;
var
i : Integer;
begin
if FModId <> 0 then
begin
// if FMdl.LoadByID(FModId, DialogUnit) then
// begin
// edtModID.Text := IntToStr(FMdl.ModID);
// edtModName.Text := FMdl.ModNm;
// edtModCaption.Text := FMdl.ModCaption;
// edtModAction.Text := FMdl.ModAction;
//
// for i := 0 to cboModLbl.Items.Count - 1 do
// begin
// if LowerCase(Trim(cboModLbl.Items.Strings[i])) = LowerCase(Trim(FMdl.ModLbl)) then
// begin
// cboModLbl.ItemIndex := i;
// Break;
// end;
// end;
//
// edtModID.Enabled := False;
// end;
end
else
begin
edtModID.Enabled := True;
end;
end;
procedure TfrmDialogModule.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDialogModule.FormDestroy(Sender: TObject);
begin
// FreeAndNil(FMdl);
frmDialogModule := nil;
inherited;
end;
procedure TfrmDialogModule.footerDialogMasterbtnSaveClick(Sender: TObject);
var
sLabel : String;
begin
inherited;
if (edtModID.Text = '') or (cboModLbl.ItemIndex = -1) then
exit;
// if cboModLbl.ItemIndex = 0 then sLabel := 'Add';
// if cboModLbl.ItemIndex = 1 then sLabel := 'Edit';
// if cboModLbl.ItemIndex = 2 then sLabel := 'Delete';
// if cboModLbl.ItemIndex = 3 then sLabel := 'Refresh';
// if cboModLbl.ItemIndex = 4 then sLabel := 'View';
// if cboModLbl.ItemIndex = 5 then sLabel := 'Posted';
// if cboModLbl.ItemIndex = 6 then sLabel := 'Form';
sLabel := cboModLbl.Text;
// FMdl.UpdateData(edtModAction.Text, edtModCaption.Text, edtModIconPath.Text,
// FModId, sLabel, edtModName.Text, DialogUnit);
// try
// if FMdl.SaveToDB then
// begin
// cCommitTrans;
// CommonDlg.ShowMessage('Sukses simpan data');
//
// if FModId <> 0 then
// self.Close;
//
// ClearData;
// end
// else
// begin
// cRollbackTrans;
// CommonDlg.ShowError('Gagal simpan data');
// end;
// finally
// cRollbackTrans;
// end;
end;
procedure TfrmDialogModule.FormCreate(Sender: TObject);
begin
inherited;
// FMdl := TModule.Create(nil);
end;
procedure TfrmDialogModule.edtModActionKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var
sSQL : string;
begin
inherited;
if Key = vk_F5 then
begin
sSQL := 'SELECT ACT_NAME, ACT_DESC'
+ ' FROM ACTION_LIST'
+ ' WHERE ACT_UNT = '+ IntToStr(DialogUnit);
// with cLookUp('Get Action List', sSQL) do
// begin
// try
// edtModAction.Text := Strings[0];
// finally
// Free;
// end;
// end;
end;
end;
procedure TfrmDialogModule.edtModIDPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
var
sSQL: String;
begin
sSQL := 'select max(MOD_ID) from AUT$MODULE';
// with cOpenQuery(sSQL) do
// Begin
// Try
// edtModID.Text := IntToStr(Fields[0].AsInteger+1);
// Finally
// Free;
// End;
// End;
end;
procedure TfrmDialogModule.FormShow(Sender: TObject);
begin
inherited;
SetData;
end;
end.
|
{*****************************************************************************************}
{ }
{ XML Data Binding }
{ }
{ Generated on: 11-7-2013 12:51:11 }
{ Generated from: Z:\pg\Documents\pgdemos\FMWeather\src\sample_data\countries.xml }
{ Settings stored in: Z:\pg\Documents\pgdemos\FMWeather\src\sample_data\countries.xdb }
{ }
{*****************************************************************************************}
unit xmlbinding_countries;
interface
uses xmldom, XMLDoc, XMLIntf;
type
{ Forward Decls }
IXMLNewDataSetType = interface;
IXMLTableType = interface;
{ IXMLNewDataSetType }
IXMLNewDataSetType = interface(IXMLNodeCollection)
['{2EE9A63C-4F41-42C9-AADE-96F123DB5967}']
{ Property Accessors }
function Get_Table(Index: Integer): IXMLTableType;
{ Methods & Properties }
function Add: IXMLTableType;
function Insert(const Index: Integer): IXMLTableType;
property Table[Index: Integer]: IXMLTableType read Get_Table; default;
end;
{ IXMLTableType }
IXMLTableType = interface(IXMLNode)
['{073A4984-5D9F-4A52-9E53-51B9F1CB586E}']
{ Property Accessors }
function Get_Name: UnicodeString;
procedure Set_Name(Value: UnicodeString);
{ Methods & Properties }
property Name: UnicodeString read Get_Name write Set_Name;
end;
{ Forward Decls }
TXMLNewDataSetType = class;
TXMLTableType = class;
{ TXMLNewDataSetType }
TXMLNewDataSetType = class(TXMLNodeCollection, IXMLNewDataSetType)
protected
{ IXMLNewDataSetType }
function Get_Table(Index: Integer): IXMLTableType;
function Add: IXMLTableType;
function Insert(const Index: Integer): IXMLTableType;
public
procedure AfterConstruction; override;
end;
{ TXMLTableType }
TXMLTableType = class(TXMLNode, IXMLTableType)
protected
{ IXMLTableType }
function Get_Name: UnicodeString;
procedure Set_Name(Value: UnicodeString);
end;
{ Global Functions }
function GetNewDataSet(Doc: IXMLDocument): IXMLNewDataSetType;
function LoadNewDataSet(const FileName: string): IXMLNewDataSetType;
function NewNewDataSet: IXMLNewDataSetType;
const
TargetNamespace = '';
implementation
{ Global Functions }
function GetNewDataSet(Doc: IXMLDocument): IXMLNewDataSetType;
begin
Result := Doc.GetDocBinding('NewDataSet', TXMLNewDataSetType, TargetNamespace) as IXMLNewDataSetType;
end;
function LoadNewDataSet(const FileName: string): IXMLNewDataSetType;
begin
Result := LoadXMLDocument(FileName).GetDocBinding('NewDataSet', TXMLNewDataSetType, TargetNamespace) as IXMLNewDataSetType;
end;
function NewNewDataSet: IXMLNewDataSetType;
begin
Result := NewXMLDocument.GetDocBinding('NewDataSet', TXMLNewDataSetType, TargetNamespace) as IXMLNewDataSetType;
end;
{ TXMLNewDataSetType }
procedure TXMLNewDataSetType.AfterConstruction;
begin
RegisterChildNode('Table', TXMLTableType);
ItemTag := 'Table';
ItemInterface := IXMLTableType;
inherited;
end;
function TXMLNewDataSetType.Get_Table(Index: Integer): IXMLTableType;
begin
Result := List[Index] as IXMLTableType;
end;
function TXMLNewDataSetType.Add: IXMLTableType;
begin
Result := AddItem(-1) as IXMLTableType;
end;
function TXMLNewDataSetType.Insert(const Index: Integer): IXMLTableType;
begin
Result := AddItem(Index) as IXMLTableType;
end;
{ TXMLTableType }
function TXMLTableType.Get_Name: UnicodeString;
begin
Result := ChildNodes['Name'].Text;
end;
procedure TXMLTableType.Set_Name(Value: UnicodeString);
begin
ChildNodes['Name'].NodeValue := Value;
end;
end. |
//
// Generated by JavaToPas v1.5 20160510 - 150028
////////////////////////////////////////////////////////////////////////////////
unit java.lang.Throwable;
interface
uses
AndroidAPI.JNIBridge,
Androidapi.JNI.JavaTypes;
type
JThrowable = interface;
JThrowableClass = interface(JObjectClass)
['{44B721EE-D8ED-4F13-B364-E82E95BDEAD6}']
function fillInStackTrace : JThrowable; cdecl; // ()Ljava/lang/Throwable; A: $21
function getCause : JThrowable; cdecl; // ()Ljava/lang/Throwable; A: $21
function getLocalizedMessage : JString; cdecl; // ()Ljava/lang/String; A: $1
function getMessage : JString; cdecl; // ()Ljava/lang/String; A: $1
function getStackTrace : TJavaArray<JStackTraceElement>; cdecl; // ()[Ljava/lang/StackTraceElement; A: $1
function getSuppressed : TJavaArray<JThrowable>; cdecl; // ()[Ljava/lang/Throwable; A: $31
function init : JThrowable; cdecl; overload; // ()V A: $1
function init(&message : JString) : JThrowable; cdecl; overload; // (Ljava/lang/String;)V A: $1
function init(&message : JString; cause : JThrowable) : JThrowable; cdecl; overload;// (Ljava/lang/String;Ljava/lang/Throwable;)V A: $1
function init(cause : JThrowable) : JThrowable; cdecl; overload; // (Ljava/lang/Throwable;)V A: $1
function initCause(cause : JThrowable) : JThrowable; cdecl; // (Ljava/lang/Throwable;)Ljava/lang/Throwable; A: $21
function toString : JString; cdecl; // ()Ljava/lang/String; A: $1
procedure addSuppressed(exception : JThrowable) ; cdecl; // (Ljava/lang/Throwable;)V A: $31
procedure printStackTrace ; cdecl; overload; // ()V A: $1
procedure printStackTrace(s : JPrintStream) ; cdecl; overload; // (Ljava/io/PrintStream;)V A: $1
procedure printStackTrace(s : JPrintWriter) ; cdecl; overload; // (Ljava/io/PrintWriter;)V A: $1
procedure setStackTrace(stackTrace : TJavaArray<JStackTraceElement>) ; cdecl;// ([Ljava/lang/StackTraceElement;)V A: $1
end;
[JavaSignature('java/lang/Throwable')]
JThrowable = interface(JObject)
['{60F794AB-D9B9-4B63-8866-54E76F83B3A2}']
function getLocalizedMessage : JString; cdecl; // ()Ljava/lang/String; A: $1
function getMessage : JString; cdecl; // ()Ljava/lang/String; A: $1
function getStackTrace : TJavaArray<JStackTraceElement>; cdecl; // ()[Ljava/lang/StackTraceElement; A: $1
function toString : JString; cdecl; // ()Ljava/lang/String; A: $1
procedure printStackTrace ; cdecl; overload; // ()V A: $1
procedure printStackTrace(s : JPrintStream) ; cdecl; overload; // (Ljava/io/PrintStream;)V A: $1
procedure printStackTrace(s : JPrintWriter) ; cdecl; overload; // (Ljava/io/PrintWriter;)V A: $1
procedure setStackTrace(stackTrace : TJavaArray<JStackTraceElement>) ; cdecl;// ([Ljava/lang/StackTraceElement;)V A: $1
end;
TJThrowable = class(TJavaGenericImport<JThrowableClass, JThrowable>)
end;
implementation
end.
|
{
Clever Internet Suite Version 6.2
Copyright (C) 1999 - 2006 Clever Components
www.CleverComponents.com
}
unit clStreams;
interface
uses
Classes, SysUtils;
type
EclStreamError = class(Exception);
TclMultiStream = class(TStream)
private
FPosition: Integer;
FList: TList;
function GetStream(Index: Integer): TStream;
function GetTotalSize: Longint;
protected
procedure SetSize(NewSize: Longint); override;
public
constructor Create;
destructor Destroy; override;
procedure AddStream(AStream: TStream);
function Read(var Buffer; Count: Longint): Longint; override;
function Seek(Offset: Longint; Origin: Word): Longint; override;
function Write(const Buffer; Count: Longint): Longint; override;
end;
TclNullStream = class(TStream)
protected
procedure SetSize(NewSize: Longint); override;
public
function Read(var Buffer; Count: Longint): Longint; override;
function Seek(Offset: Longint; Origin: Word): Longint; override;
function Write(const Buffer; Count: Longint): Longint; override;
end;
TclChunkedStream = class(TStream)
private
FChunkSizeStr: string;
FIsReadChunk: Boolean;
FChunkSize: Integer;
FChunkWritten: Integer;
FIsCompleted: Boolean;
FDestination: TStream;
FTotalWritten: Integer;
function ReadChunkData(const Buffer; var Offset: Integer; Count: Integer): Boolean;
function ReadChunkSize(const Buffer; var Offset: Integer; Count: Integer): Boolean;
function GetChunkSizeStr(const Buffer: PChar; Count: Integer): string;
protected
procedure SetSize(NewSize: Longint); override;
public
constructor Create(ADestination: TStream);
function Read(var Buffer; Count: Longint): Longint; override;
function Seek(Offset: Longint; Origin: Word): Longint; override;
function Write(const Buffer; Count: Longint): Longint; override;
property IsCompleted: Boolean read FIsCompleted;
end;
implementation
{ TclMultiStream }
procedure TclMultiStream.AddStream(AStream: TStream);
begin
FList.Add(AStream);
end;
constructor TclMultiStream.Create;
begin
inherited Create();
FList := TList.Create();
FPosition := 0;
end;
destructor TclMultiStream.Destroy;
var
i: Integer;
begin
for i := FList.Count - 1 downto 0 do
begin
GetStream(i).Free();
end;
FList.Free();
inherited Destroy();
end;
function TclMultiStream.GetStream(Index: Integer): TStream;
begin
Result := TStream(FList[Index]);
end;
function TclMultiStream.Read(var Buffer; Count: Integer): Longint;
var
i: Integer;
buf_pos: PChar;
len, bytesRead: Longint;
begin
len := 0;
Result := 0;
buf_pos := PChar(@Buffer);
for i := 0 to FList.Count - 1 do
begin
if (FPosition < (len + GetStream(i).Size)) then
begin
GetStream(i).Position := FPosition - len;
bytesRead := GetStream(i).Read(buf_pos^, Count);
Inc(Result, bytesRead);
buf_pos := buf_pos + bytesRead;
Inc(FPosition, bytesRead);
if (bytesRead < Count) then
begin
Dec(Count, bytesRead);
end else
begin
break;
end;
end;
Inc(len, GetStream(i).Size);
end;
end;
function TclMultiStream.GetTotalSize: Longint;
var
i: Integer;
begin
Result := 0;
for i := 0 to FList.Count - 1 do
begin
Result := Result + GetStream(i).Size;
end;
end;
function TclMultiStream.Seek(Offset: Integer; Origin: Word): Longint;
var
len: Integer;
begin
len := GetTotalSize();
case Origin of
soFromBeginning: FPosition := Offset;
soFromCurrent: FPosition := FPosition + Offset;
soFromEnd: FPosition := len - Offset;
end;
if (FPosition > len) then
begin
FPosition := len;
end else
if (FPosition < 0) then
begin
FPosition := 0;
end;
Result := FPosition;
end;
procedure TclMultiStream.SetSize(NewSize: Integer);
begin
end;
function TclMultiStream.Write(const Buffer; Count: Integer): Longint;
begin
Result := 0;
end;
{ TclNullStream }
function TclNullStream.Read(var Buffer; Count: Integer): Longint;
begin
Result := 0;
end;
function TclNullStream.Seek(Offset: Integer; Origin: Word): Longint;
begin
Result := 0;
end;
function TclNullStream.Write(const Buffer; Count: Integer): Longint;
begin
Result := 0;
end;
procedure TclNullStream.SetSize(NewSize: Integer);
begin
end;
{ TclChunkedStream }
constructor TclChunkedStream.Create(ADestination: TStream);
begin
inherited Create();
Assert(ADestination <> nil);
FDestination := ADestination;
FTotalWritten := 0;
end;
function TclChunkedStream.Read(var Buffer; Count: Integer): Longint;
begin
Result := 0;
end;
function TclChunkedStream.Seek(Offset: Integer; Origin: Word): Longint;
begin
case Origin of
soFromBeginning: Result := Offset;
soFromCurrent: Result := FTotalWritten + Offset;
soFromEnd: Result := FTotalWritten - Offset
else
Result := 0;
end;
if (Result <> FTotalWritten) then
begin
raise EclStreamError.Create('Invalid Stream operation');
end;
end;
procedure TclChunkedStream.SetSize(NewSize: Integer);
begin
end;
function TclChunkedStream.Write(const Buffer; Count: Integer): Longint;
var
offset: Integer;
begin
Result := Count;
FTotalWritten := FTotalWritten + Result;
offset := 0;
repeat
if not FIsReadChunk then
begin
FIsReadChunk := ReadChunkSize(Buffer, offset, Count);
end;
if FIsReadChunk then
begin
FIsReadChunk := not ReadChunkData(Buffer, offset, Count);
end;
until (offset >= Count) or IsCompleted;
end;
function TclChunkedStream.GetChunkSizeStr(const Buffer: PChar; Count: Integer): string;
var
i: Integer;
c: Char;
begin
Result := '';
for i := 0 to Count - 1 do
begin
c := Buffer[i];
if (c in ['0'..'9']) or (c in ['a'..'f']) or (c in ['A'..'F']) then
begin
Result := Result + c;
end else
begin
Break;
end;
end;
end;
function TclChunkedStream.ReadChunkSize(const Buffer; var Offset: Integer; Count: Integer): Boolean;
var
start: Integer;
cur_pos: PChar;
begin
start := Offset;
Result := False;
while (Offset < Count) do
begin
cur_pos := PChar(@Buffer) + Offset;
Inc(Offset);
if (cur_pos[0] = #10) then
begin
FChunkSizeStr := FChunkSizeStr + GetChunkSizeStr(PChar(@Buffer) + start, Offset - start - 1);
if (FChunkSizeStr <> '') then
begin
FChunkSizeStr := '$' + FChunkSizeStr;
end;
FChunkSize := StrToIntDef(FChunkSizeStr, 0);
FChunkSizeStr := '';
FChunkWritten := 0;
Result := True;
Exit;
end;
end;
FChunkSizeStr := FChunkSizeStr + GetChunkSizeStr(PChar(@Buffer) + start, Offset - start);
end;
function TclChunkedStream.ReadChunkData(const Buffer; var Offset: Integer; Count: Integer): Boolean;
var
cnt: Integer;
cur_pos: PChar;
begin
Result := False;
if (FChunkSize > 0) then
begin
cnt := Count - Offset;
if (cnt > FChunkSize - FChunkWritten) then
begin
cnt := FChunkSize - FChunkWritten;
end;
FDestination.Write((PChar(@Buffer) + Offset)^, cnt);
Offset := Offset + cnt;
FChunkWritten := FChunkWritten + cnt;
end;
if (FChunkWritten = FChunkSize) then
begin
while (Offset < Count) do
begin
cur_pos := PChar(@Buffer) + Offset;
Inc(Offset);
if (cur_pos[0] = #10) then
begin
Result := True;
if (FChunkSize = 0) then
begin
FIsCompleted := True;
end;
Break;
end;
end;
end;
end;
end. |
unit UDWindowParent;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
Forms, Buttons, StdCtrls, ExtCtrls, Dialogs, UCrpe32;
type
TCrpeWindowParentDlg = class(TForm)
pnlBtnBar: TPanel;
cbZoom: TComboBox;
sbClose: TSpeedButton;
pnlStatus: TPanel;
pnlReportName: TPanel;
lblExplanation: TLabel;
sbPrint: TSpeedButton;
sbExport: TSpeedButton;
sbPageNext: TSpeedButton;
sbPageFirst: TSpeedButton;
sbPagePrev: TSpeedButton;
sbPageLast: TSpeedButton;
cbPage: TComboBox;
sbZoom1: TSpeedButton;
sbZoom2: TSpeedButton;
sbZoom3: TSpeedButton;
lblPages: TLabel;
pnlRecordsRead: TPanel;
lblRead: TLabel;
pnlRecordsSelected: TPanel;
lblSelected: TLabel;
pnlRecordsPrinted: TPanel;
lblRecordsPrinted: TLabel;
Timer1: TTimer;
lblPrinted: TLabel;
lblRecordsSelected: TLabel;
lblRecordsRead: TLabel;
sbCancel: TSpeedButton;
procedure FormResize(Sender: TObject);
procedure sbCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure cbZoomChange(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure sbPrintClick(Sender: TObject);
procedure sbExportClick(Sender: TObject);
procedure sbPageFirstClick(Sender: TObject);
procedure sbPagePrevClick(Sender: TObject);
procedure sbPageNextClick(Sender: TObject);
procedure sbPageLastClick(Sender: TObject);
procedure sbZoom1Click(Sender: TObject);
procedure sbZoom2Click(Sender: TObject);
procedure sbZoom3Click(Sender: TObject);
procedure cbPageChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure sbCancelClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Cr : TCrpe;
PagePlus : string;
end;
var
CrpeWindowParentDlg : TCrpeWindowParentDlg;
bWindowParent : boolean;
iPreventInfiniteLoop : integer;
implementation
{$R *.DFM}
{------------------------------------------------------------------------------}
{ FormCreate procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.FormCreate(Sender: TObject);
begin
iPreventInfiniteLoop := 0;
bWindowParent := True;
PagePlus := '+';
Timer1.Enabled := True;
end;
{------------------------------------------------------------------------------}
{ FormShow procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.FormShow(Sender: TObject);
begin
cbPage.OnChange := nil;
{Set zoom combo box}
cbZoom.ItemIndex := Cr.WindowZoom.Magnification;
{Set up the Page combo box}
cbPage.Clear;
cbPage.Items.Add('1');
cbPage.ItemIndex := 0;
lblPages.Caption := 'of 1' + PagePlus;
cbPage.OnChange := cbPageChange;
SetFocus;
end;
{------------------------------------------------------------------------------}
{ Timer1Timer procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.Timer1Timer(Sender: TObject);
var
temp1,
temp2,
temp3 : string;
begin
{Update Status Display}
Str(Cr.Records.Printed, temp1);
Str(Cr.Records.Read, temp2);
Str(Cr.Records.Selected, temp3);
lblRecordsPrinted.Caption := temp1 + ' ';
lblRecordsRead.Caption := temp2 + ' ';
lblRecordsSelected.Caption := temp3 + ' ';
if Cr.Status = crsJobCompleted then
begin
Timer1.Enabled := False;
sbPrint.Enabled := True;
sbExport.Enabled := True;
sbPageNext.Enabled := True;
sbPageFirst.Enabled := True;
sbPagePrev.Enabled := True;
sbPageLast.Enabled := True;
cbPage.Enabled := True;
sbZoom1.Enabled := True;
sbZoom2.Enabled := True;
sbZoom3.Enabled := True;
cbZoom.Enabled := True;
end;
end;
{------------------------------------------------------------------------------}
{ sbPrintClick procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbPrintClick(Sender: TObject);
begin
Cr.PrintWindow;
end;
{------------------------------------------------------------------------------}
{ sbExportClick procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbExportClick(Sender: TObject);
begin
Cr.ExportWindow(False); {default to disk file}
// Cr.ExportWindow(True); {default to application}
end;
{------------------------------------------------------------------------------}
{ cbZoomChange procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.cbZoomChange(Sender: TObject);
begin
Cr.WindowZoom.Magnification := StrToInt(cbZoom.Items[cbZoom.ItemIndex]);
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ sbZoom1Click procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbZoom1Click(Sender: TObject);
begin
Cr.WindowZoom.Preview := pwNormal;
cbZoom.ItemIndex := 3;
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ sbZoom2Click procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbZoom2Click(Sender: TObject);
begin
Cr.WindowZoom.Preview := pwPageWidth;
cbZoom.ItemIndex := -1;
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ sbZoom3Click procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbZoom3Click(Sender: TObject);
begin
Cr.WindowZoom.Preview := pwWholePage;
cbZoom.ItemIndex := -1;
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ sbPageFirstClick procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbPageFirstClick(Sender: TObject);
begin
cbPage.OnChange := nil;
Cr.Pages.First;
{Loop until page is drawn}
while Cr.Status <> crsJobCompleted do
Application.ProcessMessages;
cbPage.ItemIndex := 0;
cbPage.OnChange := cbPageChange;
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ sbPagePrevClick procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbPagePrevClick(Sender: TObject);
var
pg1: integer;
begin
cbPage.OnChange := nil;
Cr.Pages.Previous;
{Loop until page is drawn}
while Cr.Status <> crsJobCompleted do
Application.ProcessMessages;
pg1 := Cr.Pages.GetDisplayed;
{Update the Page Number}
cbPage.ItemIndex := pg1 - 1;
cbPage.OnChange := cbPageChange;
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ sbPageNextClick procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbPageNextClick(Sender: TObject);
var
pg1,pg2,pg3 : integer;
cnt : integer;
begin
cbPage.OnChange := nil;
{Get the Displayed page number}
pg1 := Cr.Pages.GetDisplayed;
{Show the next page}
Cr.Pages.Next;
{Loop until page is drawn}
while Cr.Status <> crsJobCompleted do
Application.ProcessMessages;
{Get the Displayed page number}
pg2 := Cr.Pages.GetDisplayed;
{Get the Latest page number}
pg3 := Cr.Pages.GetLatest;
{If the Latest Page number increased, add to the combo box}
if pg3 > cbPage.Items.Count then
begin
for cnt := (cbPage.Items.Count + 1) to pg3 do
cbPage.Items.Add(IntToStr(cnt));
end;
{if Page number stayed the same, it is the Last Page}
if pg2 = pg1 then
PagePlus := '';
{Update the Page Number}
cbPage.ItemIndex := pg2 - 1;
{Redraw the Pages Label}
lblPages.Caption := 'of ' + IntToStr(pg3) + PagePlus;
cbPage.OnChange := cbPageChange;
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ sbPageLastClick procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbPageLastClick(Sender: TObject);
var
pg1 : integer;
cnt1 : integer;
begin
cbPage.OnChange := nil;
Cr.Pages.Last;
while Cr.Status <> crsJobCompleted do
Application.ProcessMessages;
pg1 := Cr.Pages.GetLatest;
{If the Page number increased, add to the combo box}
if pg1 > cbPage.Items.Count then
begin
for cnt1 := (cbPage.Items.Count + 1) to pg1 do
cbPage.Items.Add(IntToStr(cnt1));
end;
cbPage.ItemIndex := pg1 - 1;
{Redraw the Pages Label}
PagePlus := '';
lblPages.Caption := 'of ' + IntToStr(pg1);
cbPage.OnChange := cbPageChange;
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ sbPageChange procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.cbPageChange(Sender: TObject);
var
nPage : smallint;
begin
nPage := StrToInt(cbPage.Items[cbPage.ItemIndex]);
{The ShowPage call seems to cause the CRPE to
finish printing all the records}
Cr.Pages.GoToPage(nPage);
pnlBtnBar.SetFocus;
end;
{------------------------------------------------------------------------------}
{ FormResize procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.FormResize(Sender: TObject);
var
WinHandle: hWnd;
begin
WinHandle := Cr.ReportWindowHandle;
SetWindowPos(WinHandle, HWND_TOP, 0, pnlBtnBar.Height, ClientWidth,
ClientHeight - pnlBtnBar.Height - pnlStatus.Height, SWP_NOZORDER);
end;
{------------------------------------------------------------------------------}
{ sbCancelClick procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbCancelClick(Sender: TObject);
begin
Cr.CancelJob;
end;
{------------------------------------------------------------------------------}
{ sbCloseClick procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.sbCloseClick(Sender: TObject);
begin
Close;
end;
{------------------------------------------------------------------------------}
{ FormClose procedure }
{------------------------------------------------------------------------------}
procedure TCrpeWindowParentDlg.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Timer1.Enabled := False;
{This is to prevent shutting the window before either
the PrintJob is finished processing or before the window
has finished drawing: either case can cause a crash}
if (not Cr.CanCloseEngine) and (iPreventInfiniteLoop < 3) then
begin
Inc(iPreventInfiniteLoop);
Cr.CancelJob;
Action := caNone;
Exit;
end;
Cr.CloseWindow;
bWindowParent := False;
Release;
end;
end.
|
unit uAddModifAdr2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uFormControl, uCharControl, uSpravControl, uFControl,
uLabeledFControl, uDateControl, StdCtrls, Buttons, uInvisControl,
cxRadioGroup, uAdr_DataModule, uLogicCheck, uSimpleCheck, uAddModifForm,
DB, FIBDataSet, pFIBDataSet;
type
TAddModifAdrForm2 = class(TAddModifForm)
qFFC_Adress: TqFFormControl;
qFSC_Adress: TqFSpravControl;
qFCC_Korpus: TqFCharControl;
qFCC_House: TqFCharControl;
qFCC_Flat: TqFCharControl;
OkButton: TBitBtn;
CancelButton: TBitBtn;
qFSC_CArea: TqFSpravControl;
qFIC_AdrPK: TqFInvisControl;
qFCC_Zip: TqFCharControl;
pFIBDS_SelPlace: TpFIBDataSet;
procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure qFSC_AdressOpenSprav(Sender: TObject; var Value: Variant;
var DisplayText: String);
procedure qFSC_CAreaOpenSprav(Sender: TObject; var Value: Variant;
var DisplayText: String);
procedure qFSC_AdressChange(Sender: TObject);
private
Mode: TFormMode;
DM: TAdrDM;
{ Private declarations }
public
constructor Create(AOwner:TComponent; DMod: TAdrDM; Mode: TFormMode; Where: Variant; id_PK:Variant);
end;
var
AddModifAdrForm: TAddModifAdrForm2;
implementation
uses uAdressForm, RXMemDS, uUnivSprav;
{$R *.dfm}
constructor TAddModifAdrForm2.Create(AOwner:TComponent; DMod: TAdrDM; Mode: TFormMode; Where: Variant; id_PK:Variant);
begin
inherited Create(AOwner);
Self.Mode := Mode;
Self.DM := TAdrDM.Create(Self);
Self.DM := DMod;
pFIBDS_SelPlace.Database:=DM.pFIBDB_Adr;
DBHandle:=Integer(DM.pFIBDB_Adr.Handle);
pFIBDS_SelPlace.Database.Open;
if (Mode=fmAdd) then
begin
end;
// pFIBDS_Type.Database := Self.DM.DB;
// pFIBDS_Type.Transaction := Self.DM.ReadTransaction;
qFIC_AdrPK.SetValue(id_PK);
// id:=id_PK;
qFFC_Adress.Prepare(DM.pFIBDB_Adr,Mode,Where,Null);
qFIC_AdrPK.SetValue(id_PK);
end;
procedure TAddModifAdrForm2.OkButtonClick(Sender: TObject);
begin
// ShowMessage(qFFC_Adress.InsertSQL[0]);
qFFC_Adress.Ok;
end;
procedure TAddModifAdrForm2.CancelButtonClick(Sender: TObject);
begin
Close;
end;
procedure TAddModifAdrForm2.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TAddModifAdrForm2.qFSC_AdressOpenSprav(Sender: TObject;
var Value: Variant; var DisplayText: String);
var
AdrForm: TAdrForm;
Input, Output: TRxMemoryData;
begin
// Input.FieldDefs.Add('ActualDate', ftDate);
Input:=TRxMemoryData.Create(Self);
Output:=TRxMemoryData.Create(Self);
Input.FieldDefs.Add('Select', ftInteger);
Output.FieldDefs.Add('Id_Street', ftInteger);
Output.FieldDefs.Add('Name_Adress', ftString, 255);
Input.Open;
Input.Append;
Input.FieldValues['Select'] := 1;
Input.Post;
AdrForm:= TAdrForm.Create(Self,DM,Input,Output);
if (AdrForm.ShowModal=mrOk) then
begin
AdrForm.Output.Open;
Value:=AdrForm.Output['Id_Street'];
DisplayText:=AdrForm.Output['Name_Adress'];
AdrForm.Free;
end;
// ShowMessage(VarToStr(Value)+' '+DisplayText);
end;
procedure TAddModifAdrForm2.qFSC_CAreaOpenSprav(Sender: TObject;
var Value: Variant; var DisplayText: String);
var
Params:TUnivParams;
OutPut : TRxMemoryData;
begin
if VarIsNull(qFSC_Adress.Value) then
begin
ShowMessage('Спочатку оберіть адресу!');
Exit;
end;
pFIBDS_SelPlace.ParamByName('id_street').AsInteger:=qFSC_Adress.Value;
pFIBDS_SelPlace.Open;
if VarIsNull(pFIBDS_SelPlace['id_place']) then
begin
ShowMessage('Такої адреси не існує!');
Exit;
end;
Params.FormCaption:='Довідник міських районів';
Params.ShowMode:=fsmSelect;
Params.ShowButtons:=[fbAdd,fbModif,fbDelete,fbExit];
Params.AddFormClass:='TAddCityArea';
Params.ModifFormClass:='TAddCityArea';
Params.TableName:='adr_city_area_select('+IntToStr(pFIBDS_SelPlace['id_place'])+')';
Params.Fields:='Name_CITY_AREA,id_CITY_AREA';
Params.FieldsName:='Назва';
Params.KeyField:='id_CITY_AREA';
Params.ReturnFields:='Name_CITY_AREA,id_CITY_AREA';
Params.DeleteSQL:='execute procedure adr_CITY_AREA_d(:id_CITY_AREA);';
Params.DBHandle:=DBHandle;
pFIBDS_SelPlace.Close;
OutPut:=TRxMemoryData.Create(self);
if GetUnivSprav(Params,OutPut)
then
begin
value:=output['id_CITY_AREA'];
DisplayText:=VarToStr(output['Name_CITY_AREA']);
end;
end;
procedure TAddModifAdrForm2.qFSC_AdressChange(Sender: TObject);
begin
qFSC_CArea.Clear;
end;
initialization
RegisterClass(TAddModifAdrForm2);
end.
|
unit Modules.Data;
interface
uses
System.SysUtils, System.Classes, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error,
FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async,
FireDAC.Phys, FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,
FireDAC.VCLUI.Wait, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Data.DB,
FireDAC.Comp.DataSet, FireDAC.Comp.Client, FireDAC.Phys.SQLiteWrapper.Stat,
FireDAC.Phys.SQLiteWrapper;
type
TDBController = class(TDataModule)
Connection: TFDConnection;
Locations: TFDQuery;
Racers: TFDQuery;
Clubs: TFDQuery;
procedure DataModuleCreate(Sender: TObject);
procedure DataModuleDestroy(Sender: TObject);
procedure sqRevCalculate(AFunc: TSQLiteFunctionInstance;
AInputs: TSQLiteInputs; AOutput: TSQLiteOutput; var AUserData: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure OpenRacers( AClubId: Integer );
end;
var
DBController: TDBController;
implementation
{%CLASSGROUP 'Vcl.Controls.TControl'}
{$R *.dfm}
procedure TDBController.DataModuleCreate(Sender: TObject);
begin
Clubs.Open;
Locations.Open;
end;
procedure TDBController.DataModuleDestroy(Sender: TObject);
begin
Racers.Close;
Locations.Close;
Connection.Close;
end;
procedure TDBController.OpenRacers(AClubId: Integer);
begin
Racers.Close;
// open racers and filter by club id
Racers.ParamByName('ID').AsInteger := AClubId;
Racers.Open;
end;
end.
|
unit uDateTimeFunctions;
interface
uses Sysutils, uMsgBox;
Type
TEnglishShortMonth = array[1..12] of String;
TEnglishLongMonth = array[1..12] of String;
TEnglishShortDay = array[1..7] of String;
TEnglishLongDay = array[1..7] of String;
TPortuguesShortMonth = array[1..12] of String;
TPortuguesLongMonth = array[1..12] of String;
TPortuguesShortDay = array[1..7] of String;
TPortuguesLongDay = array[1..7] of String;
TEspanholShortMonth = array[1..12] of String;
TEspanholLongMonth = array[1..12] of String;
TEspanholShortDay = array[1..7] of String;
TEspanholLongDay = array[1..7] of String;
Const
L_ENGLISH = 1;
L_PORTUGUESE = 2;
L_SPANISH = 3;
AEnglishShortMonth : TEnglishShortMonth = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
AEnglishLongMonth : TEnglishLongMonth = ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
AEnglishShortDay : TEnglishShortDay = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
AEnglishLongDay : TEnglishLongDay = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
APortuguesShortMonth : TPortuguesShortMonth = ('Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez');
APortuguesLongMonth : TPortuguesLongMonth = ('Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro');
APortuguesShortDay : TPortuguesShortDay = ('Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb');
APortuguesLongDay : TPortuguesLongDay = ('Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'sábado');
AEspanholShortMonth : TEspanholShortMonth = ('Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic');
AEspanholLongMonth : TEspanholLongMonth = ('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');
AEspanholShortDay : TEspanholShortDay = ('Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb');
AEspanholLongDay : TEspanholLongDay = ('Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado');
// Datas
function MyStrToDate(DateStr : String) : TDateTime;
function TestDate(DateStr : String) : Boolean;
function ShowPeriodo(DataIni, DataFim : String) : String;
function FirstDateMonth : TDateTime;
function LastDateMonth : TDateTime;
function InicioMes(MyDate: TDateTime): TDateTime;
function FimMes(MyDate: TDateTime): TDateTime;
function InicioSemana(MyDate: TDateTime): TDateTime;
function FimSemana(MyDate: TDateTime): TDateTime;
function GetPrimeiroDomingo(Ano: Integer): TDateTime;
function ValidTwoDates(DataIni, DataFim: String):Boolean;
function WeekDayName(dDate:TDateTime):String;
procedure ChangeLocalSetings(Lang:Integer);
//function AjustaVencimento(Vencimento: TDateTime): TDateTime;
implementation
procedure ChangeLocalSetings(Lang:Integer);
var
i : Integer;
begin
Case Lang of
L_ENGLISH :
begin
for i:=1 to 12 do
begin
ShortMonthNames[i] := AEnglishShortMonth[i];
LongMonthNames[i] := AEnglishLongMonth[i];
end;
for i:=1 to 7 do
begin
ShortDayNames[i] := AEnglishShortDay[i];
LongDayNames[i] := AEnglishLongDay[i];
end;
end;
L_PORTUGUESE :
begin
for i:=1 to 12 do
begin
ShortMonthNames[i] := APortuguesShortMonth[i];
LongMonthNames[i] := APortuguesLongMonth[i];
end;
for i:=1 to 7 do
begin
ShortDayNames[i] := APortuguesShortDay[i];
LongDayNames[i] := APortuguesLongDay[i];
end;
end;
L_SPANISH :
begin
for i:=1 to 12 do
begin
ShortMonthNames[i] := AEspanholShortMonth[i];
LongMonthNames[i] := AEspanholLongMonth[i];
end;
for i:=1 to 7 do
begin
ShortDayNames[i] := AEspanholShortDay[i];
LongDayNames[i] := AEspanholLongDay[i];
end;
end;
end;
end;
function MyStrToDate(DateStr : String) : TDateTime;
begin
try
Result := StrToDate(DateStr);
except
Result := Date;
end;
end;
function TestDate(DateStr : String) : Boolean;
begin
if DateStr = '' then
begin
Result := False;
Exit;
end;
try
StrToDate(DateStr);
Result := True;
except
Result := False;
end;
end;
function ShowPeriodo(DataIni, DataFim : String) : String;
begin
Result := 'Período de ' + DataIni + ' a ' + DataFim;
end;
function FirstDateMonth : TDateTime;
var
Day, Month, year : Word;
begin
DecodeDate(Date, Year, Month, Day);
Result := EncodeDate(Year, Month, 1);
end;
function LastDateMonth : TDateTime;
var
Day, Month, year : Word;
begin
DecodeDate(Date, Year, Month, Day);
if Month = 12 then
Result := EncodeDate(Year+1, 1, 1) - 1
else
Result := EncodeDate(Year, Month+1, 1) - 1;
end;
function InicioMes(MyDate: TDateTime): TDateTime;
var
Year, Month, Day: word;
begin
DecodeDate(Date(), Year, Month, Day);
Result := EncodeDate(Year, Month, 1);
end;
function FimMes(MyDate: TDateTime): TDateTime;
var
Year, Month, Day: word;
begin
DecodeDate(Date(), Year, Month, Day);
if Month = 12 then
begin
Month := 1;
Year := Year + 1;
end
else
Month := Month + 1;
Result := EncodeDate(Year, Month, 1) -1;
end;
function InicioSemana(MyDate: TDateTime): TDateTime;
begin
Result := MyDate - DayOfWeek(MyDate);
end;
function FimSemana(MyDate: TDateTime): TDateTime;
begin
Result := MyDate - DayOfWeek(MyDate) + 6;
end;
function GetPrimeiroDomingo(Ano: Integer): TDateTime;
begin
Result := EncodeDate(Ano, 1, 1)
+ (8 - DayOfWeek(EncodeDate(Ano, 1, 1)));
end;
function ValidTwoDates(DataIni, DataFim: String):Boolean;
begin
// Validar a date
Result := True;
if NOT TestDate(DataIni) then
begin
MsgBox('Invalid Start Date!', vbOkOnly + vbCritical);
Result := False;
Exit;
end;
if NOT TestDate(DataFim) then
begin
MsgBox('Invalid Final Date!', vbOkOnly + vbCritical);
Result := False;
Exit;
end;
if StrToDate(DataFim) < StrToDate(DataIni) then
begin
MsgBox('Final Date is smaller than Inicial Date!', vbOkOnly + vbCritical);
Result := False;
Exit;
end;
end;
function WeekDayName(dDate:TDateTime):String;
var
days: array[1..7] of string;
begin
days[1] := 'Sunday';
days[2] := 'Monday';
days[3] := 'Tuesday';
days[4] := 'Wednesday';
days[5] := 'Thursday';
days[6] := 'Friday';
days[7] := 'Saturday';
result := days[DayOfWeek(dDate)]
end;
end.
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, Buttons;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
ProgressBar1: TProgressBar;
Edit1: TEdit;
Edit2: TEdit;
SpeedButton1: TSpeedButton;
OpenDialog1: TOpenDialog;
SpeedButton2: TSpeedButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
function SplitFile(FileName : TFileName; SizeofFiles : Integer; ProgressBar : TProgressBar) : Boolean;
var
i : Word;
fs, sStream: TFileStream;
SplitFileName: String;
begin
ProgressBar.Position := 0;
fs := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
try
for i := 1 to Trunc(fs.Size / SizeofFiles) + 1 do
begin
SplitFileName := ChangeFileExt(FileName, '.'+ FormatFloat('000', i));
sStream := TFileStream.Create(SplitFileName, fmCreate or fmShareExclusive);
try
if fs.Size - fs.Position < SizeofFiles then
SizeofFiles := fs.Size - fs.Position;
sStream.CopyFrom(fs, SizeofFiles);
ProgressBar.Position := Round((fs.Position / fs.Size) * 100);
finally
sStream.Free;
end;
end;
finally
fs.Free;
end;
end;
function CombineFiles(FileName, CombinedFileName : TFileName) : Boolean;
var
i: integer;
fs, sStream: TFileStream;
filenameOrg: String;
begin
i := 1;
fs := TFileStream.Create(CombinedFileName, fmCreate or fmShareExclusive);
try
while FileExists(FileName) do
begin
sStream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
try
fs.CopyFrom(sStream, 0);
finally
sStream.Free;
end;
Inc(i);
FileName := ChangeFileExt(FileName, '.'+ FormatFloat('000', i));
end;
finally
fs.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
SplitFile(Edit1.Text, 200000, ProgressBar1);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
CombineFiles(Edit2.Text,ExtractFilePath(Application.ExeName)+'test.exe');
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if not OpenDialog1.Execute then Exit;
Edit1.Text:=OpenDialog1.FileName;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
if not OpenDialog1.Execute then Exit;
Edit2.Text:=OpenDialog1.FileName;
end;
end.
|
unit TesseractOCR;
{(C) Copyright 2007, J. Oosting
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. }
interface
uses Windows, SysUtils,Classes,Graphics,TESSDLL;
type EOCRDLL = class (SysUtils.Exception);
type
TRecognizer = class
private
FBitmap:TBitmap;
FLanguage: array[0..15] of char;
function ConvertEText_Desc2String(EText_Desc:PETEXT_DESC):string;
procedure SetLanguage(const Value: string);
procedure PrepareOCR;
procedure ReleaseOCR;
function GetLanguage: string;
published
constructor Create(aBitmap:TBitmap);
destructor Destroy;override;
function GetAllWords:string;
function GetABlock(block:TRect):string;
property Language:string read GetLanguage write SetLanguage;
End;
procedure GetOCRLanguages(langs:TStrings);
function OCRDLLLoaded:boolean;
implementation
uses Forms;
procedure GetOCRLanguages(langs: TStrings);
var
sr:TSearchRec;
res:integer;
dotpos:integer;
begin
langs.Clear;
// look in <appdir>tessdata for language files
res:=FindFirst(ExtractFilePath(Application.Exename)+'tessdata\*.inttemp',faAnyFile,sr);
try
while res=0 do
begin
dotpos:=Pos('.',sr.Name);
langs.Add(copy(sr.name,1,dotpos-1));
res:=FindNext(sr);
end;
finally
FindClose(sr);
end;
end;
function OCRDLLLoaded:boolean;
begin
result:=TessDLLLoaded;
end;
{ TRecognizer }
function TRecognizer.ConvertEText_Desc2String(EText_Desc: PETEXT_DESC): string;
var
i,b:integer;
ch:TEANYCODE_CHAR;
begin
result:='';
for I := 0 to EText_Desc^.Count - 1 do
begin
ch:=EText_Desc^.text[i];
for b:= 0 to ch.blanks - 1 do
result:=result+' ';
result:=result+chr(ch.char_code);
if (ch.formatting and 64) = 64 then // end of line
result:=result+chr(13)+chr(10);
if (ch.formatting and 128) = 128 then // end of paragraph
result:=result+chr(13)+chr(10)+chr(13)+chr(10);
end;
end;
constructor TRecognizer.Create(aBitmap: TBitmap);
const padding=32;
begin
if not OCRDLLLoaded then
raise EOCRDLL.Create('Tesseract DLL not loaded');
// make a copy so bitmap conversions will not change the original picture
fbitmap:=TBitmap.Create;
fBitmap.Assign(aBitmap);
FLanguage:='eng';
end;
destructor TRecognizer.Destroy;
begin
FBitmap.Free;
inherited;
end;
function TRecognizer.GetABlock(block: TRect): string;
var
RecognizedText:PETEXT_DESC;
begin
PrepareOCR;
if Integer(FBitmap.ScanLine[0])>Integer(FBitmap.ScanLine[1]) then
begin
Block.Top:=FBitmap.Height-Block.Top-1;
Block.Bottom:=FBitmap.Height-Block.Bottom-1;
end;
RecognizedText:=TessDllRecognize_a_Block(block.Left,block.Right,block.Top,block.Bottom);
result:=ConvertEText_Desc2String(RecognizedText);
ReleaseOCR;
end;
function TRecognizer.GetAllWords: string;
begin
result:=GetABlock(Rect(0,0,fBitmap.width-1,FBitmap.Height-1));
end;
function TRecognizer.GetLanguage: string;
begin
GetLanguage:=FLanguage;
end;
procedure TRecognizer.PrepareOCR;
var
bpp:integer;
BytesPerLine:integer;
VirtualWidth:integer;
begin
// make sure bitmap is DIB, will hopefully convert some types of bitmaps to recognizable pixelformats
FBitmap.HandleType:=bmDIB;
// convert non-supported bitmap formats and determine bpp
case FBitmap.PixelFormat of
pfDevice: begin
FBitmap.PixelFormat:=pf24bit;
bpp:=24;
end;
pf1bit: bpp:=1;
pf4bit: begin
FBitmap.PixelFormat:=pf8bit;
bpp:=8;
end;
pf8bit: bpp:=8;
pf15bit: begin
FBitmap.PixelFormat:=pf24bit;
bpp:=24;
end;
pf16bit: begin
FBitmap.PixelFormat:=pf24bit;
bpp:=24;
end;
pf24bit: bpp:=24;
pf32bit: begin
FBitmap.PixelFormat:=pf24bit;
bpp:=24;
end;
else // pfCustom
raise EInvalidGraphic.Create('Graphics format not recognized for OCR');
end;
// handle different types of bitmaps
// Bitmaps in Delphi are 4-byte aligned per line, images in Tesseract can be 1-byte aligned
// make sure that tesseract thinks lines are 4-byte aligned
BytesPerLine:=Integer(FBitmap.ScanLine[0])-Integer(FBitmap.ScanLine[1]);
case bpp of
1:VirtualWidth:=BytesPerLine*8;
8:VirtualWidth:=BytesPerLine;
else // 24:
fBitmap.Width:=4*((FBitmap.Width+3) div 4);
VirtualWidth:=FBitmap.Width;
end;
if BytesPerLine>0 then // usually Windows DIB
TessDllBeginPageLangBPP(VirtualWidth,FBitmap.Height,FBitmap.ScanLine[FBitmap.Height-1],FLanguage,bpp)
else // typical TIFF
TessDllBeginPageUprightBPP(VirtualWidth,FBitmap.Height,FBitmap.ScanLine[0],FLanguage,bpp);
end;
procedure TRecognizer.ReleaseOCR;
begin
TessDllEndPage;
end;
procedure TRecognizer.SetLanguage(const Value: string);
begin
StrPCopy(FLanguage, Value);
end;
end.
|
unit KonstantenUnit1;
interface
const
cStrFirma = 'Baumann';
cStrTitel = 'Titel';
cStrEinstellungen = 'Einstellungen';
cStrFehlermeldung = 'Meldung';
cIIdle = 0;
cILeseKurz = 1;
cILeseLange = 2;
cILeseExtrem = 4; // je ein eindeutiges BIT belegen, damit man odern kann
cStrFarbe = 'Farbe';
cStrText = 'Text';
cStrSchriftGroesse= 'SchriftGroesse';
cStrLinie = 'Rahmendicke';
cStrAbstand = 'Abstand';
type
TConfigStruktur = record
Ident,
Default,
Info : string;
end;
const
i_max = 6;
DefaultConfig : array[0..i_max-1] of TConfigStruktur =
(
( Ident:cStrTitel; Default:'Template'; Info:'Titel der Anwendung' ),
( Ident:cStrFarbe; Default:'red'; Info: 'Farbe des Rahmens und der Schrift' ),
( Ident:cStrText; Default:'I ♥ Buckenhofen'; Info:'Text im Bild' ),
( Ident:cStrSchriftGroesse; Default:'10'; Info:'Schriftgröße' ),
( Ident:cStrLinie; Default:'3'; Info:'Dicke des Rahmens' ),
( Ident:cStrAbstand; Default:'5'; Info:'Abstand des Rahmens vom Rand' )
);
implementation
end.
|
unit Grijjy.Accounts.iOS.API;
interface
uses
Macapi.ObjectiveC,
iOSapi.CocoaTypes,
iOSapi.Foundation;
const
libAccounts = '/System/Library/Frameworks/Accounts.framework/Accounts';
const
ACAccountCredentialRenewResultRenewed = 0;
ACAccountCredentialRenewResultRejected = 1;
ACAccountCredentialRenewResultFailed = 2;
type
id = pointer;
ACAccountCredentialRenewResult = NSInteger;
TACAccountStoreSaveCompletionHandler = procedure(success: boolean; error: NSError) of object;
TACAccountStoreRequestAccessCompletionHandler = procedure(granted: boolean; error: NSError) of object;
TACAccountStoreCredentialRenewalHandler = procedure(renewResult: Pointer; error: Pointer) of object;
// TACAccountStoreCredentialRenewalHandler = procedure(renewResult: ACAccountCredentialRenewResult; error: NSError) of object;
TACAccountStoreRemoveCompletionHandler = procedure(success: boolean; error: NSError) of object;
ACAccountCredentialClass = interface(NSObjectClass)
['{2E51DABF-F622-4B64-BEFF-F842D1C9CE55}']
end;
ACAccountCredential = interface(NSObject)
['{10364F41-00BF-492A-A332-82118DA4A14C}']
function initWithOAuthToken(token: NSString; tokenSecret: NSString): id; cdecl;
function initWithOAuth2Token(token: NSString; refreshToken: NSString; expiryDate: NSDate): id; cdecl;
function oauthToken: NSString; cdecl;
end;
TACAccountCredential = class(TOCGenericImport<ACAccountCredentialClass, ACAccountCredential>) end;
ACAccountTypeClass = interface(NSObjectClass)
['{EC4B3A71-60C4-484B-A033-C7FCC6469F7E}']
end;
ACAccountType = interface(NSObject)
['{91E09F0C-3FE8-497E-82E0-4D7FFE7E2DBC}']
function accessGranted: boolean; cdecl;
function accountTypeDescription: NSString; cdecl;
function identifier: NSString; cdecl;
end;
TACAccountType = class(TOCGenericImport<ACAccountTypeClass, ACAccountType>) end;
ACAccountClass = interface(NSObjectClass)
['{53F7AF2C-A723-44CC-ABAB-CE1787B4C7C0}']
end;
ACAccount = interface(NSObject)
['{527D16EE-9F66-4C88-A06B-F73B08727E5A}']
function initWithAccountType(&type: ACAccountType): id; cdecl;
function accountDescription: NSString; cdecl;
function accountType: ACAccountType; cdecl;
function credential: ACAccountCredential; cdecl;
function identifier: NSString; cdecl;
function username: NSString; cdecl;
end;
TACAccount = class(TOCGenericImport<ACAccountClass, ACAccount>) end;
ACAccountStoreClass = interface(NSObjectClass)
['{676F573F-9E07-46CE-AB77-AE401CFC19F6}']
end;
ACAccountStore = interface(NSObject)
['{AB75F1C4-5A92-433D-8E78-5EDC58C74EF9}']
function accounts: NSArray; cdecl;
function accountWithIdentifier(identifier: NSString): ACAccount; cdecl;
function accountsWithAccountType(accountType: ACAccountType): NSArray; cdecl;
function accountTypeWithAccountTypeIdentifier(typeIdentifier: NSString): ACAccountType; cdecl;
procedure saveAccount(account: ACAccount; completionHandler: TACAccountStoreSaveCompletionHandler); cdecl;
procedure requestAccessToAccountsWithType(accountType: ACAccountType; options: NSDictionary; completion: TACAccountStoreRequestAccessCompletionHandler); cdecl;
procedure renewCredentialsForAccount(account: ACAccount; completionHandler: TACAccountStoreCredentialRenewalHandler); cdecl;
procedure removeAccount(account: ACAccount; completionHandler: TACAccountStoreRemoveCompletionHandler); cdecl;
end;
TACAccountStore = class(TOCGenericImport<ACAccountStoreClass, ACAccountStore>) end;
function ACAccountTypeIdentifierFacebook: NSString; cdecl;
function ACAccountTypeIdentifierSinaWeibo: NSString; cdecl;
function ACAccountTypeIdentifierTwitter: NSString; cdecl;
function ACAccountTypeIdentifierTencentWeibo: NSString; cdecl;
implementation
function ACAccountTypeIdentifierFacebook: NSString; cdecl;
begin
Result := CocoaNSStringConst(libAccounts, 'ACAccountTypeIdentifierFacebook');
end;
function ACAccountTypeIdentifierSinaWeibo: NSString; cdecl;
begin
Result := CocoaNSStringConst(libAccounts, 'ACAccountTypeIdentifierSinaWeibo');
end;
function ACAccountTypeIdentifierTwitter: NSString; cdecl;
begin
Result := CocoaNSStringConst(libAccounts, 'ACAccountTypeIdentifierTwitter');
end;
function ACAccountTypeIdentifierTencentWeibo: NSString; cdecl;
begin
Result := CocoaNSStringConst(libAccounts, 'ACAccountTypeIdentifierTencentWeibo');
end;
procedure libAccountsLoader; cdecl; external libAccounts;
end.
|
//
// Created by the DataSnap proxy generator.
// 02/02/2014 13:09:35
//
unit uCC;
interface
uses Datasnap.DSProxyRest, Datasnap.DSClientRest, Data.DBXCommon, Data.DBXClient, Data.DBXDataSnap, Data.DBXJSON, Datasnap.DSProxy, System.Classes, System.SysUtils, Data.DB, Data.SqlExpr, Data.DBXDBReaders, Data.DBXCDSReaders, Data.DBXJSONReflect;
type
TSMClient = class(TDSAdminRestClient)
private
FEchoStringCommand: TDSRestCommand;
FReverseStringCommand: TDSRestCommand;
FretornaMeuNomeCommand: TDSRestCommand;
FGetDateTimeCommand: TDSRestCommand;
public
constructor Create(ARestConnection: TDSRestConnection); overload;
constructor Create(ARestConnection: TDSRestConnection; AInstanceOwner: Boolean); overload;
destructor Destroy; override;
function EchoString(Value: string; const ARequestFilter: string = ''): string;
function ReverseString(Value: string; const ARequestFilter: string = ''): string;
function retornaMeuNome(const ARequestFilter: string = ''): string;
function GetDateTime(const ARequestFilter: string = ''): string;
end;
const
TSM_EchoString: array [0..1] of TDSRestParameterMetaData =
(
(Name: 'Value'; Direction: 1; DBXType: 26; TypeName: 'string'),
(Name: ''; Direction: 4; DBXType: 26; TypeName: 'string')
);
TSM_ReverseString: array [0..1] of TDSRestParameterMetaData =
(
(Name: 'Value'; Direction: 1; DBXType: 26; TypeName: 'string'),
(Name: ''; Direction: 4; DBXType: 26; TypeName: 'string')
);
TSM_retornaMeuNome: array [0..0] of TDSRestParameterMetaData =
(
(Name: ''; Direction: 4; DBXType: 26; TypeName: 'string')
);
TSM_GetDateTime: array [0..0] of TDSRestParameterMetaData =
(
(Name: ''; Direction: 4; DBXType: 26; TypeName: 'string')
);
implementation
function TSMClient.EchoString(Value: string; const ARequestFilter: string): string;
begin
if FEchoStringCommand = nil then
begin
FEchoStringCommand := FConnection.CreateCommand;
FEchoStringCommand.RequestType := 'GET';
FEchoStringCommand.Text := 'TSM.EchoString';
FEchoStringCommand.Prepare(TSM_EchoString);
end;
FEchoStringCommand.Parameters[0].Value.SetWideString(Value);
FEchoStringCommand.Execute(ARequestFilter);
Result := FEchoStringCommand.Parameters[1].Value.GetWideString;
end;
function TSMClient.ReverseString(Value: string; const ARequestFilter: string): string;
begin
if FReverseStringCommand = nil then
begin
FReverseStringCommand := FConnection.CreateCommand;
FReverseStringCommand.RequestType := 'GET';
FReverseStringCommand.Text := 'TSM.ReverseString';
FReverseStringCommand.Prepare(TSM_ReverseString);
end;
FReverseStringCommand.Parameters[0].Value.SetWideString(Value);
FReverseStringCommand.Execute(ARequestFilter);
Result := FReverseStringCommand.Parameters[1].Value.GetWideString;
end;
function TSMClient.retornaMeuNome(const ARequestFilter: string): string;
begin
if FretornaMeuNomeCommand = nil then
begin
FretornaMeuNomeCommand := FConnection.CreateCommand;
FretornaMeuNomeCommand.RequestType := 'GET';
FretornaMeuNomeCommand.Text := 'TSM.retornaMeuNome';
FretornaMeuNomeCommand.Prepare(TSM_retornaMeuNome);
end;
FretornaMeuNomeCommand.Execute(ARequestFilter);
Result := FretornaMeuNomeCommand.Parameters[0].Value.GetWideString;
end;
function TSMClient.GetDateTime(const ARequestFilter: string): string;
begin
if FGetDateTimeCommand = nil then
begin
FGetDateTimeCommand := FConnection.CreateCommand;
FGetDateTimeCommand.RequestType := 'GET';
FGetDateTimeCommand.Text := 'TSM.GetDateTime';
FGetDateTimeCommand.Prepare(TSM_GetDateTime);
end;
FGetDateTimeCommand.Execute(ARequestFilter);
Result := FGetDateTimeCommand.Parameters[0].Value.GetWideString;
end;
constructor TSMClient.Create(ARestConnection: TDSRestConnection);
begin
inherited Create(ARestConnection);
end;
constructor TSMClient.Create(ARestConnection: TDSRestConnection; AInstanceOwner: Boolean);
begin
inherited Create(ARestConnection, AInstanceOwner);
end;
destructor TSMClient.Destroy;
begin
FEchoStringCommand.DisposeOf;
FReverseStringCommand.DisposeOf;
FretornaMeuNomeCommand.DisposeOf;
FGetDateTimeCommand.DisposeOf;
inherited;
end;
end.
|
unit uDM;
interface
uses
SysUtils, Classes, DB, DBClient, Forms, IdBaseComponent, IdComponent,
IdTCPServer, uInvoicePollDisplayConst, IniFiles, IdSocketHandle, Dialogs, uInvoicePollDisplay, uDMThread;
const
ADV_BITMAP = 0;
ADV_JPG = 1;
ADV_VIDEO = 2;
ADV_FLASH = 3;
ADV_WEB = 4;
ADV_BITMAP_EXT = 'Bitmap|*.bmp';
ADV_JPG_EXT = 'JPG|*.jpg';
ADV_VIDEO_EXT = 'Video|*.mpg|all|*.*';
ADV_FLASH_EXT = 'Flash File|*.swf';
ADV_WEB_EXT = 'HTML|*.html|ASP|*.asp';
SVR = 'Settings';
SVR_IP = 'IP';
SVR_PORT = 'Port';
SVR_LANGUAGE = 'Language';
type
TMRPDSConnectionData = class
FActualHeader: TMRPDSHeader;
FState: Integer;
FDMThread: TDMThread;
end;
TDM = class(TDataModule)
cdsAdvertising: TClientDataSet;
cdsAdvertisingDescription: TStringField;
cdsAdvertisingFileName: TStringField;
cdsAdvertisingStartDate: TDateTimeField;
cdsAdvertisingEndDate: TDateTimeField;
cdsAdvertisingDaysOfWeek: TStringField;
cdsAdvertisingDaysOfWeekString: TStringField;
cdsAdvertisingType: TIntegerField;
cdsAdvertisingTypeString: TStringField;
cdsAdvertisingDuration: TIntegerField;
cdsAdvertisingVideoControl: TBooleanField;
cdsAdvertisingDisplayDescription: TBooleanField;
cdsAdvertisingHours: TStringField;
cdsPoleDisplayClient: TClientDataSet;
cdsPoleDisplayClientDescription: TStringField;
cdsPoleDisplayClientIPAddress: TStringField;
cdsCrossSaleItem: TClientDataSet;
cdsCrossSaleItemID: TIntegerField;
cdsCrossSaleItemFileName: TStringField;
cdsCrossSaleItemFileType: TIntegerField;
cdsCrossSaleItemDuration: TIntegerField;
IdTCPServer: TIdTCPServer;
cdsPoleDisplayClientPort: TIntegerField;
cdsPoleDisplayClientID: TFloatField;
cdsCrossSaleItemHistory: TClientDataSet;
cdsCrossSaleItemHistoryModel: TStringField;
cdsCrossSaleItemHistoryItemDate: TDateTimeField;
cdsCrossSaleItemHistoryRegister: TStringField;
cdsCrossSaleItemModelNum: TStringField;
cdsCrossSaleItemCrossDescription: TStringField;
cdsCrossSaleItemCrossSalePrice: TCurrencyField;
cdsCrossSaleItemModelCategory: TStringField;
cdsCrossSaleItemModelSubCategory: TStringField;
cdsCrossSaleItemModelGroup: TStringField;
cdsAdvertisingID: TIntegerField;
procedure DataModuleCreate(Sender: TObject);
procedure DataModuleDestroy(Sender: TObject);
procedure cdsAdvertisingNewRecord(DataSet: TDataSet);
procedure cdsAdvertisingCalcFields(DataSet: TDataSet);
procedure IdTCPServerException(AThread: TIdPeerThread;
AException: Exception);
procedure IdTCPServerExecute(AThread: TIdPeerThread);
procedure IdTCPServerConnect(AThread: TIdPeerThread);
procedure IdTCPServerDisconnect(AThread: TIdPeerThread);
private
FServerIP : String;
FServerPort : Integer;
FLocalPath : String;
procedure CloseAdvertising;
procedure OpenAdvertising;
procedure LoadAdvertising;
procedure ClosePoleClient;
procedure OpenPoleClient;
procedure LoadPoleClient;
procedure SavePoleClient;
procedure CloseCrossSaleItem;
procedure OpenCrossSaleItem;
procedure LoadCrossSaleItem;
procedure CloseCrossSaleItemHistory;
procedure OpenCrossSaleItemHistory;
procedure LoadCrossSaleItemHistory;
procedure SaveCrossSaleItemHistory(AModel, ARegister : String; ADate: TDateTime);
procedure StartServer;
procedure StopServer;
procedure AddPoleClient(AText : String);
function RequestCrossSellItem(AText : String): String;
public
FLastDesc: Integer;
FConfigFile: TIniFile;
procedure RefreshAdvertising;
procedure SaveAdvertising;
procedure RefreshCrossSaleItem;
procedure SaveCrossSaleItem;
procedure RefreshSettings;
property LocalPath : String read FLocalPath;
property ServerIP : String read FServerIP write FServerIP;
property ServerPort : Integer read FServerPort write FServerPort;
end;
var
DM: TDM;
implementation
uses uParamFunctions, uPoleDisplay, uDMGlobal;
{$R *.dfm}
procedure TDM.CloseAdvertising;
begin
with cdsAdvertising do
if Active then
Close;
end;
procedure TDM.DataModuleCreate(Sender: TObject);
begin
FLastDesc := 0;
FLocalPath := ExtractFilePath(Application.ExeName);
if not FileExists(ChangeFileExt( Application.ExeName, '.ini')) then
FileCreate(ChangeFileExt( Application.ExeName, '.ini'));
FConfigFile := TIniFile.Create(ChangeFileExt( Application.ExeName, '.ini'));
RefreshSettings;
OpenPoleClient;
OpenCrossSaleItem;
OpenCrossSaleItemHistory;
OpenAdvertising;
LoadAdvertising;
end;
procedure TDM.DataModuleDestroy(Sender: TObject);
begin
StopServer;
FreeAndNil(FConfigFile);
CloseAdvertising;
ClosePoleClient;
CloseCrossSaleItem;
CloseCrossSaleItemHistory;
end;
procedure TDM.LoadAdvertising;
begin
if FileExists(FLocalPath + 'SVR_Advertising.xml') then
cdsAdvertising.LoadFromFile(FLocalPath + 'SVR_Advertising.xml');
end;
procedure TDM.OpenAdvertising;
begin
with cdsAdvertising do
if not Active then
begin
CreateDataSet;
LoadAdvertising;
end;
end;
procedure TDM.RefreshAdvertising;
begin
CloseAdvertising;
OpenAdvertising;
end;
procedure TDM.SaveAdvertising;
begin
cdsAdvertising.SaveToFile(FLocalPath + 'SVR_Advertising.xml');
end;
procedure TDM.cdsAdvertisingNewRecord(DataSet: TDataSet);
begin
cdsAdvertisingDuration.AsInteger := 10;
cdsAdvertisingVideoControl.AsBoolean := False;
cdsAdvertisingStartDate.AsDateTime := Trunc(Now);
cdsAdvertisingEndDate.AsDateTime := Trunc(IncMonth(Now, 4));
cdsAdvertisingType.AsInteger := 1;
cdsAdvertisingDescription.AsString := IntToStr(FLastDesc+1);
cdsAdvertisingDisplayDescription.AsBoolean := False;
cdsAdvertisingID.AsFloat := StrToFloat(FormatDateTime('mmddyyyyhhnnss', now));
end;
procedure TDM.cdsAdvertisingCalcFields(DataSet: TDataSet);
var
FWeekDays : String;
begin
FWeekDays := '';
if Pos('1,', cdsAdvertisingDaysOfWeek.AsString) > 0 then
FWeekDays := FWeekDays + 'Monday; ';
if Pos('2,' ,cdsAdvertisingDaysOfWeek.AsString) > 0 then
FWeekDays := FWeekDays + 'Tuesday; ';
if Pos('3,' ,cdsAdvertisingDaysOfWeek.AsString) > 0 then
FWeekDays := FWeekDays + 'Wednesday; ';
if Pos('4,' ,cdsAdvertisingDaysOfWeek.AsString) > 0 then
FWeekDays := FWeekDays + 'Thursday; ';
if Pos('5,' ,cdsAdvertisingDaysOfWeek.AsString) > 0 then
FWeekDays := FWeekDays + 'Friday; ';
if Pos('6,' ,cdsAdvertisingDaysOfWeek.AsString) > 0 then
FWeekDays := FWeekDays + 'Saturday; ';
if Pos('7,' ,cdsAdvertisingDaysOfWeek.AsString) > 0 then
FWeekDays := FWeekDays + 'Sunday; ';
cdsAdvertisingDaysOfWeekString.AsString := FWeekDays;
case cdsAdvertisingType.AsInteger of
ADV_BITMAP : cdsAdvertisingTypeString.AsString := 'Bitmap';
ADV_JPG : cdsAdvertisingTypeString.AsString := 'JPG';
ADV_VIDEO : cdsAdvertisingTypeString.AsString := 'Video';
ADV_FLASH : cdsAdvertisingTypeString.AsString := 'Flash';
ADV_WEB : cdsAdvertisingTypeString.AsString := 'Website';
end;
end;
procedure TDM.RefreshSettings;
begin
FServerIP := FConfigFile.ReadString(SVR, SVR_IP, '');
FServerPort := FConfigFile.ReadInteger(SVR, SVR_PORT, 7887);
DMGlobal.IDLanguage := FConfigFile.ReadInteger(SVR, SVR_LANGUAGE, 1);
StartServer;
end;
procedure TDM.StartServer;
var
Binding : TIdSocketHandle;
begin
if IdTCPServer.Active then
IdTCPServer.Active := False;
if FServerIP <> '' then
begin
IdTCPServer.Bindings.Clear;
try
Binding := IdTCPServer.Bindings.Add;
Binding.IP := FServerIP;
Binding.Port := FServerPort;
IdTCPServer.Active := True;
except
on E : Exception do
begin
ShowMessage(E.Message);
end;
end;
end;
end;
procedure TDM.IdTCPServerException(AThread: TIdPeerThread;
AException: Exception);
begin
if AException.Message = 'EIdConnClosedGracefully' then
begin
//process some code here if you want.
end;
end;
procedure TDM.IdTCPServerExecute(AThread: TIdPeerThread);
var
ConData: TMRPDSConnectionData;
HeaderStream, SendingStream,
ReceivingStream: TMemoryStream;
SendingHeader: TMRPDSHeader;
begin
ConData := TMRPDSConnectionData(AThread.Data);
if AThread.Connection.Connected then
case ConData.FState of
STATE_WAITING_HEADER:
begin
ReceivingStream := TMemoryStream.Create;
try
AThread.Connection.ReadStream(ReceivingStream, SizeOf(TMRPDSHeader));
ReceivingStream.Seek(0, soFromBeginning);
ConData.FActualHeader := TMRPDSHeader(ReceivingStream.Memory^);
finally
FreeAndNil(ReceivingStream);
end;
ConData.FState := STATE_WAITING_BODY;
end;
STATE_WAITING_BODY:
begin
ReceivingStream := TMemoryStream.Create;
try
AThread.Connection.ReadStream(ReceivingStream, ConData.FActualHeader.ByteCount);
ReceivingStream.Seek(0, soFromBeginning);
if (ConData.FActualHeader.BodyType in [pdsAdvertising, pdsCrossSaleItem ,pdsCrossSaleItemHistory]) then
begin
SendingStream := TMemoryStream.Create;
try
HeaderStream := TMemoryStream.Create;
try
case ConData.FActualHeader.BodyType of
pdsAdvertising:
begin
ConData.FDMThread.LoadAdvertiseStream(SendingStream);
end;
pdsCrossSaleItem:
begin
ConData.FDMThread.LoadCrossSaleItemStream(SendingStream);
end;
pdsCrossSaleItemHistory:
begin
ConData.FDMThread.LoadCrossSaleItemHistoryStream(SendingStream);
end;
end;
SendingHeader.BodyType := ConData.FActualHeader.BodyType;
SendingHeader.ByteCount := SendingStream.Size;
HeaderStream.WriteBuffer(SendingHeader, SizeOf(TMRPDSHeader));
HeaderStream.Seek(0, soFromBeginning);
AThread.Connection.WriteStream(HeaderStream);
AThread.Connection.WriteStream(SendingStream);
finally
HeaderStream.Clear;
HeaderStream.Free;
end;
finally
SendingStream.Clear;
SendingStream.Free;
end;
end;
finally
FreeAndNil(ReceivingStream);
end;
ConData.FState := STATE_WAITING_HEADER;
end;
end;
(*
AOutPut := AThread.Connection.ReadLn;
// Requisição
if Copy(AOutPut, 0, Length(SVR_POLE_DISPLAY_CLIENT + ';')) = (SVR_POLE_DISPLAY_CLIENT+';') then
AddPoleClient(AOutPut)
// Retorna CDS de Venda casada
else if Copy(AOutPut, 0, Length(CROSS_SELL + ';')) = (CROSS_SELL+';') then
begin
AInput := RequestCrossSellItem(AOutPut);
if AInput <> '' then
AThread.Connection.WriteLn(AInput);
end
// Retorna CDS de Advertising
else if Copy(AOutPut, 0, Length(ADVERTISING_LIST + ';')) = (ADVERTISING_LIST+';') then
begin
OpenAdvertising;
with cdsAdvertising do
begin
try
Filtered := False;
Filter := 'StartDate <= ' + QuotedStr(FormatDateTime('ddddd', Now)) +
' AND EndDate > ' + QuotedStr(FormatDateTime('ddddd', Now));
Filtered := True;
First;
AInput := '';
while not EOF do
begin
if AInput = '' then
AInput := FieldByName('ID').AsString
else if FieldByName('ID').AsString <> '' then
AInput := AInput + ',' + FieldByName('ID').AsString;
Next;
end;
finally
Filtered := False;
Filter := '';
Filtered := True;
end;
AThread.Connection.WriteLn(AInput);
end;
// Retorna CDS cada Advertising totalmente e exclusivo pelo ID
end else if Copy(AOutPut, 0, Length(ADVERTISING_ID)) = (ADVERTISING_ID) then
begin
OpenAdvertising;
with cdsAdvertising do
begin
First;
AInput := '';
if Locate('ID', ParseParam(AOutPut, ADVERTISING_ID),[]) then
begin
AInput := FormatAdvertising(FieldByName('ID').AsString,
FieldByName('Description').AsString,
FieldByName('FileName').AsString,
FormatDateTime('yyyy-mm-dd', FieldByName('StartDate').AsDateTime),
FormatDateTime('yyyy-mm-dd', FieldByName('EndDate').AsDateTime),
FieldByName('DaysOfWeek').AsString,
FieldByName('Type').AsString,
FieldByName('Duration').AsString,
FieldByName('VideoControl').AsString,
FieldByName('DisplayDescription').AsString,
FieldByName('Hours').AsString);
AThread.Connection.WriteLn(AInput);
end;
end;
end;
*)
end;
procedure TDM.AddPoleClient(AText: String);
begin
if (ParseParam(AText, SVR_POLE_DISPLAY_CLIENT_IP) <> '') then
with cdsPoleDisplayClient do
begin
if not Locate('IPAddress', ParseParam(AText, SVR_POLE_DISPLAY_CLIENT_IP), []) then
begin
Append;
FieldByName('ID').AsFloat := StrToFloat(FormatDateTime('mmddyyyyhhnnss', now));
FieldByName('Description').AsString := ParseParam(AText, SVR_POLE_DISPLAY_CLIENT_DESCRIPTION);
FieldByName('IPAddress').AsString := ParseParam(AText, SVR_POLE_DISPLAY_CLIENT_IP);
FieldByName('Port').AsInteger := StrToInt(ParseParam(AText, SVR_POLE_DISPLAY_CLIENT_PORT));
Post;
SavePoleClient;
end;
end;
end;
procedure TDM.ClosePoleClient;
begin
with cdsPoleDisplayClient do
if Active then
Close;
end;
procedure TDM.OpenPoleClient;
begin
with cdsPoleDisplayClient do
if not Active then
begin
CreateDataSet;
LoadPoleClient;
end;
end;
procedure TDM.LoadPoleClient;
begin
if FileExists(FLocalPath + 'SVR_PoleClient.xml') then
cdsPoleDisplayClient.LoadFromFile(FLocalPath + 'SVR_PoleClient.xml');
end;
procedure TDM.SavePoleClient;
begin
try
cdsPoleDisplayClient.SaveToFile(FLocalPath + 'SVR_PoleClient.xml');
except
end;
end;
function TDM.RequestCrossSellItem(AText: String): String;
var
iCount : Integer;
begin
Result := '';
with cdsCrossSaleItem do
if Locate('ModelNum', ParseParam(AText, CROSS_SELL_ITEM), []) then
try
Filtered := False;
Filter := 'ModelNum = ' + QuotedStr(ParseParam(AText, CROSS_SELL_ITEM));
Filtered := True;
//Save Model to history
SaveCrossSaleItemHistory(ParseParam(AText, CROSS_SELL_ITEM),
ParseParam(AText, CROSS_SELL_REGISTER),
Now);
//Loop Return Item advertising
iCount := 0;
First;
While not EOF do
begin
inc(iCount);
Result := Result + BuildInput(CROSS_ITEMS_FILE + '_' + IntToStr(iCount), FieldByName('FileName').AsString) +
BuildInput(CROSS_ITEMS_TYPE + '_' + IntToStr(iCount), FieldByName('FileType').AsString) +
BuildInput(CROSS_ITEMS_TIME + '_' + IntToStr(iCount), FieldByName('Duration').AsString);
Next;
end;
Result := CROSS_ITEMS + ';' +
BuildInput(CROSS_ITEMS_COUNT, intToStr(iCount)) +
Result;
finally
Filtered := False;
Filter := '';
Filtered := True;
end;
end;
procedure TDM.CloseCrossSaleItem;
begin
with cdsCrossSaleItem do
if Active then
Close;
end;
procedure TDM.LoadCrossSaleItem;
begin
if FileExists(FLocalPath + 'SVR_CrossSaleItem.xml') then
cdsCrossSaleItem.LoadFromFile(FLocalPath + 'SVR_CrossSaleItem.xml');
end;
procedure TDM.OpenCrossSaleItem;
begin
with cdsCrossSaleItem do
if not Active then
begin
CreateDataSet;
LoadCrossSaleItem;
end;
end;
procedure TDM.SaveCrossSaleItem;
begin
try
cdsCrossSaleItem.SaveToFile(FLocalPath + 'SVR_CrossSaleItem.xml');
except
end;
end;
procedure TDM.CloseCrossSaleItemHistory;
begin
with cdsCrossSaleItemHistory do
if Active then
Close;
end;
procedure TDM.LoadCrossSaleItemHistory;
begin
if FileExists(FLocalPath + 'SVR_CrossSaleItemHistory.xml') then
cdsCrossSaleItemHistory.LoadFromFile(FLocalPath + 'SVR_CrossSaleItemHistory.xml');
end;
procedure TDM.OpenCrossSaleItemHistory;
begin
with cdsCrossSaleItemHistory do
if not Active then
begin
CreateDataSet;
LoadCrossSaleItemHistory;
end;
end;
procedure TDM.SaveCrossSaleItemHistory(AModel, ARegister : String; ADate: TDateTime);
begin
with cdsCrossSaleItemHistory do
begin
Append;
FieldByName('Model').AsString := AModel;
FieldByName('Register').AsString := ARegister;
FieldByName('ItemDate').AsDateTime := ADate;
Post;
end;
try
cdsCrossSaleItemHistory.SaveToFile(FLocalPath + 'SVR_CrossSaleItemHistory.xml');
except
end;
end;
procedure TDM.RefreshCrossSaleItem;
begin
CloseCrossSaleItem;
OpenCrossSaleItem;
end;
procedure TDM.StopServer;
var
i: Integer;
Binding: TIdSocketHandle;
begin
if IdTCPServer.Threads <> nil then
begin
with IdTCPServer.Threads.LockList do
try
for i := 0 to Count - 1 do
TIdPeerThread(Items[i]).Connection.DisconnectSocket;
finally
IdTCPServer.Threads.UnlockList;
end;
end;
IdTCPServer.Active := False;
while IdTCPServer.Bindings.Count > 0 do
begin
Binding := IdTCPServer.Bindings.Items[0];
FreeAndNil(Binding);
end;
IdTCPServer.Bindings.Clear;
end;
procedure TDM.IdTCPServerConnect(AThread: TIdPeerThread);
begin
AThread.Data := TMRPDSConnectionData.Create;
with TMRPDSConnectionData(AThread.Data) do
begin
FState := STATE_WAITING_HEADER;
FDMThread := TDMThread.Create(nil);
end;
end;
procedure TDM.IdTCPServerDisconnect(AThread: TIdPeerThread);
var
ThreadData : TMRPDSConnectionData;
begin
ThreadData := TMRPDSConnectionData(AThread.Data);
AThread.Data := nil;
FreeAndNil(ThreadData.FDMThread);
FreeAndNil(ThreadData);
end;
end.
|
//
// Generated by JavaToPas v1.5 20180804 - 082459
////////////////////////////////////////////////////////////////////////////////
unit android.provider.FontsContract_FontRequestCallback;
interface
uses
AndroidAPI.JNIBridge,
Androidapi.JNI.JavaTypes,
android.graphics.Typeface;
type
JFontsContract_FontRequestCallback = interface;
JFontsContract_FontRequestCallbackClass = interface(JObjectClass)
['{BAA5068F-83CE-4781-915E-24999FF16AF3}']
function _GetFAIL_REASON_FONT_LOAD_ERROR : Integer; cdecl; // A: $19
function _GetFAIL_REASON_FONT_NOT_FOUND : Integer; cdecl; // A: $19
function _GetFAIL_REASON_FONT_UNAVAILABLE : Integer; cdecl; // A: $19
function _GetFAIL_REASON_MALFORMED_QUERY : Integer; cdecl; // A: $19
function _GetFAIL_REASON_PROVIDER_NOT_FOUND : Integer; cdecl; // A: $19
function _GetFAIL_REASON_WRONG_CERTIFICATES : Integer; cdecl; // A: $19
function init : JFontsContract_FontRequestCallback; cdecl; // ()V A: $1
procedure onTypefaceRequestFailed(reason : Integer) ; cdecl; // (I)V A: $1
procedure onTypefaceRetrieved(typeface : JTypeface) ; cdecl; // (Landroid/graphics/Typeface;)V A: $1
property FAIL_REASON_FONT_LOAD_ERROR : Integer read _GetFAIL_REASON_FONT_LOAD_ERROR;// I A: $19
property FAIL_REASON_FONT_NOT_FOUND : Integer read _GetFAIL_REASON_FONT_NOT_FOUND;// I A: $19
property FAIL_REASON_FONT_UNAVAILABLE : Integer read _GetFAIL_REASON_FONT_UNAVAILABLE;// I A: $19
property FAIL_REASON_MALFORMED_QUERY : Integer read _GetFAIL_REASON_MALFORMED_QUERY;// I A: $19
property FAIL_REASON_PROVIDER_NOT_FOUND : Integer read _GetFAIL_REASON_PROVIDER_NOT_FOUND;// I A: $19
property FAIL_REASON_WRONG_CERTIFICATES : Integer read _GetFAIL_REASON_WRONG_CERTIFICATES;// I A: $19
end;
[JavaSignature('android/provider/FontsContract_FontRequestCallback')]
JFontsContract_FontRequestCallback = interface(JObject)
['{6465B39C-EE62-4F60-9A3F-DD3E0E871BC4}']
procedure onTypefaceRequestFailed(reason : Integer) ; cdecl; // (I)V A: $1
procedure onTypefaceRetrieved(typeface : JTypeface) ; cdecl; // (Landroid/graphics/Typeface;)V A: $1
end;
TJFontsContract_FontRequestCallback = class(TJavaGenericImport<JFontsContract_FontRequestCallbackClass, JFontsContract_FontRequestCallback>)
end;
const
TJFontsContract_FontRequestCallbackFAIL_REASON_FONT_LOAD_ERROR = -3;
TJFontsContract_FontRequestCallbackFAIL_REASON_FONT_NOT_FOUND = 1;
TJFontsContract_FontRequestCallbackFAIL_REASON_FONT_UNAVAILABLE = 2;
TJFontsContract_FontRequestCallbackFAIL_REASON_MALFORMED_QUERY = 3;
TJFontsContract_FontRequestCallbackFAIL_REASON_PROVIDER_NOT_FOUND = -1;
TJFontsContract_FontRequestCallbackFAIL_REASON_WRONG_CERTIFICATES = -2;
implementation
end.
|
program LightFileStreamExample;
{$mode Delphi}{$H+}{$J-}{$I-}{$R-}
uses SysUtils, LightFileStream;
type
TDataRec = record
S: Single;
B: Boolean;
C: AnsiChar;
end;
const
DAA: array[0..5] of Double = (1.11, 2.22, 3.33, 4.44, 5.55, 6.66);
DRA: TDataRec = (S: 1.0; B: True; C: 'A');
var
D: Double;
DAB: array of Double;
SA: AnsiString = 'hello';
SB: AnsiString = ' ';
IA: SizeInt;
C: Char;
CAA: array[0..5] of Char = (#0, #0, #0, #0, #0, #0);
H: UnicodeString = ' ';
G: UnicodeString = ' ';
IB: LongInt;
FA: Single;
DRB: TDataRec;
LS: TLightFileStream;
PLS: PLightFileStream;
begin
SetLength(DAB, 28);
// If using the library in a {$mode ObjFPC} project, you can still use {$modeswitch AutoDeref}
// to avoid having to manually dereference after each chained function call.
TLightFileStream.Create('Example1.txt')
.WriteTypedBuffer<Double>(DAA[0], 6)
.WriteTypedBuffer<Double>(DAA[0], 6)
.SeekFromBeginning(0)
.AppendTypedBuffer<Double>(DAA[0], 6)
.WritePointerBuffer(@DAA[0], SizeOf(Double) * 6)
.WriteDouble(99.99)
.SeekFromBeginning(0)
.AppendDouble(128.12)
.WriteType<Double>(77.77)
.WriteDouble(345.34)
.ChangeFileStateTo(fsReading)
.ReadPointerBuffer(@DAB[0], SizeOf(Double) * 28)
.Close();
for D in DAB do WriteLn(D : 0 : 2);
TLightFileStream.Create('Example2.txt')
.WriteAnsiString(SA)
.ChangeFileStateTo(fsReading)
.ReadAnsiString(SB, 5)
.Close();
WriteLn(SB);
TLightFileStream.Create('Example3.txt')
.WriteQWord(1)
.WriteDouble(2.0)
.WriteSingle(3.9)
.WriteType<QWord>(4)
.WriteType<Double>(5.7)
.WriteType<Single>(6.8)
.SeekFromBeginning(0)
.LogSize()
.LogPosition()
.GetSize(IA)
.SeekFromBeginning(IA div 2)
.Truncate()
.LogSize()
.LogPosition()
.Close();
TLightFileStream.Create('Example4.txt')
.FillWith<Char>('Z', 6)
.ChangeFileStateTo(fsReading)
.ReadTypedBuffer<Char>(CAA[0], 6)
.Close();
for C in CAA do WriteLn(C);
// The library can also of course be used without fully chaining everything.
// The next line makes the LS variable our base non-pointer instance of the TLightFileStream record.
LS := TLightFileStream.Create('Example5.txt');
// It's fine to call any of the functions that return a self-pointer without the result connecting to anything.
// In that case, the self-pointer is just discarded. The next line shows an example of this.
LS.WriteUnicodeString('hello')
.WriteUnicodeString('goodbye');
// You can also have a named PLightFileStream variable and assign the self-pointer results to it, as shown on the next line.
PLS := LS.WriteLongInt(1)
.WriteSingle(2.94)
.WriteType<TDataRec>(DRA);
// At this point, accessing either LS or PLS does the same thing, as PLS is just a pointer to LS.
// So on the next line, we'll do something similar to the one above, but both starting from and returning into PLS.
PLS := PLS.ChangeFileStateTo(fsReading)
.ReadUnicodeString(H, 5)
.ReadUnicodeString(G, 7)
.ReadLongInt(IB)
.ReadSingle(FA)
.ReadType<TDataRec>(DRB);
// Next we'll display the values...
WriteLn(H);
WriteLn(G);
WriteLn(IB);
WriteLn(FA : 0 : 2);
with DRB do begin
WriteLn(S : 0 : 2);
WriteLn(B);
WriteLn(C);
end;
// And finally we'll close the file through PLS.
PLS.Close();
DeleteFile('Example1.txt');
DeleteFile('Example2.txt');
DeleteFile('Example3.txt');
DeleteFile('Example4.txt');
DeleteFile('Example5.txt');
end.
|
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Samples.Spin;
//Clas TVehicle
type
TVehicle = class
private
FColor :String;
FName : String;
FSpeed :Integer;
protected
function VehicleIsOn:String; Virtual ; Abstract;
public
constructor Create(ncolor ,name:String;speed: Integer);
end;
type
TAuto=class (TVehicle)
var
protected
function VehicleIsOn: String; Override;
public
end;
type
TMotorad=class (TVehicle)
private
vehicleOnOf :String ;
var
function VehicleIsOn : String; Override;
end;
type
TForm1 = class(TForm)
Button1: TButton;
LVehicle: TLabel;
LColor: TLabel;
LSpeed: TLabel;
LVehicleOnOf: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
Motorad:TMotorad;
Auto:TAuto;
implementation
{$R *.dfm}
constructor TVehicle.Create(ncolor ,name:String;speed: Integer);
begin
FColor := ncolor;
FName := name;
FSpeed:=speed;
VehicleIsOn;;
end;
function TAuto.VehicleIsOn:STring;
begin
end;
function TMotorad.VehicleIsOn:String;
begin
Result:='Motorad ist an';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
LVehicleOnOf.Caption:= motorad.VehicleIsOn;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
motorad := TMotorad.Create('Weiß','Motorad',250);
LColor.Caption:=motorad.FColor;
LVehicle.Caption:=motorad.FName;
LSpeed.Caption:=motorad.FSpeed.ToString();
end;
end.
|
unit InflatablesList_ItemShopParsingSettings_Base;
{$INCLUDE '.\InflatablesList_defs.inc'}
interface
uses
AuxTypes,
InflatablesList_Types,
InflatablesList_HTML_ElementFinder;
type
TILItemShopParsingSettings_Base = class(TObject)
protected
// internals
fStaticSettings: TILStaticManagerSettings;
fRequiredCount: UInt32;
// data
fVariables: TILItemShopParsingVariables;
fTemplateRef: String;
fDisableParsErrs: Boolean;
fAvailExtrSetts: TILItemShopParsingExtrSettList;
fAvailFinder: TILElementFinder;
fPriceExtrSetts: TILItemShopParsingExtrSettList;
fPriceFinder: TILElementFinder;
procedure SetStaticSettings(Value: TILStaticManagerSettings); virtual;
procedure SetRequiredCount(Value: Uint32); virtual;
// data getters and setters
Function GetVariableCount: Integer; virtual;
Function GetVariable(Index: Integer): String; virtual;
procedure SetVariable(Index: Integer; const Value: String); virtual;
procedure SetTemplateRef(const Value: String); virtual;
procedure SetDisableParsErrs(Value: Boolean); virtual;
Function GetAvailExtrSettCount: Integer; virtual;
Function GetAvailExtrSett(Index: Integer): TILItemShopParsingExtrSett; virtual;
procedure SetAvailExtrSett(Index: Integer; Value: TILItemShopParsingExtrSett); virtual;
Function GetPriceExtrSettCount: Integer; virtual;
Function GetPriceExtrSett(Index: Integer): TILItemShopParsingExtrSett; virtual;
procedure SetPriceExtrSett(Index: Integer; Value: TILItemShopParsingExtrSett); virtual;
// other protected methods
procedure InitializeData; virtual;
procedure FinalizeData; virtual;
procedure Initialize; virtual;
procedure Finalize; virtual;
public
constructor Create;
constructor CreateAsCopy(Source: TILItemShopParsingSettings_Base; UniqueCopy: Boolean);
destructor Destroy; override;
// extraction settings lists
Function AvailExtractionSettingsAdd: Integer; virtual;
procedure AvailExtractionSettingsDelete(Index: Integer); virtual;
procedure AvailExtractionSettingsClear; virtual;
Function PriceExtractionSettingsAdd: Integer; virtual;
procedure PriceExtractionSettingsDelete(Index: Integer); virtual;
procedure PriceExtractionSettingsClear; virtual;
// properties
property StaticSettings: TILStaticManagerSettings read fStaticSettings write SetStaticSettings;
property RequiredCount: UInt32 read fRequiredCount write SetRequiredCount;
// data
property VariableCount: Integer read GetVariableCount;
property Variables[Index: Integer]: String read GetVariable write SetVariable;
property VariablesRec: TILItemShopParsingVariables read fVariables;
property TemplateReference: String read fTemplateRef write SetTemplateRef;
property DisableParsingErrors: Boolean read fDisableParsErrs write SetDisableParsErrs;
property AvailExtractionSettingsCount: Integer read GetAvailExtrSettCount;
property AvailExtractionSettings[Index: Integer]: TILItemShopParsingExtrSett read GetAvailExtrSett write SetAvailExtrSett;
property AvailFinder: TILElementFinder read fAvailFinder;
property PriceExtractionSettingsCount: Integer read GetPriceExtrSettCount;
property PriceExtractionSettings[Index: Integer]: TILItemShopParsingExtrSett read GetPriceExtrSett write SetPriceExtrSett;
property PriceFinder: TILElementFinder read fPriceFinder;
end;
implementation
uses
SysUtils,
InflatablesList_Utils;
procedure TILItemShopParsingSettings_Base.SetStaticSettings(Value: TILStaticManagerSettings);
begin
fStaticSettings := IL_ThreadSafeCopy(Value);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.SetRequiredCount(Value: Uint32);
begin
If fRequiredCount <> Value then
begin
fRequiredCount := Value;
end;
end;
//------------------------------------------------------------------------------
Function TILItemShopParsingSettings_Base.GetVariableCount: Integer;
begin
Result := Length(fVariables.Vars);
end;
//------------------------------------------------------------------------------
Function TILItemShopParsingSettings_Base.GetVariable(Index: Integer): String;
begin
If (Index >= Low(fVariables.Vars)) and (Index <= High(fVariables.Vars)) then
Result := fVariables.Vars[Index]
else
raise Exception.CreateFmt('TILItemShopParsingSettings_Base.GetVariable: Index (%d) out of bounds.',[Index]);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.SetVariable(Index: Integer; const Value: String);
begin
If (Index >= Low(fVariables.Vars)) and (Index <= High(fVariables.Vars)) then
begin
If not IL_SameStr(fVariables.Vars[Index],Value) then
begin
fVariables.Vars[Index] := Value;
UniqueString(fVariables.Vars[Index]);
end;
end
else raise Exception.CreateFmt('TILItemShopParsingSettings_Base.SetVariable: Index (%d) out of bounds.',[Index]);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.SetTemplateRef(const Value: String);
begin
If not IL_SameStr(fTemplateRef,Value) then
begin
fTemplateRef := Value;
UniqueString(fTemplateRef);
end;
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.SetDisableParsErrs(Value: Boolean);
begin
If fDisableParsErrs <> Value then
begin
fDisableParsErrs := Value;
end;
end;
//------------------------------------------------------------------------------
Function TILItemShopParsingSettings_Base.GetAvailExtrSettCount: Integer;
begin
Result := Length(fAvailExtrSetts);
end;
//------------------------------------------------------------------------------
Function TILItemShopParsingSettings_Base.GetAvailExtrSett(Index: Integer): TILItemShopParsingExtrSett;
begin
If (Index >= Low(fAvailExtrSetts)) and (Index <= High(fAvailExtrSetts)) then
Result := fAvailExtrSetts[Index]
else
raise Exception.CreateFmt('TILItemShopParsingSettings_Base.GetAvailExtrSett: Index (%d) out of bounds.',[Index]);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.SetAvailExtrSett(Index: Integer; Value: TILItemShopParsingExtrSett);
begin
If (Index >= Low(fAvailExtrSetts)) and (Index <= High(fAvailExtrSetts)) then
fAvailExtrSetts[Index] := IL_ThreadSafeCopy(Value)
else
raise Exception.CreateFmt('TILItemShopParsingSettings_Base.SetAvailExtrSett: Index (%d) out of bounds.',[Index]);
end;
//------------------------------------------------------------------------------
Function TILItemShopParsingSettings_Base.GetPriceExtrSettCount: Integer;
begin
Result := Length(fPriceExtrSetts);
end;
//------------------------------------------------------------------------------
Function TILItemShopParsingSettings_Base.GetPriceExtrSett(Index: Integer): TILItemShopParsingExtrSett;
begin
If (Index >= Low(fPriceExtrSetts)) and (Index <= High(fPriceExtrSetts)) then
Result := fPriceExtrSetts[Index]
else
raise Exception.CreateFmt('TILItemShopParsingSettings_Base.GetPriceExtrSett: Index (%d) out of bounds.',[Index]);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.SetPriceExtrSett(Index: Integer; Value: TILItemShopParsingExtrSett);
begin
If (Index >= Low(fPriceExtrSetts)) and (Index <= High(fPriceExtrSetts)) then
fPriceExtrSetts[Index] := IL_ThreadSafeCopy(Value)
else
raise Exception.CreateFmt('TILItemShopParsingSettings_Base.SetPriceExtrSett: Index (%d) out of bounds.',[Index]);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.InitializeData;
var
i: Integer;
begin
For i := Low(fVariables.Vars) to High(fVariables.Vars) do
fVariables.Vars[i] := '';
fTemplateRef := '';
fDisableParsErrs := False;
SetLength(fAvailExtrSetts,0);
fAvailFinder := TILElementFinder.Create;
SetLength(fPriceExtrSetts,0);
fPriceFinder := TILElementFinder.Create;
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.FinalizeData;
begin
AvailExtractionSettingsClear;
FreeAndNil(fAvailFinder);
PriceExtractionSettingsClear;
FreeAndNil(fPriceFinder);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.Initialize;
begin
FillChar(fStaticSettings,SizeOf(TILStaticManagerSettings),0);
fRequiredCount := 1;
InitializeData;
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.Finalize;
begin
FinalizeData;
end;
//==============================================================================
constructor TILItemShopParsingSettings_Base.Create;
begin
inherited Create;
Initialize;
end;
//------------------------------------------------------------------------------
constructor TILItemShopParsingSettings_Base.CreateAsCopy(Source: TILItemShopParsingSettings_Base; UniqueCopy: Boolean);
var
i: Integer;
begin
inherited Create;
// copy fields
fStaticSettings := IL_ThreadSafeCopy(Source.StaticSettings);
fRequiredCount := Source.RequiredCount;
// copy data
fVariables := IL_ThreadSafeCopy(Source.VariablesRec);
fTemplateRef := Source.TemplateReference;
UniqueString(fTemplateRef);
fDisableParsErrs := Source.DisableParsingErrors;
SetLength(fAvailExtrSetts,Source.AvailExtractionSettingsCount);
For i := Low(fAvailExtrSetts) to High(fAvailExtrSetts) do
fAvailExtrSetts[i] := IL_ThreadSafeCopy(Source.AvailExtractionSettings[i]);
fAvailFinder := TILElementFinder.CreateAsCopy(Source.AvailFinder,UniqueCopy);
SetLength(fPriceExtrSetts,Source.PriceExtractionSettingsCount);
For i := Low(fPriceExtrSetts) to High(fPriceExtrSetts) do
fPriceExtrSetts[i] := IL_ThreadSafeCopy(Source.PriceExtractionSettings[i]);
fPriceFinder := TILElementFinder.CreateAsCopy(Source.PriceFinder,UniqueCopy);
end;
//------------------------------------------------------------------------------
destructor TILItemShopParsingSettings_Base.Destroy;
begin
Finalize;
inherited;
end;
//------------------------------------------------------------------------------
Function TILItemShopParsingSettings_Base.AvailExtractionSettingsAdd: Integer;
begin
SetLength(fAvailExtrSetts,Length(fAvailExtrSetts) + 1);
Result := High(fAvailExtrSetts);
fAvailExtrSetts[Result].ExtractFrom := ilpefText;
fAvailExtrSetts[Result].ExtractionMethod := ilpemFirstInteger;
fAvailExtrSetts[Result].ExtractionData := '';
fAvailExtrSetts[Result].NegativeTag := '';
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.AvailExtractionSettingsDelete(Index: Integer);
var
i: Integer;
begin
If (Index >= Low(fAvailExtrSetts)) and (Index <= High(fAvailExtrSetts)) then
begin
For i := Index to Pred(High(fAvailExtrSetts)) do
fAvailExtrSetts[i] := fAvailExtrSetts[i + 1];
SetLength(fAvailExtrSetts,Length(fAvailExtrSetts) - 1);
end
else raise Exception.CreateFmt('TILItemShopParsingSettings_Base.AvailExtractionSettingsDelete: Index (%d) out of bounds.',[Index]);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.AvailExtractionSettingsClear;
begin
SetLength(fAvailExtrSetts,0);
end;
//------------------------------------------------------------------------------
Function TILItemShopParsingSettings_Base.PriceExtractionSettingsAdd: Integer;
begin
SetLength(fPriceExtrSetts,Length(fPriceExtrSetts) + 1);
Result := High(fPriceExtrSetts);
fPriceExtrSetts[Result].ExtractFrom := ilpefText;
fPriceExtrSetts[Result].ExtractionMethod := ilpemFirstInteger;
fPriceExtrSetts[Result].ExtractionData := '';
fPriceExtrSetts[Result].NegativeTag := '';
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.PriceExtractionSettingsDelete(Index: Integer);
var
i: Integer;
begin
If (Index >= Low(fPriceExtrSetts)) and (Index <= High(fPriceExtrSetts)) then
begin
For i := Index to Pred(High(fPriceExtrSetts)) do
fPriceExtrSetts[i] := fPriceExtrSetts[i + 1];
SetLength(fPriceExtrSetts,Length(fPriceExtrSetts) - 1);
end
else raise Exception.CreateFmt('TILItemShopParsingSettings_Base.PriceExtractionSettingsDelete: Index (%d) out of bounds.',[Index]);
end;
//------------------------------------------------------------------------------
procedure TILItemShopParsingSettings_Base.PriceExtractionSettingsClear;
begin
SetLength(fPriceExtrSetts,0);
end;
end.
|
unit RestClientTest;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,
IdBaseComponent, IdComponent, ComCtrls,
XMLIntf, XMLDoc,
RestObject, util1;
type
TRestForm = class(TForm)
AddressMemo: TMemo;
Panel1: TPanel;
Get: TButton;
ReceiveLog: TMemo;
MemoClear: TButton;
Button1: TButton;
Button2: TButton;
procedure AnalyseChild(child: IXMLnode);
procedure ListerChildNodes(child: IXMLnode);
procedure GetClick(Sender: TObject);
procedure PutClick(Sender: TObject);
procedure MemoClearClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure DeleteClick(Sender: TObject);
procedure PostClick(Sender: TObject);
private
{ Déclarations privées }
indent: AnsiString;
public
{ Déclarations publiques }
end;
var
RestForm: TRestForm;
procedure TestRest;
implementation
{$R *.dfm}
procedure TRestForm.AnalyseChild(child: IXMLnode);
var
st: AnsiString;
i:integer;
begin
st:= Child.NodeName +' tp=' +Istr(ord(Child.NodeType))+' ';
if Child.IsTextElement then st:=st+Child.Text+' ';
for i:=0 to Child.AttributeNodes.count-1 do
st:=st+ Child.AttributeNodes[i].NodeName+' = '+ Child.AttributeNodes[i].NodeValue+' ';
ReceiveLog.Lines.Add( indent+st);
if Child.HasChildNodes and not(Child.IsTextElement) then ListerChildNodes(Child);
end;
procedure TRestForm.ListerChildNodes(child: IXMLnode);
var
i:integer;
begin
indent:= indent+' ';
for i:= 0 to child.ChildNodes.Count-1 do
begin
AnalyseChild(child.ChildNodes[i]);
end;
delete(indent,length(indent)-4,4);
end;
{
https://www.dbunic.cnrs-gif.fr/brainscales/preparations/preparation/2? enlever 2 pour la liste
https://www.dbunic.cnrs-gif.fr/brainscales/devices/item/4?format=xml xml par défaut, possible format=json
}
procedure TRestForm.GetClick(Sender: TObject);
var
rest : TRestObject;
XMLres : IXMLDocument;
Child : IXMLNode;
st:string;
begin
// request
rest := TRestObject.Create('www.dbunic.cnrs-gif.fr',443 , 'do', 'do' );
XMLres := rest.doGet( AddressMemo.lines[0] ); // ex: https://www.dbunic.cnrs-gif.fr/brainscales/people/researcher/5?format=xml
rest.Destroy;
// compute with the XML
ReceiveLog.Lines.Clear;
ReceiveLog.lines.Add( 'GET ...' );
indent:='';
AnalyseChild(XMLres.DocumentElement);
(*
ReceiveLog.Lines.Clear;
ReceiveLog.Lines.Assign(XMLres.XML);
*)
end;
procedure TRestForm.PutClick(Sender: TObject);
var
rest : TRestObject;
Doc : IXMLDocument;
rootnode, childnode : IXMLNode;
begin
// PUT
ReceiveLog.Lines.Clear;
ReceiveLog.lines.Add( 'PUT ...' );
ReceiveLog.lines.Add( 'To: '+AddressMemo.lines.GetText );
Doc := NewXMLDocument;
Doc.Encoding := 'UTF-8';
rootnode := Doc.AddChild('object'); // add root node
childnode := rootnode.AddChild('country');
childnode.Text := 'France';
childnode := rootnode.AddChild('phone');
childnode.Text := '0987654321';
childnode := rootnode.AddChild('postal_code');
childnode.Text := '75000';
childnode := rootnode.AddChild('resource_uri');
childnode.Text := '/brainscales/people/researcher/5';
childnode := rootnode.AddChild('state');
childnode.Text := 'Ile-de-France';
childnode := rootnode.AddChild('street_address');
childnode.Text := 'rue des Cyrils';
childnode := rootnode.AddChild('town');
childnode.Text := 'cit';
childnode := rootnode.AddChild('user');
childnode.Text := '/brainscales/people/user/5';
childnode := rootnode.AddChild('website');
childnode.Text := 'http://unic.cnrs-gif.fr';
childnode := rootnode.AddChild('notes');
childnode.Text := 'tsgdhdhg test';
rest := TRestObject.Create( 'www.dbunic.cnrs-gif.fr', 443, 'do', 'do' );
rest.doPut( AddressMemo.lines.GetText, Doc );
rest.Destroy;
//Doc.SaveToFile('C:\Elphy\projects\restclient\text1.xml'); // DEBUG
end;
procedure TRestForm.PostClick(Sender: TObject);
var
rest : TRestObject;
Doc : IXMLDocument;
rootnode, childnode : IXMLNode;
begin
// REMEMBER: you can send POST (complete XML) not to a detail but to an object
// not to ...scales/people/researcher/5?format=xml
// but to ...scales/people/researcher/
// BUT REMEMBER: you can PUT or PATCH to a detail
// not to ...scales/people/researcher/5?format=xml
// TRY PUT
ReceiveLog.Lines.Clear;
ReceiveLog.lines.Add( 'POST ...' );
ReceiveLog.lines.Add( 'To: '+AddressMemo.lines.GetText );
Doc := NewXMLDocument;
Doc.Encoding := 'UTF-8';
rootnode := Doc.AddChild('object'); // add root node
//childnode := rootnode.AddChild('id');
//childnode.Text := '34';
childnode := rootnode.AddChild('country');
childnode.Text := 'Test';
childnode := rootnode.AddChild('phone');
childnode.Text := '0987654321';
childnode := rootnode.AddChild('postal_code');
childnode.Text := '00000';
//childnode := rootnode.AddChild('resource_uri');
//childnode.Text := '/brainscales/people/researcher/100';
childnode := rootnode.AddChild('state');
childnode.Text := 'Test';
childnode := rootnode.AddChild('street_address');
childnode.Text := 'rue des tests';
childnode := rootnode.AddChild('town');
childnode.Text := 'testonia';
childnode := rootnode.AddChild('user');
childnode.Text := '/brainscales/people/user/6';
childnode := rootnode.AddChild('website');
childnode.Text := 'http://test.ts';
childnode := rootnode.AddChild('notes');
childnode.Text := 'tetest';
rest := TRestObject.Create( 'www.dbunic.cnrs-gif.fr', 443, 'do', 'do' );
rest.doPost( AddressMemo.lines.GetText, Doc );
rest.Destroy;
end;
procedure TRestForm.DeleteClick(Sender: TObject);
var
rest : TRestObject;
begin
// TRY PUT
ReceiveLog.Lines.Clear;
ReceiveLog.lines.Add( 'DELETE ...' );
ReceiveLog.lines.Add( 'To: '+AddressMemo.lines.GetText );
rest := TRestObject.Create( 'www.dbunic.cnrs-gif.fr', 443, 'do', 'do' );
rest.doDelete( AddressMemo.lines.GetText );
rest.Destroy;
end;
procedure TRestForm.MemoClearClick(Sender: TObject);
begin
ReceiveLog.lines.clear;
end;
procedure TRestForm.FormCreate(Sender: TObject);
begin
AddressMemo.Lines.Clear;
AddressMemo.Lines.Add('https://www.dbunic.cnrs-gif.fr/brainscales/people/researcher/?format=xml');
// AddressMemo.Lines.Add('http://157.136.240.232/app/#/queue?format=xml');
end;
procedure TestRest;
begin
if not assigned(RestForm) then restForm:= TrestForm.Create(nil);
restForm.show;
end;
// end TForm1 obj
end.
|
{..............................................................................}
{ Summary Iterates Rules from the current PCB document. }
{ }
{ Copyright (c) 2008 by Altium Limited }
{ }
{ RuleFactory used to create new rule objects }
{ IPCB_Rule interface object represents a rule object on a PCB document }
{..............................................................................}
{..............................................................................}
Function RuleKindToString (ARuleKind : TRuleKind) : String;
Begin
Result := '';
Case ARuleKind Of
eRule_Clearance : Result := 'Clearance';
eRule_ParallelSegment : Result := 'ParallelSegment';
eRule_MaxMinWidth : Result := 'Width';
eRule_MaxMinLength : Result := 'Length';
eRule_MatchedLengths : Result := 'MatchedLengths';
eRule_DaisyChainStubLength : Result := 'StubLength';
eRule_PowerPlaneConnectStyle : Result := 'PlaneConnect';
eRule_RoutingTopology : Result := 'RoutingTopology';
eRule_RoutingPriority : Result := 'RoutingPriority';
eRule_RoutingLayers : Result := 'RoutingLayers';
eRule_RoutingCornerStyle : Result := 'RoutingCorners';
eRule_RoutingViaStyle : Result := 'RoutingVias';
eRule_PowerPlaneClearance : Result := 'PlaneClearance';
eRule_SolderMaskExpansion : Result := 'SolderMaskExpansion';
eRule_PasteMaskExpansion : Result := 'PasteMaskExpansion';
eRule_ShortCircuit : Result := 'ShortCircuit';
eRule_BrokenNets : Result := 'UnRoutedNet';
eRule_ViasUnderSMD : Result := 'ViasUnderSMD';
eRule_MaximumViaCount : Result := 'MaximumViaCount';
eRule_MinimumAnnularRing : Result := 'MinimumAnnularRing';
eRule_PolygonConnectStyle : Result := 'PolygonConnect';
eRule_AcuteAngle : Result := 'AcuteAngle';
eRule_ConfinementConstraint : Result := 'RoomDefinition';
eRule_SMDToCorner : Result := 'SMDToCorner';
eRule_ComponentClearance : Result := 'ComponentClearance';
eRule_ComponentRotations : Result := 'ComponentOrientations';
eRule_PermittedLayers : Result := 'PermittedLayers';
eRule_NetsToIgnore : Result := 'NetsToIgnore';
eRule_SignalStimulus : Result := 'SignalStimulus';
eRule_Overshoot_FallingEdge : Result := 'OvershootFalling';
eRule_Overshoot_RisingEdge : Result := 'OvershootRising';
eRule_Undershoot_FallingEdge : Result := 'UndershootFalling';
eRule_Undershoot_RisingEdge : Result := 'UndershootRising';
eRule_MaxMinImpedance : Result := 'MaxMinImpedance';
eRule_SignalTopValue : Result := 'SignalTopValue';
eRule_SignalBaseValue : Result := 'SignalBaseValue';
eRule_FlightTime_RisingEdge : Result := 'FlightTimeRising';
eRule_FlightTime_FallingEdge : Result := 'FlightTimeFalling';
eRule_LayerStack : Result := 'LayerStack';
eRule_MaxSlope_RisingEdge : Result := 'SlopeRising';
eRule_MaxSlope_FallingEdge : Result := 'SlopeFalling';
eRule_SupplyNets : Result := 'SupplyNets';
eRule_MaxMinHoleSize : Result := 'HoleSize';
eRule_TestPointStyle : Result := 'Testpoint';
eRule_TestPointUsage : Result := 'TestPointUsage';
eRule_UnconnectedPin : Result := 'UnConnectedPin';
eRule_SMDToPlane : Result := 'SMDToPlane';
eRule_SMDNeckDown : Result := 'SMDNeckDown';
eRule_LayerPair : Result := 'LayerPairs';
eRule_FanoutControl : Result := 'FanoutControl';
eRule_MaxMinHeight : Result := 'Height';
eRule_DifferentialPairsRouting : Result := 'DiffPairsRouting';
End;
End;
{..............................................................................}
{..............................................................................}
Procedure IterateRules;
Var
Board : IPCB_Board;
Rule : IPCB_Rule;
BoardIterator : IPCB_BoardIterator;
Rpt : TStringList;
FileName : TPCBString;
Document : IServerDocument;
Count : Integer;
I : Integer;
J : Integer;
Begin
// Retrieve the current board
Board := PCBServer.GetCurrentPCBBoard;
If Board = Nil Then Exit;
// Retrieve the iterator
BoardIterator := Board.BoardIterator_Create;
BoardIterator.AddFilter_ObjectSet(MkSet(eRuleObject));
BoardIterator.AddFilter_LayerSet(AllLayers);
BoardIterator.AddFilter_Method(eProcessAll);
Count := 0;
Rpt := TStringList.Create;
// Search for Rule and for each rule found
// get its attributes and put them in a TStringList
// to be saved as a text file...
Rule := BoardIterator.FirstPCBObject;
While (Rule <> Nil) Do
Begin
Inc(Count);
Rpt.Add(IntToStr(Count) + ': ' + Rule.Name + ', UniqueId: ' + Rule.UniqueId +
', RuleType: ' + RuleKindToString(Rule.RuleKind));
Rule := BoardIterator.NextPCBObject;
End;
Board.BoardIterator_Destroy(BoardIterator);
Rpt.Insert(0,'Rules Information for the ' + ExtractFileName(Board.FileName) + ' document.');
Rpt.Insert(1,'----------------------------------------------------------');
Rpt.Insert(2,'');
// Display the Rules report
FileName := ChangeFileExt(Board.FileName,'.rul');
Rpt.SaveToFile(Filename);
Rpt.Free;
Document := Client.OpenDocument('Text', FileName);
If Document <> Nil Then
Client.ShowDocument(Document);
End;
{..............................................................................}
{..............................................................................}
(*
TRuleType
TScopeType
IPCB_Rule
IPCB_ClearanceConstraint
IPCB_ParallelSegmentConstraint
IPCB_MaxMinWidthConstraint
IPCB_MaxMinLengthConstraint
IPCB_MatchedNetLengthsConstraint
IPCB_DaisyChainStubLengthConstraint
IPCB_PowerPlaneConnectStyleRule
IPCB_PolygonConnectStyleRule
IPCB_RoutingTopologyRule
IPCB_RoutingPriorityRule
IPCB_RoutingLayersRule
IPCB_RoutingCornerStyleRule
IPCB_RoutingViaStyleRule
IPCB_PowerPlaneClearanceRule
IPCB_SolderMaskExpansionRule
IPCB_PasteMaskExpansionRule
IPCB_ShortCircuitConstraint
IPCB_BrokenNetRule
IPCB_ViasUnderSMDConstraint
IPCB_MaximumViaCountRule
IPCB_MinimumAnnularRing
IPCB_AcuteAngle
IPCB_ConfinementConstraint
IPCB_ComponentClearanceConstraint
IPCB_ComponentRotationsRule
IPCB_PermittedLayersRule
IPCB_SignalStimulus
IPCB_MaxOvershootFall
IPCB_MaxOvershootRise
IPCB_MaxUndershootFall
IPCB_MaxUndershootRise
IPCB_RuleMaxMinImpedance
IPCB_RuleMinSignalTopValue
IPCB_RuleMaxSignalBaseValue
IPCB_RuleFlightTime_RisingEdge
IPCB_RuleFlightTime_FallingEdge
IPCB_RuleMaxSlopeRisingEdge
IPCB_RuleMaxSlopeFallingEdge
IPCB_NetsToIgnoreRule
IPCB_SMDToCornerConstraint
IPCB_RuleSupplyNets
IPCB_MaxMinHoleSizeConstraint
IPCB_TestPointStyleRule
IPCB_TestPointUsage
IPCB_UnConnectedPinRule
IPCB_SMDToPlaneConstraint
IPCB_SMDNeckDownConstraint
IPCB_LayerPairsRule
IPCB_FanoutControlRule
IPCB_MaxMinHeightConstraint
IPCB_DifferentialPairsRoutingRule
*)
|
unit GLDPlaneObjectsFrame;
interface
uses
SysUtils, Classes, Controls, Forms, Buttons, StdCtrls,
GLDTypes, GLDSystem;
type
TGLDParamsFrameType =
(GLD_PARAMS_FRAME_NONE,
GLD_PARAMS_FRAME_PLANE,
GLD_PARAMS_FRAME_DISK,
GLD_PARAMS_FRAME_RING);
TGLDPlaneObjectsFrame = class(TFrame)
SB_PlaneObjects: TScrollBox;
GB_ObjectType: TGroupBox;
SB_Plane: TSpeedButton;
SB_Disk: TSpeedButton;
SB_Ring: TSpeedButton;
procedure SpeedButtonClick(Sender: TObject);
private
FParamsFrame: TFrame;
FDrawer: TGLDDrawer;
function GetParamsFrameType: TGLDParamsFrameType;
procedure SetParamsFrameType(Value: TGLDParamsFrameType);
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure SetEditedObject;
procedure SetParamsFrameParams(AObject: TObject);
property ParamsFrameType: TGLDParamsFrameType read GetParamsFrameType write SetParamsFrameType;
property Drawer: TGLDDrawer read FDrawer write FDrawer;
end;
function GLDXParamsFrameType(AType: TGLDSysClassType): TGLDParamsFrameType;
procedure Register;
implementation
{$R *.dfm}
uses
{$include GLDObjects.inc},
{$include GLDObjectParamsFrames.inc};
constructor TGLDPlaneObjectsFrame.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FParamsFrame := nil;
FDrawer := nil;
end;
destructor TGLDPlaneObjectsFrame.Destroy;
begin
FParamsFrame.Free;
inherited Destroy;
end;
procedure TGLDPlaneObjectsFrame.SetEditedObject;
begin
if not Assigned(FDrawer) then Exit;
if Assigned(FDrawer.EditedObject) then
begin
SetParamsFrameType(GLDXParamsFrameType(FDrawer.EditedObject.SysClassType));
SetParamsFrameParams(FDrawer.EditedObject);
end;
end;
procedure TGLDPlaneObjectsFrame.SetParamsFrameParams(AObject: TObject);
begin
if not Assigned(AObject) then Exit;
case GetParamsFrameType of
GLD_PARAMS_FRAME_PLANE:
if AObject is TGLDPlane then
with TGLDPlane(AObject) do
TGLDPlaneParamsFrame(FParamsFrame).SetParams(Name, Color.Color3ub,
Length, Width, LengthSegs, WidthSegs);
GLD_PARAMS_FRAME_DISK:
if AObject is TGLDDisk then
with TGLDDisk(AObject) do
TGLDDiskParamsFrame(FParamsFrame).SetParams(Name, Color.Color3ub,
Radius, Segments, Sides, StartAngle, SweepAngle);
GLD_PARAMS_FRAME_RING:
if AObject is TGLDRing then
with TGLDRing(AObject) do
TGLDRingParamsFrame(FParamsFrame).SetParams(Name, Color.Color3ub,
InnerRadius, OuterRadius, Segments, Sides, StartAngle, SweepAngle);
end;
end;
procedure TGLDPlaneObjectsFrame.Notification(AComponent: TComponent; Operation: TOperation);
begin
if Assigned(FDrawer) and (AComponent = FDrawer.Owner) and
(Operation = opRemove) then FDrawer := nil;
inherited Notification(AComponent, Operation);
end;
procedure TGLDPlaneObjectsFrame.SpeedButtonClick(Sender: TObject);
begin
if not Assigned(FDrawer) then Exit;
if Sender = SB_Plane then
begin
SetParamsFrameType(GLD_PARAMS_FRAME_PLANE);
FDrawer.StartDrawing(TGLDPlane);
end else
if Sender = SB_Disk then
begin
SetParamsFrameType(GLD_PARAMS_FRAME_DISK);
FDrawer.StartDrawing(TGLDDisk);
end else
if Sender = SB_Ring then
begin
SetParamsFrameType(GLD_PARAMS_FRAME_RING);
FDrawer.StartDrawing(TGLDRing);
end else
end;
function TGLDPlaneObjectsFrame.GetParamsFrameType: TGLDParamsFrameType;
begin
Result := GLD_PARAMS_FRAME_NONE;
if not Assigned(FParamsFrame) then Exit;
if FParamsFrame is TGLDPlaneParamsFrame then Result := GLD_PARAMS_FRAME_PLANE else
if FParamsFrame is TGLDDiskParamsFrame then Result := GLD_PARAMS_FRAME_DISK else
if FParamsFrame is TGLDRingParamsFrame then Result := GLD_PARAMS_FRAME_RING;
end;
procedure TGLDPlaneObjectsFrame.SetParamsFrameType(Value: TGLDParamsFrameType);
begin
//if GetParamsFrameType = Value then Exit;
FParamsFrame.Free;
FParamsFrame := nil;
case Value of
GLD_PARAMS_FRAME_PLANE:
begin
FParamsFrame := TGLDPlaneParamsFrame.Create(Self);
TGLDPlaneParamsFrame(FParamsFrame).Drawer := FDrawer;
end;
GLD_PARAMS_FRAME_DISK:
begin
FParamsFrame := TGLDDiskParamsFrame.Create(Self);
TGLDDiskParamsFrame(FParamsFrame).Drawer := FDrawer;
end;
GLD_PARAMS_FRAME_RING:
begin
FParamsFrame := TGLDRingParamsFrame.Create(Self);
TGLDRingParamsFrame(FParamsFrame).Drawer := FDrawer;
end;
end;
if Value <> GLD_PARAMS_FRAME_NONE then
begin
FParamsFrame.Top := GB_ObjectType.Top + GB_ObjectType.Height + 10;
FParamsFrame.Parent := Self.SB_PlaneObjects;
if Assigned(FDrawer) then FDrawer.IOFrame := FParamsFrame;
end;
end;
function GLDXParamsFrameType(AType: TGLDSysClassType): TGLDParamsFrameType;
begin
case AType of
GLD_SYSCLASS_PLANE: Result := GLD_PARAMS_FRAME_PLANE;
GLD_SYSCLASS_DISK: Result := GLD_PARAMS_FRAME_DISK;
GLD_SYSCLASS_RING: Result := GLD_PARAMS_FRAME_RING;
else Result := GLD_PARAMS_FRAME_NONE;
end;
end;
procedure Register;
begin
RegisterComponents('GLDraw', [TGLDPlaneObjectsFrame]);
end;
end.
|
unit FAbortPrint;
(*====================================================================
This is a non-modal window showed during print so that the user can click on
the ABort button.
======================================================================*)
interface
uses
SysUtils,
{$ifdef mswindows}
WinTypes,WinProcs,
{$ELSE}
LCLIntf, LCLType, LMessages,
{$ENDIF}
Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls,
UTypes;
type
TFormAbortPrint = class(TForm)
ButtonAbort: TButton;
LabelProgress: TLabel;
procedure ButtonAbortClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
Aborted: boolean;
end;
var
FormAbortPrint: TFormAbortPrint;
implementation
{$R *.dfm}
///uses Printers;
//-----------------------------------------------------------------------------
procedure TFormAbortPrint.ButtonAbortClick(Sender: TObject);
begin
Aborted := true;
end;
(*
Using printer.aborted made problems and thus it is not used:
if not Printer.Aborted then
begin
AbortDoc(Printer.Handle); <--- this makes crash...
Printer.Abort;
end;
When we use Printer.Abort, and do not call EndDoc, the print task remains active
*)
//-----------------------------------------------------------------------------
procedure TFormAbortPrint.FormShow(Sender: TObject);
begin
Aborted := false;
end;
//-----------------------------------------------------------------------------
end.
|
//---------------------------------------------------------------------------
// Copyright 2012 The Open Source Electronic Health Record Agent
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//---------------------------------------------------------------------------
{$Optimization off}
unit UTSignonCnf;
interface
uses UnitTest, TestFrameWork, SgnonCnf;
implementation
type
UTSignonCnfTests=class(TTestCase)
private
OSEHRATest: TSignonValues;
public
procedure SetUp; override;
procedure TearDown; override;
published
procedure TestSignOnPropertyClear;
end;
procedure UTSignonCnfTests.SetUp;
begin
OSEHRATest := TSignonValues.Create();
end;
procedure UTSignonCnfTests.TearDown;
begin
OSEHRATest :=nil;
end;
procedure UTSignonCnfTests.TestSignOnPropertyClear;
begin
OSEHRATest.Height := 5;
CheckEquals(5,OSEHRATest.Height,'Initial Set didn''t work');
OSEHRATest.Clear;
CheckEquals(0,OSEHRATest.Height,'Test of SgnonCnf Function Clear has failed');
end;
begin
UnitTest.addSuite(UTSignonCnfTests.Suite);
end. |
unit Main;
// Demonstration project for TojVirtualStringTree to generally show how to get started.
// Written by Mike Lischke.
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ojVirtualTrees, StdCtrls, ExtCtrls;
type
TMainForm = class(TForm)
VST: TojVirtualStringTree;
ClearButton: TButton;
AddOneButton: TButton;
Edit1: TEdit;
Button1: TButton;
Label1: TLabel;
CloseButton: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure ClearButtonClick(Sender: TObject);
procedure AddButtonClick(Sender: TObject);
procedure CloseButtonClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure VSTInitNode(Sender: TojBaseVirtualTree; ParentNode, Node: TojVirtualNode; var InitialStates: TVirtualNodeInitStates);
procedure VSTFreeNode(Sender: TojBaseVirtualTree; Node: TojVirtualNode);
procedure VSTGetText(Sender: TojBaseVirtualTree; Node: TojVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
procedure VST_OnGetNodeUserDataClass(Sender: TojBaseVirtualTree; var NodeUserDataClass: TClass);
end;
var
MainForm: TMainForm;
//----------------------------------------------------------------------------------------------------------------------
implementation
{$R *.DFM}
type
TojStringData = class
Caption: string;
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TMainForm.FormCreate(Sender: TObject);
begin
// We assign the OnGetText handler manually to keep the demo source code compatible
// with older Delphi versions after using UnicodeString instead of WideString.
VST.OnGetText := VSTGetText;
// Let the tree know how much data space we need.
// VST.NodeDataSize := SizeOf(TMyRec);
// Set an initial number of nodes.
VST.RootNodeCount := 10;
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TMainForm.Button2Click(Sender: TObject);
begin
// VST.NodeDataSize:= 100;
VST._UserDataClassName:= '';
end;
procedure TMainForm.ClearButtonClick(Sender: TObject);
var
Start: Cardinal;
begin
Screen.Cursor := crHourGlass;
try
Start := GetTickCount;
VST.Clear;
Label1.Caption := Format('Last operation duration: %d ms, TNC: %d', [GetTickCount - Start, TojVirtualNode.TotalNodeCount]);
finally
Screen.Cursor := crDefault;
end;
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TMainForm.AddButtonClick(Sender: TObject);
var
Count: Cardinal;
Start: Cardinal;
begin
// Add some nodes to the treeview.
Screen.Cursor := crHourGlass;
with VST do
try
Start := GetTickCount;
case (Sender as TButton).Tag of
0: // add to root
begin
Count := StrToInt(Edit1.Text);
RootNodeCount := RootNodeCount + Count;
end;
1: // add as child
if Assigned(FocusedNode) then
begin
Count := StrToInt(Edit1.Text);
ChildCount[FocusedNode] := ChildCount[FocusedNode] + Count;
Expanded[FocusedNode] := True;
InvalidateToBottom(FocusedNode);
end;
end;
Label1.Caption := Format('Last operation duration: %d ms, TNC: %d', [GetTickCount - Start, TojVirtualNode.TotalNodeCount]);
finally
Screen.Cursor := crDefault;
end;
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TMainForm.VSTFreeNode(Sender: TojBaseVirtualTree; Node: TojVirtualNode);
//var
// Data: PMyRec;
begin
// UserData is owned by tree; do nothing
// Data := Sender.GetNodeData(Node);
// // Explicitely free the string, the VCL cannot know that there is one but needs to free
// // it nonetheless. For more fields in such a record which must be freed use Finalize(Data^) instead touching
// // every member individually.
// Finalize(Data^);
end;
procedure TMainForm.VSTGetText(Sender: TojBaseVirtualTree; Node: TojVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
begin
// CellText:= TojVirtualStringNode(Node).Caption;
with sender do
case GetNodeLevel(Node) of
0: CellText:= TojVirtualStringNode(Node).Caption;
1: CellText:= Node.Tag;
else
CellText:= TojVirtualStringNode(Node).Caption;
end;
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TMainForm.VSTInitNode(Sender: TojBaseVirtualTree; ParentNode,
Node: TojVirtualNode; var InitialStates: TVirtualNodeInitStates);
begin
with sender do
case GetNodeLevel(Node) of
0: TojVirtualStringNode(Node).Caption := Format('CPT Level %d, Index %d', [GetNodeLevel(Node), Node.Index]);
1: Node.Tag:= Format('TAG Level %d, Index %d', [GetNodeLevel(Node), Node.Index]);
else
TojVirtualStringNode(Node).Caption:= Format('CPTE Level %d, Index %d', [GetNodeLevel(Node), Node.Index]);
end;
end;
procedure TMainForm.VST_OnGetNodeUserDataClass(Sender: TojBaseVirtualTree;
var NodeUserDataClass: TClass);
begin
if NodeUserDataClass = nil
then NodeUserDataClass:= TojStringData;
end;
procedure TMainForm.CloseButtonClick(Sender: TObject);
begin
Close;
end;
initialization
// GTA
TojVirtualStringTree.registerUserDataClass(TojStringData);
finalization
end.
|
unit uPopupActionBarEx;
interface
uses
Winapi.Windows,
System.Types,
System.UITypes,
System.SysUtils,
System.Classes,
System.Actions,
Vcl.Graphics,
Vcl.PlatformDefaultStyleActnCtrls,
Vcl.ActnMan,
Vcl.ActnMenus,
Vcl.ActnCtrls,
Vcl.Controls,
Vcl.Menus,
Vcl.ActnList,
Vcl.XPActnCtrls,
Vcl.ThemedActnCtrls,
Vcl.Forms;
type
TPlatformDefaultStyleActionBarsEx = class(TPlatformDefaultStyleActionBars)
public
function GetControlClass(ActionBar: TCustomActionBar;
AnItem: TActionClientItem): TCustomActionControlClass; override;
end;
TThemedMenuItemEx = class(TThemedMenuItem)
private
FPaintRect: TRect;
procedure DoDrawText(DC: HDC; const Text: string; var Rect: TRect; Flags: Longint);
protected
procedure DrawBackground(var PaintRect: TRect); override;
procedure DrawText(var Rect: TRect; var Flags: Cardinal; Text: string); override;
end;
implementation
uses
Vcl.ListActns,
Vcl.Themes,
Vcl.StdActnMenus;
var
PlatformDefaultStyleOld: TPlatformDefaultStyleActionBars;
{ TMenuAction }
type
TActionControlStyle = (csStandard, csXPStyle, csThemed);
function GetActionControlStyle: TActionControlStyle;
begin
if TStyleManager.IsCustomStyleActive then
Result := csThemed
else if TOSVersion.Check(6) then
begin
if StyleServices.Theme[teMenu] <> 0 then
Result := csThemed
else
Result := csXPStyle;
end
else if TOSVersion.Check(5, 1) then
Result := csXPStyle
else
Result := csStandard;
end;
{ TPlatformDefaultStyleActionBarsEx }
function TPlatformDefaultStyleActionBarsEx.GetControlClass(
ActionBar: TCustomActionBar;
AnItem: TActionClientItem): TCustomActionControlClass;
begin
if ActionBar is TCustomActionToolBar then
begin
if AnItem.HasItems then
case GetActionControlStyle of
csStandard: Result := TStandardDropDownButton;
csXPStyle: Result := TXPStyleDropDownBtn;
else
Result := TThemedDropDownButton;
end
else
if (AnItem.Action is TStaticListAction) or
(AnItem.Action is TVirtualListAction) then
Result := TCustomComboControl
else
case GetActionControlStyle of
csStandard: Result := TStandardButtonControl;
csXPStyle: Result := TXPStyleButton;
else
Result := TThemedButtonControl;
end
end
else if ActionBar is TCustomActionMainMenuBar then
case GetActionControlStyle of
csStandard: Result := TStandardMenuButton;
csXPStyle: Result := TXPStyleMenuButton;
else
Result := TThemedMenuButton;
end
else if ActionBar is TCustomizeActionToolBar then
begin
with TCustomizeActionToolbar(ActionBar) do
if not Assigned(RootMenu) or
(AnItem.ParentItem <> TCustomizeActionToolBar(RootMenu).AdditionalItem) then
case GetActionControlStyle of
csStandard: Result := TStandardMenuItem;
csXPStyle: Result := TXPStyleMenuItem;
else
Result := TThemedMenuItem;
end
else
case GetActionControlStyle of
csStandard: Result := TStandardAddRemoveItem;
csXPStyle: Result := TXPStyleAddRemoveItem;
else
Result := TThemedAddRemoveItem;
end
end
else if ActionBar is TCustomActionPopupMenu then
case GetActionControlStyle of
csStandard: Result := TStandardMenuItem;
csXPStyle: Result := TXPStyleMenuItem;
else
Result := TThemedMenuItemEx;
end
else
case GetActionControlStyle of
csStandard: Result := TStandardButtonControl;
csXPStyle: Result := TXPStyleButton;
else
Result := TThemedButtonControl;
end
end;
{ TThemedMenuItemEx }
// Get font from DC to Canvas method
function GetFontFromDC(ADC: HDC): TGDIHandleRecall;
var
OldFontHandle: HFont;
LogFont: TLogFont;
begin
Result := TGDIHandleRecall.Create(ADC, OBJ_FONT);
OldFontHandle := SelectObject(ADC, Result.Canvas.Font.Handle);
FillChar(LogFont, SizeOf(LogFont), 0);
GetObject(OldFontHandle, SizeOf(LogFont), @LogFont);
Result.Canvas.Font.Handle := CreateFontIndirect(LogFont);
end;
procedure TThemedMenuItemEx.DoDrawText(DC: HDC; const Text: string;
var Rect: TRect; Flags: Integer);
const
MenuStates: array[Boolean] of TThemedMenu = (tmPopupItemDisabled, tmPopupItemNormal);
const
CFlags: array[TTextFormats] of Cardinal = (
DT_BOTTOM, DT_CALCRECT, DT_CENTER, DT_EDITCONTROL, DT_END_ELLIPSIS,
DT_PATH_ELLIPSIS, DT_EXPANDTABS, DT_EXTERNALLEADING, DT_LEFT,
DT_MODIFYSTRING, DT_NOCLIP, DT_NOPREFIX, DT_RIGHT, DT_RTLREADING,
DT_SINGLELINE, DT_TOP, DT_VCENTER, DT_WORDBREAK, DT_HIDEPREFIX,
DT_NOFULLWIDTHCHARBREAK, DT_PREFIXONLY, DT_TABSTOP, DT_WORD_ELLIPSIS,
MASK_TF_COMPOSITED {tfComposited});
var
LDrawTextFlag: TTextFormats;
LCaption: string;
LFormats: TTextFormat;
LColor: TColor;
LDetails: TThemedElementDetails;
DrawFlags: Cardinal;
Canvas: TCanvas;
LFontRecall: TGDIHandleRecall;
begin
// get format and color
LFormats := TTextFormatFlags(Flags);
if Selected and Enabled then
LDetails := StyleServices.GetElementDetails(tmPopupItemHot)
else
LDetails := StyleServices.GetElementDetails(MenuStates[Enabled or ActionBar.DesignMode]);
if not StyleServices.GetElementColor(LDetails, ecTextColor, LColor) or (LColor = clNone) then
LColor := ActionBar.ColorMap.FontColor;
// tweak text
LCaption := Text;
if (tfCalcRect in LFormats) and ( (LCaption = '') or (LCaption[1] = cHotkeyPrefix) and (LCaption[2] = #0) ) then
LCaption := LCaption + ' ';
LFormats := LFormats - [tfCenter];
DrawFlags := 0;
for LDrawTextFlag := Low(TTextFormats) to High(TTextFormats) do
if (LDrawTextFlag in LFormats) then
DrawFlags := DrawFlags or CFlags[LDrawTextFlag];
Canvas := TCanvas.Create;
try
Canvas.Handle := DC;
// Draw menu item text
SetBkMode(DC, Winapi.Windows.TRANSPARENT);
LFontRecall := TGDIHandleRecall.Create(DC, OBJ_FONT);
try
LFontRecall.Canvas.Font.Color := LColor;
if Self.ActionClient.Default then
LFontRecall.Canvas.Font.Style := [fsBold];
SetBkMode(LFontRecall.Canvas.Handle, Winapi.Windows.TRANSPARENT);
Winapi.Windows.DrawText(LFontRecall.Canvas.Handle, LCaption, Length(LCaption), Rect, DrawFlags);
finally
LFontRecall.Free;
end;
finally
Canvas.Free;
end;
end;
procedure TThemedMenuItemEx.DrawBackground(var PaintRect: TRect);
begin
FPaintRect := PaintRect;
inherited;
end;
procedure TThemedMenuItemEx.DrawText(var Rect: TRect; var Flags: Cardinal;
Text: string);
var
LRect: TRect;
begin
// Draw menu highlight
if Selected and Enabled then
StyleServices.DrawElement(Canvas.Handle, StyleServices.GetElementDetails(tmPopupItemHot), FPaintRect)
else if Selected then
StyleServices.DrawElement(Canvas.Handle, StyleServices.GetElementDetails(tmPopupItemDisabledHot), FPaintRect);
// Draw menu item text
if (Parent is TCustomActionBar) and (not ActionBar.PersistentHotkeys) then
Text := FNoPrefix;
Canvas.Font := Screen.MenuFont;
if ActionClient.Default then
Canvas.Font.Style := Canvas.Font.Style + [fsBold];
LRect := FPaintRect;
DoDrawText(Canvas.Handle, Text, LRect, Flags or DT_CALCRECT or DT_NOCLIP);
OffsetRect(LRect, Rect.Left,
((FPaintRect.Bottom - FPaintRect.Top) - (LRect.Bottom - LRect.Top)) div 2);
//LRect.Left := 5;
DoDrawText(Canvas.Handle, Text, LRect, Flags);
// Draw shortcut
if ShowShortCut and ((ActionClient <> nil) and not ActionClient.HasItems) then
begin
Flags := DrawTextBiDiModeFlags(DT_RIGHT);
LRect := TRect.Create(ShortCutBounds.Left, LRect.Top, ShortCutBounds.Right, LRect.Bottom);
LRect.Offset(Width, 0);
DoDrawText(Canvas.Handle, ActionClient.ShortCutText, LRect, Flags);
end;
end;
initialization
PlatformDefaultStyleOld := PlatformDefaultStyle;
UnregisterActnBarStyle(PlatformDefaultStyleOld);
PlatformDefaultStyle := TPlatformDefaultStyleActionBarsEx.Create;
DefaultActnBarStyle := PlatformDefaultStyle.GetStyleName;
RegisterActnBarStyle(PlatformDefaultStyle);
finalization
UnregisterActnBarStyle(PlatformDefaultStyle);
PlatformDefaultStyle.Free;
PlatformDefaultStyle := PlatformDefaultStyleOld;
RegisterActnBarStyle(PlatformDefaultStyleOld);
end.
|
unit UConversao;
interface
type
TConversao = class
strict private
FResultado: String;
strict protected
procedure setResultado(Text: String); Virtual;
function getResultado: String; Virtual;
public
procedure Converter(Texto: String); Virtual; Abstract;
property Resultado: String read getResultado write setResultado;
end;
implementation
{TCalculadora}
function TConversao.getResultado: String;
begin
Result := FResultado;
end;
procedure TConversao.setResultado(Text: String);
begin
FResultado := Text;
end;
end.
|
unit ibSHServer;
interface
uses
SysUtils, Classes, Controls, Forms, Dialogs, Graphics,
SHDesignIntf,
ibSHDesignIntf, ibSHDriverIntf, ibSHComponent;
type
TibSHServer = class(TibBTComponent, IibSHServer, ISHServer, ISHRegistration, ISHTestConnection, ISHDataRootDirectory)
private
FDRVService: TSHComponent;
FHost: string;
FAlias: string;
FVersion: string;
FClientLibrary: string;
FProtocol: string;
FPort: string;
FUserName: string;
FPassword: string;
FRole: string;
FLoginPrompt: Boolean;
FLongMetadataNames: Boolean;
FSecurityDatabase: string;
FDescription: string;
FDirectoryIID: string;
FSchemeClassIIDList: TStrings;
FInstanceName:string;
protected
function GetBranchIID: TGUID; override;
procedure SetOwnerIID(Value: TGUID); override;
procedure DoOnApplyOptions; override;
function DRVNormalize(const DriverIID: TGUID): TGUID;
function PrepareDRVService: Boolean;
function GetDRVService: IibSHDRVService;
function GetHost: string;
procedure SetHost(Value: string);
function GetAlias: string;
procedure SetAlias(Value: string);
function GetVersion: string;
procedure SetVersion(Value: string);
function SetLongMetadataNames: Boolean;
procedure GetLongMetadataNames(Value: Boolean);
function GetClientLibrary: string;
procedure SetClientLibrary(Value: string);
function GetProtocol: string;
procedure SetProtocol(Value: string);
function GetPort: string;
procedure SetPort(Value: string);
function GetSecurityDatabase: string;
procedure SetSecurityDatabase(Value: string);
function GetUserName: string;
procedure SetUserName(Value: string);
function GetPassword: string;
procedure SetPassword(Value: string);
function GetRole: string;
procedure SetRole(Value: string);
function GetLoginPrompt: Boolean;
procedure SetLoginPrompt(Value: Boolean);
function GetDescription: string;
procedure SetDescription(Value: string);
function GetConnectPath: string;
function GetDirectoryIID: string;
procedure SetDirectoryIID(Value: string);
function GetCaption: string; override;
function GetCaptionExt: string; override;
// ISHServer
function GetConnected: Boolean;
function GetCanConnect: Boolean;
function GetCanReconnect: Boolean;
function GetCanDisconnect: Boolean;
function GetCanShowRegistrationInfo: Boolean;
function Connect: Boolean;
function Reconnect: Boolean;
function Disconnect: Boolean;
procedure Refresh;
function ShowRegistrationInfo: Boolean;
procedure IDELoadFromFileNotify;
function GetSchemeClassIIDList(WithSystem: Boolean = False): TStrings; overload;
function GetSchemeClassIIDList(const AObjectName: string): TStrings; overload;
function GetObjectNameList: TStrings; overload;
function GetObjectNameList(const AClassIID: TGUID): TStrings; overload;
function GetInstanceName:string;
procedure SetInstanceName(const Value:string);
// ISHTestconnection
function GetCanTestConnection: Boolean;
function TestConnection: Boolean;
// ISHDataRootDirectory
function GetDataRootDirectory: string;
function CreateDirectory(const FileName: string): Boolean;
function RenameDirectory(const OldName, NewName: string): Boolean;
function DeleteDirectory(const FileName: string): Boolean;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property DRVService: IibSHDRVService read GetDRVService;
property Connected: Boolean read GetConnected;
property CanConnect: Boolean read GetCanConnect;
property CanReconnect: Boolean read GetCanReconnect;
property CanDisconnect: Boolean read GetCanDisconnect;
property CanShowRegistrationInfo: Boolean read GetCanShowRegistrationInfo;
property SchemeClassIIDList: TStrings read FSchemeClassIIDList;
published
property Host: string read GetHost write SetHost;
property Alias: string read GetAlias write SetAlias;
property Version: string read GetVersion write SetVersion;
property LongMetadataNames: Boolean read SetLongMetadataNames write GetLongMetadataNames;
property ClientLibrary: string read GetClientLibrary write SetClientLibrary;
property Protocol: string read GetProtocol write SetProtocol;
property Port: string read GetPort write SetPort;
property SecurityDatabase: string read GetSecurityDatabase write SetSecurityDatabase;
property UserName: string read GetUserName write SetUserName;
property Password: string read GetPassword write SetPassword;
property Role: string read GetRole write SetRole;
property LoginPrompt: Boolean read GetLoginPrompt write SetLoginPrompt;
property Description: string read GetDescription write SetDescription;
property ConnectPath: string read GetConnectPath;
property InstanceName: string read GetInstanceName write SetInstanceName;
// invisible
property DirectoryIID: string read GetDirectoryIID write SetDirectoryIID;
end;
TfibSHServerOptions = class(TSHComponentOptions, IibSHServerOptions, IibSHDummy)
private
FHost: string;
FVersion: string;
FClientLibrary: string;
FProtocol: string;
FPort: string;
FSecurityDatabase: string;
FUserName: string;
FPassword: string;
FRole: string;
FLoginPrompt: Boolean;
FSaveResultFilterIndex: Integer;
protected
function GetHost: string;
procedure SetHost(Value: string);
function GetVersion: string;
procedure SetVersion(Value: string);
function GetClientLibrary: string;
procedure SetClientLibrary(Value: string);
function GetProtocol: string;
procedure SetProtocol(Value: string);
function GetPort: string;
procedure SetPort(Value: string);
function GetSecurityDatabase: string;
procedure SetSecurityDatabase(Value: string);
function GetUserName: string;
procedure SetUserName(Value: string);
function GetPassword: string;
procedure SetPassword(Value: string);
function GetRole: string;
procedure SetRole(Value: string);
function GetLoginPrompt: Boolean;
procedure SetLoginPrompt(Value: Boolean);
function GetSaveResultFilterIndex: Integer;
procedure SetSaveResultFilterIndex(Value: Integer);
function GetParentCategory: string; override;
function GetCategory: string; override;
procedure RestoreDefaults; override;
public
constructor Create(AOwner: TComponent); override;
published
property Host: string read FHost write FHost;
property Version: string read FVersion write FVersion;
property ClientLibrary: string read FClientLibrary write FClientLibrary;
property Protocol: string read FProtocol write FProtocol;
property Port: string read FPort write FPort;
property SecurityDatabase: string read FSecurityDatabase write FSecurityDatabase;
property UserName: string read FUserName write FUserName;
property Password: string read FPassword write FPassword;
property Role: string read FRole write FRole;
property LoginPrompt: Boolean read GetLoginPrompt write SetLoginPrompt;
//Invisible
property SaveResultFilterIndex: Integer read GetSaveResultFilterIndex write SetSaveResultFilterIndex;
end;
TibSHServerOptions = class(TfibSHServerOptions, IibSHServerOptions, IibSHBranch)
end;
TfbSHServerOptions = class(TfibSHServerOptions, IfbSHServerOptions, IfbSHBranch)
end;
implementation
uses
ibSHConsts, ibSHMessages;
{ TibSHServer }
constructor TibSHServer.Create(AOwner: TComponent);
var
vComponentClass: TSHComponentClass;
begin
inherited Create(AOwner);
FDirectoryIID := GUIDToString(InstanceIID);
FSchemeClassIIDList := TStringList.Create;
vComponentClass := Designer.GetComponent(IibSHDRVService_FIBPlus);
if Assigned(vComponentClass) then FDRVService := vComponentClass.Create(nil);
Version := Format('%s', [SFirebird15]);
ClientLibrary := Format('%s', [Sgds32]);
Protocol := Format('%s', [STCPIP]);
Port := Format('%s', [SDefaultPort]);
UserName := Format('%s', [SDefaultUserName]);
Password := Format('%s', [SDefaultPassword]);
MakePropertyInvisible('LongMetadataNames');
MakePropertyInvisible('InstanceName');
MakePropertyInvisible('DirectoryIID');
end;
destructor TibSHServer.Destroy;
begin
FSchemeClassIIDList.Free;
FDRVService.Free;
inherited Destroy;
end;
function TibSHServer.GetBranchIID: TGUID;
begin
Result := inherited GetBranchIID;
if Assigned(Designer.FindComponent(OwnerIID)) then
Result := Designer.FindComponent(OwnerIID).BranchIID;
end;
procedure TibSHServer.SetOwnerIID(Value: TGUID);
begin
inherited SetOwnerIID(Value);
DoOnApplyOptions;
end;
procedure TibSHServer.DoOnApplyOptions;
var
Options: IibSHServerOptions;
begin
if IsEqualGUID(BranchIID, IibSHBranch) then
Supports(Designer.GetOptions(IibSHServerOptions), IibSHServerOptions, Options);
if IsEqualGUID(BranchIID, IfbSHBranch) then
Supports(Designer.GetOptions(IfbSHServerOptions), IibSHServerOptions, Options);
if Assigned(Options) then
begin
Host := Options.Host;
Version := Options.Version;
ClientLibrary := Options.ClientLibrary;
Protocol := Options.Protocol;
Port := Options.Port;
SecurityDatabase := Options.SecurityDatabase;
UserName := Options.UserName;
Password := Options.Password;
Role := Options.Role;
LoginPrompt := Options.LoginPrompt;
end;
Options := nil;
end;
function TibSHServer.GetDRVService: IibSHDRVService;
begin
Supports(FDRVService, IibSHDRVService, Result);
end;
function TibSHServer.DRVNormalize(const DriverIID: TGUID): TGUID;
begin
Result := DriverIID;
if not LongMetadataNames then
begin
if IsEqualGUID(DriverIID, IibSHDRVDatabase) then Result := IibSHDRVDatabase_FIBPlus;
if IsEqualGUID(DriverIID, IibSHDRVTransaction) then Result := IibSHDRVTransaction_FIBPlus;
if IsEqualGUID(DriverIID, IibSHDRVQuery) then Result := IibSHDRVQuery_FIBPlus;
if IsEqualGUID(DriverIID, IibSHDRVDataset) then Result := IibSHDRVDataset_FIBPlus;
if IsEqualGUID(DriverIID, IibSHDRVMonitor) then Result := IibSHDRVMonitor_FIBPlus;
if IsEqualGUID(DriverIID, IibSHDRVSQLParser) then Result := IibSHDRVSQLParser_FIBPlus;
if IsEqualGUID(DriverIID, IibSHDRVPlayer) then Result := IibSHDRVPlayer_FIBPlus;
if IsEqualGUID(DriverIID, IibSHDRVStatistics) then Result := IibSHDRVStatistics_FIBPlus;
// if IsEqualGUID(DriverIID, IibSHDRVService) then Result := IibSHDRVService_FIBPLus;
end else
begin
if IsEqualGUID(DriverIID, IibSHDRVDatabase) then Result := IibSHDRVDatabase_FIBPlus68;
if IsEqualGUID(DriverIID, IibSHDRVTransaction) then Result := IibSHDRVTransaction_FIBPlus68;
if IsEqualGUID(DriverIID, IibSHDRVQuery) then Result := IibSHDRVQuery_FIBPlus68;
if IsEqualGUID(DriverIID, IibSHDRVDataset) then Result := IibSHDRVDataset_FIBPlus68;
if IsEqualGUID(DriverIID, IibSHDRVMonitor) then Result := IibSHDRVMonitor_FIBPlus68;
if IsEqualGUID(DriverIID, IibSHDRVSQLParser) then Result := IibSHDRVSQLParser_FIBPlus68;
if IsEqualGUID(DriverIID, IibSHDRVPlayer) then Result := IibSHDRVPlayer_FIBPlus68;
if IsEqualGUID(DriverIID, IibSHDRVStatistics) then Result := IibSHDRVStatistics_FIBPlus68;
end;
end;
function TibSHServer.PrepareDRVService: Boolean;
begin
Result := Assigned(DRVService);
if Result then
begin
DRVService.ConnectProtocol := Protocol;
DRVService.ConnectPort := Port;
DRVService.ConnectLibraryName := ClientLibrary;
DRVService.ConnectLoginPrompt := LoginPrompt;
DRVService.ConnectUser := UserName;
DRVService.ConnectPassword := Password;
DRVService.ConnectRole := Role;
DRVService.ConnectServer := Host;
DRVService.ConnectDatabase := EmptyStr;
end;
end;
function TibSHServer.GetHost: string;
begin
Result := FHost;
end;
procedure TibSHServer.SetHost(Value: string);
begin
FHost := Value;
if Length(Alias) = 0 then Alias := FHost;
end;
function TibSHServer.GetAlias: string;
begin
Result := FAlias;
end;
procedure TibSHServer.SetAlias(Value: string);
begin
FAlias := Value;
end;
function TibSHServer.GetVersion: string;
begin
Result := FVersion;
end;
procedure TibSHServer.SetVersion(Value: string);
var
EditorRegistrator: IibSHEditorRegistrator;
begin
if (not Connected) and (FVersion <> Value) then
begin
FVersion := Value;
//
// Отрабатываем сокрытие пропертей по версии сервера
//
if AnsiSameText(FVersion, SInterBase2007) then
MakePropertyVisible('InstanceName')
else
begin
MakePropertyInvisible('InstanceName');
InstanceName := '';
end;
if AnsiSameText(FVersion, SInterBase70) or
AnsiSameText(FVersion, SInterBase71) or
AnsiSameText(FVersion, SInterBase75) or
AnsiSameText(FVersion, SInterBase2007)
then
begin
MakePropertyInvisible('Port');
// MakePropertyVisible('LongMetadataNames');
MakePropertyInvisible('LongMetadataNames');
LongMetadataNames:=True;
end
else
begin
MakePropertyInvisible('LongMetadataNames');
LongMetadataNames := False;
end;
//
// Нотифицируем механизм регистрации текстовых редакторов о смене версии сервера
//
if Supports(Designer.GetDemon(IibSHEditorRegistrator), IibSHEditorRegistrator, EditorRegistrator) then
EditorRegistrator.AfterChangeServerVersion(Self);
end;
end;
function TibSHServer.SetLongMetadataNames: Boolean;
begin
Result := FLongMetadataNames;
end;
procedure TibSHServer.GetLongMetadataNames(Value: Boolean);
begin
FLongMetadataNames := Value;
end;
function TibSHServer.GetClientLibrary: string;
begin
Result := FClientLibrary;
end;
procedure TibSHServer.SetClientLibrary(Value: string);
begin
FClientLibrary := Value;
end;
function TibSHServer.GetProtocol: string;
begin
Result := FProtocol;
end;
procedure TibSHServer.SetProtocol(Value: string);
begin
FProtocol := Value;
end;
function TibSHServer.GetPort: string;
begin
Result := FPort;
end;
procedure TibSHServer.SetPort(Value: string);
begin
FPort := Value;
end;
function TibSHServer.GetSecurityDatabase: string;
begin
Result := FSecurityDatabase;
end;
procedure TibSHServer.SetSecurityDatabase(Value: string);
begin
FSecurityDatabase := Value;
end;
function TibSHServer.GetUserName: string;
begin
Result := FUserName;
end;
procedure TibSHServer.SetUserName(Value: string);
begin
FUserName := Value;
end;
function TibSHServer.GetPassword: string;
begin
Result := FPassword;
end;
procedure TibSHServer.SetPassword(Value: string);
begin
FPassword := Value;
end;
function TibSHServer.GetRole: string;
begin
Result := FRole;
end;
procedure TibSHServer.SetRole(Value: string);
begin
FRole := Value;
end;
function TibSHServer.GetLoginPrompt: Boolean;
begin
Result := FLoginPrompt;
end;
procedure TibSHServer.SetLoginPrompt(Value: Boolean);
begin
FLoginPrompt := Value;
end;
function TibSHServer.GetDescription: string;
begin
Result := FDescription;
end;
procedure TibSHServer.SetDescription(Value: string);
begin
FDescription := Value;
end;
function TibSHServer.GetConnectPath: string;
begin
Result := Host;
if AnsiSameText(Protocol, STCPIP) then
begin
if AnsiSameText(Port, '3050') then
Result := Format('%s:', [Host])
else
Result := Format('%s/%s:', [Host, Port]);
end;
if AnsiSameText(Protocol, SNamedPipe) then
Result := Format('\\%s\',[Host]);
if AnsiSameText(Protocol, SSPX) then
Result := Format('%s@',[host]);
if AnsiSameText(Protocol, SLocal) then
Result := Format('%s',[EmptyStr]);
end;
function TibSHServer.GetDirectoryIID: string;
begin
Result := FDirectoryIID;
end;
procedure TibSHServer.SetDirectoryIID(Value: string);
begin
FDirectoryIID := Value;
end;
function TibSHServer.GetCaption: string;
begin
Result := Format('%s', [Alias]);
end;
function TibSHServer.GetCaptionExt: string;
begin
Result := Format('%s, %s, %s', [ConnectPath, Version, ClientLibrary]);
end;
function TibSHServer.GetConnected: Boolean;
//var
// I: Integer;
// ibBTDatabaseIntf: IibSHDatabase;
begin
Result := False;
(*
if Assigned(Designer) then
for I := 0 to Pred(Designer.Components.Count) do
if (Supports(Designer.Components[I], IibSHDatabase, ibBTDatabaseIntf) and
IsEqualGUID(ibBTDatabaseIntf.BranchIID, Self.BranchIID) and
IsEqualGUID(ibBTDatabaseIntf.OwnerIID, Self.InstanceIID) and
ibBTDatabaseIntf.Connected) or
(not Supports(Designer.Components[I], IibSHDatabase) and IsEqualGUID(TSHComponent(Designer.Components[I]).OwnerIID, InstanceIID)) then
begin
Result := True;
Break;
end;
*)
end;
function TibSHServer.GetCanConnect: Boolean;
begin
Result := False;
end;
function TibSHServer.GetCanReconnect: Boolean;
begin
Result := False;
end;
function TibSHServer.GetCanDisconnect: Boolean;
begin
Result := False;
end;
function TibSHServer.GetCanShowRegistrationInfo: Boolean;
begin
Result := True;
end;
function TibSHServer.ShowRegistrationInfo: Boolean;
var
OldDataRootDirectory: string;
begin
Result := False;
OldDataRootDirectory := GetDataRootDirectory;
Self.Tag := 4;
try
if IsPositiveResult(Designer.ShowModal(Self, SCallRegister)) then
begin
if not AnsiSameText(OldDataRootDirectory, GetDataRootDirectory) then
RenameDirectory(OldDataRootDirectory, GetDataRootDirectory);
Designer.SaveRegisteredConnectionInfo;
Result := True;
end;
finally
Self.Tag := 0;
end;
end;
procedure TibSHServer.IDELoadFromFileNotify;
begin
CreateDirectory(GetDataRootDirectory);
end;
function TibSHServer.GetSchemeClassIIDList(WithSystem: Boolean = False): TStrings;
begin
Result := SchemeClassIIDList;
end;
function TibSHServer.GetSchemeClassIIDList(const AObjectName: string): TStrings;
begin
Result := SchemeClassIIDList;
end;
function TibSHServer.GetObjectNameList: TStrings;
begin
Result := nil;
end;
function TibSHServer.GetObjectNameList(const AClassIID: TGUID): TStrings;
begin
Result := nil;
end;
function TibSHServer.Connect: Boolean;
begin
Result := CanConnect;
end;
function TibSHServer.Reconnect: Boolean;
begin
Result := CanReconnect;
end;
function TibSHServer.Disconnect: Boolean;
begin
Result := not Connected;
end;
procedure TibSHServer.Refresh;
begin
//Empty
end;
function TibSHServer.GetCanTestConnection: Boolean;
begin
Result := not Connected;
end;
function TibSHServer.TestConnection: Boolean;
var
Msg: string;
MsgType: TMsgDlgType;
begin
Result := GetCanTestConnection;
if Result then
begin
try
Screen.Cursor := crHourGlass;
try
Result := PrepareDRVService and DRVService.Attach(stBackupService);
except
Result := False;
end;
finally
if Assigned(DRVService) then DRVService.Detach;
Screen.Cursor := crDefault;
end;
if Result then
begin
Msg := Format(SServerTestConnectionOK, [Self.CaptionExt]);
MsgType := mtInformation;
end else
begin
if Assigned(DRVService) then
Msg := Format(SServerTestConnectionNO, [Self.CaptionExt, DRVService.ErrorText])
else
Msg := Format(SServerTestConnectionNO, [Self.CaptionExt, SDriverIsNotInstalled]);
MsgType := mtWarning;
end;
Designer.ShowMsg(Msg, MsgType);
end;
end;
function TibSHServer.GetDataRootDirectory: string;
var
vDataRootDirectory: ISHDataRootDirectory;
begin
if Supports(Designer.GetDemon(BranchIID), ISHDataRootDirectory, vDataRootDirectory) then
Result := IncludeTrailingPathDelimiter(Format('%sServers\%s.%s', [vDataRootDirectory.DataRootDirectory, Alias, DirectoryIID]));
end;
function TibSHServer.CreateDirectory(const FileName: string): Boolean;
begin
Result := not SysUtils.DirectoryExists(FileName) and ForceDirectories(FileName);
end;
function TibSHServer.RenameDirectory(const OldName, NewName: string): Boolean;
begin
Result := SysUtils.DirectoryExists(OldName) and RenameFile(OldName, NewName);
end;
function TibSHServer.DeleteDirectory(const FileName: string): Boolean;
begin
Alias := Format('#.Unregistered.%s', [Alias]);
Result := RenameDirectory(FileName, GetDataRootDirectory);
end;
function TibSHServer.GetInstanceName: string;
begin
Result:= FInstanceName;
end;
procedure TibSHServer.SetInstanceName(const Value: string);
begin
FInstanceName:=Value
end;
{ TfibSHServerOptions }
function TfibSHServerOptions.GetParentCategory: string;
begin
if Supports(Self, IibSHBranch) then Result := Format('%s', [SibOptionsCategory]);
if Supports(Self, IfbSHBranch) then Result := Format('%s', [SfbOptionsCategory]);
end;
function TfibSHServerOptions.GetCategory: string;
begin
Result := Format('%s', [SServerOptionsCategory]);
end;
procedure TfibSHServerOptions.RestoreDefaults;
begin
Host := EmptyStr;
if Supports(Self, IibSHBranch) then Version := SInterBase75;
if Supports(Self, IfbSHBranch) then Version := SFirebird20;
if Supports(Self, IibSHBranch) then ClientLibrary := Sgds32;
if Supports(Self, IfbSHBranch) then ClientLibrary := Sfbclient;
Protocol := Protocols[0];
Port := SDefaultPort;
SecurityDatabase := EmptyStr;
UserName := SDefaultUserName;
Password := SDefaultPassword;
Role := EmptyStr;
LoginPrompt := False;
end;
constructor TfibSHServerOptions.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FSaveResultFilterIndex := 0;
MakePropertyInvisible('SaveResultFilterIndex');
end;
function TfibSHServerOptions.GetHost: string;
begin
Result := Host;
end;
procedure TfibSHServerOptions.SetHost(Value: string);
begin
Host := Value;
end;
function TfibSHServerOptions.GetVersion: string;
begin
Result := Version;
end;
procedure TfibSHServerOptions.SetVersion(Value: string);
begin
Version := Value;
end;
function TfibSHServerOptions.GetClientLibrary: string;
begin
Result := ClientLibrary;
end;
procedure TfibSHServerOptions.SetClientLibrary(Value: string);
begin
ClientLibrary := Value;
end;
function TfibSHServerOptions.GetProtocol: string;
begin
Result := Protocol;
end;
procedure TfibSHServerOptions.SetProtocol(Value: string);
begin
Protocol := Value;
end;
function TfibSHServerOptions.GetPort: string;
begin
Result := Port;
end;
procedure TfibSHServerOptions.SetPort(Value: string);
begin
Port := Value;
end;
function TfibSHServerOptions.GetSecurityDatabase: string;
begin
Result := SecurityDatabase;
end;
procedure TfibSHServerOptions.SetSecurityDatabase(Value: string);
begin
SecurityDatabase := Value;
end;
function TfibSHServerOptions.GetUserName: string;
begin
Result := UserName;
end;
procedure TfibSHServerOptions.SetUserName(Value: string);
begin
UserName := Value;
end;
function TfibSHServerOptions.GetPassword: string;
begin
Result := Password;
end;
procedure TfibSHServerOptions.SetPassword(Value: string);
begin
Password := Value;
end;
function TfibSHServerOptions.GetRole: string;
begin
Result := Role;
end;
procedure TfibSHServerOptions.SetRole(Value: string);
begin
Role := Value;
end;
function TfibSHServerOptions.GetLoginPrompt: Boolean;
begin
Result := FLoginPrompt;
end;
procedure TfibSHServerOptions.SetLoginPrompt(Value: Boolean);
begin
FLoginPrompt := Value;
end;
function TfibSHServerOptions.GetSaveResultFilterIndex: Integer;
begin
Result := FSaveResultFilterIndex;
end;
procedure TfibSHServerOptions.SetSaveResultFilterIndex(Value: Integer);
begin
FSaveResultFilterIndex := Value;
end;
end.
|
unit u_imports;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, u_writers, u_common;
type
TImportLibrary = class(TObject)
public
LibraryPath: string;
Imports, Methods: TStringList;
constructor Create(lpath: string);
destructor Destroy; override;
end;
TImportSection = class(TObject)
public
Libs: TList;
Lines: TStringList;
constructor Create(sl: TStringList);
destructor Destroy; override;
function GetLibIndx(l_path: string): integer;
procedure AddMethod(l_path, m_name, exm_name: string);
procedure ParseSection;
procedure GenerateCode(Stream: TStream);
end;
implementation
{** ImportLibrary **}
constructor TImportLibrary.Create(lpath: string);
begin
LibraryPath := lpath;
Imports := TStringList.Create;
Methods := TStringList.Create;
inherited Create;
end;
destructor TImportLibrary.Destroy;
begin
Imports.Free;
Methods.Free;
inherited Destroy;
end;
{** ImportSection **}
constructor TImportSection.Create(sl: TStringList);
begin
Self.Lines := sl;
Libs := TList.Create;
inherited Create;
end;
destructor TImportSection.Destroy;
var
w: word;
begin
if Libs.Count > 0 then
for w := 0 to Libs.Count - 1 do
TImportLibrary(Libs[w]).Free;
FreeAndNil(Libs);
inherited Destroy;
end;
function TImportSection.GetLibIndx(l_path: string): integer;
var
c: cardinal;
begin
Result := -1;
c := 0;
while c < Libs.Count do
begin
if TImportLibrary(Libs[c]).LibraryPath = l_path then
begin
Result := c;
break;
end;
Inc(c);
end;
end;
procedure TImportSection.AddMethod(l_path, m_name, exm_name: string);
var
lb_indx: integer;
begin
lb_indx := GetLibIndx(l_path);
if lb_indx <> -1 then
begin
with TImportLibrary(Libs[lb_indx]) do
begin
if Methods.IndexOf(m_name) <> -1 then
AsmErr('Dublicate import "' + m_name + '", from "' +
l_path + '":"' + exm_name + '"');
Methods.Add(m_name);
Imports.Add(exm_name);
end;
end
else
begin
Libs.Add(TImportLibrary.Create(l_path));
with TImportLibrary(Libs[Libs.Count - 1]) do
begin
Methods.Add(m_name);
Imports.Add(exm_name);
end;
end;
end;
procedure TImportSection.ParseSection;
var
c: cardinal;
s: string;
begin
c := 0;
while c < Lines.Count do
begin
s := trim(Lines[c]);
if Tk(s, 1) = 'import' then
begin
AddMethod(Tk(s, 3), Tk(s, 2), Tk(s, 4));
Lines[c] := '';
end;
Inc(c);
end;
end;
procedure TImportSection.GenerateCode(Stream: TStream);
var
w, w1: word;
b: byte;
c: cardinal;
begin
w := Libs.Count;
St_WriteWord(Stream, w);
if w > 0 then
begin
for w := 0 to Libs.Count - 1 do
with TImportLibrary(Libs[w]) do
begin
w1 := Length(LibraryPath);
St_WriteWord(Stream, w1);
Stream.WriteBuffer(LibraryPath[1], w1);
end;
c := 0;
for w := 0 to Libs.Count - 1 do
with TImportLibrary(Libs[w]) do
begin
c := c + Imports.Count;
end;
St_WriteCardinal(Stream, c);
for w := 0 to Libs.Count - 1 do
with TImportLibrary(Libs[w]) do
begin
if Imports.Count > 0 then
for w1 := 0 to Imports.Count - 1 do
begin
b := Length(Imports[w1]);
St_WriteWord(Stream, w);
Stream.WriteByte(b);
if b > 0 then
Stream.WriteBuffer(Imports[w1][1], b);
end;
end;
end;
end;
end.
|
{*******************************************************}
{ 单元名: UntSocketServer.pas }
{ 创建日期:2006-2-28 20:36:19 }
{ 创建者 }
{ 功能: Tcp服务抽象基类 }
{ }
{*******************************************************}
unit UntSocketServer;
interface
uses
UntTBaseSocketServer, UntTIO, sysutils, untASIOSvr, WinSock;
type
TCenterServer = class
private
protected
procedure OnCreate(ISocket: TBaseSocketServer); virtual;
procedure OnDestroy; virtual;
procedure OnConning(ClientThread: TAsioClient); virtual;
function OnCheckLogin(ClientThread: TAsioClient): boolean; virtual;
{用户断开事件}
procedure OnDisConn(ClientThread: TAsioClient); virtual;
function OnDataCase(ClientThread: TAsioClient; Ihead: integer): Boolean;
virtual;
procedure OnException(ClientThread: TAsioClient; Ie: Exception); virtual;
//------------------------------------------------------------------------------
// 本类自己使用的方法 2006-8-23 马敏钊
//------------------------------------------------------------------------------
{用户连接事件 也是入口事件}
procedure UserConn(ClientThread: TAsioClient; Iwantlen: integer);
{处理命令事件}
procedure DataCase(ClientThread: TAsioClient); virtual;
public
Shower: TIOer;
Socket: TBaseSocketServer;
{*根据线程获取IP和端口号}
function GetUserIpAndPort(ClientThread: TAsioClient): string;
constructor Create(IServerPort: Integer; Iio: TIOer = nil);
destructor Destroy; override;
end;
implementation
uses UntBaseProctol, pmybasedebug;
{ TSocketServer }
constructor TCenterServer.Create(IServerPort: Integer; Iio: TIOer = nil);
begin
Socket := TBaseSocketServer.Create(IServerPort);
Socket.Server.FOnCaseData := UserConn;
Socket.Server.FOnClientDisConn := OnDisConn;
Socket.Server.StartSvr(IServerPort);
Shower := Iio;
OnCreate(Socket);
end;
destructor TCenterServer.Destroy;
begin
OnDestroy;
Socket.Free;
inherited;
end;
procedure TCenterServer.DataCase(ClientThread: TAsioClient);
var
Lhead: Integer;
begin
if (ClientThread.DeadTime = 0) then begin
Lhead := ClientThread.RcvDataBuffer.ReadInteger;
case Lhead of //
-1: ; //Shower.AddShow('收到Client %s:%d 的心跳信息',[ClientThread.Socket.PeerIPAddress, ClientThread.Socket.PeerPort]);
else
if not OnDataCase(ClientThread, Lhead) then
if Shower <> nil then
Shower.AddShow(Format('收到错误的命令包%d', [Lhead]));
end; // case
end; // while
end;
procedure TCenterServer.OnCreate(ISocket: TBaseSocketServer);
begin
if Shower <> nil then
Shower.AddShow('服务成功启动...端口:%d', [ISocket.Server.Fport]);
end;
type
RBaseCaserd = packed record
Id: Integer;
Len: Integer;
Pointer: integer;
end;
PRBaseCaserd = ^RBaseCaserd;
procedure TCenterServer.UserConn(ClientThread: TAsioClient; Iwantlen: integer);
var
i, Lhead: Integer;
LPrd: PRBaseCaserd;
Lbuff: TPoolItem;
IClient: TAsioClient;
begin
IClient := ClientThread;
if IClient.DeadTime > 0 then Exit;
try
if IClient.ConnState = Casio_State_Init then begin
OnConning(ClientThread);
if OnCheckLogin(ClientThread) then begin
ClientThread.ConnState := Casio_State_Conned
end
else begin
ClientThread.ConnState := Casio_State_DisConn;
OnDisConn(ClientThread);
ClientThread.Socket.Disconnect;
end;
end
else if IClient.ConnState = Casio_State_Conned then begin
//判断数据处理状态
case IClient.RcvDataBuffer.State of //读取数据头
CdataRcv_State_head: begin
IClient.RcvDataBuffer.ReadInteger(true); //包头
IClient.RcvDataBuffer.WantData := IClient.RcvDataBuffer.ReadInteger(true); //4个字节 //长度
IClient.RcvDataBuffer.State := CdataRcv_State_Body; //读取包体
// DeBug('收到数据<Currpost:%d ReadPos:%d NextSize:%d wantdata:%d>',
// [IClient.RcvDataBuffer.CurrPost, IClient.RcvDataBuffer.ReadPos,
// IClient.RcvDataBuffer.Memory.Position, IClient.RcvDataBuffer.WantData]);
end;
CdataRcv_State_len: begin //读取数据长度
IClient.RcvDataBuffer.WantData := IClient.RcvDataBuffer.ReadInteger(true); //4个字节
IClient.RcvDataBuffer.State := CdataRcv_State_Body;
// DeBug('处理长度<Currpost:%d ReadPos:%d NextSize:%d wantdata:%d>',
// [IClient.RcvDataBuffer.CurrPost, IClient.RcvDataBuffer.ReadPos,
// IClient.RcvDataBuffer.Memory.Position, IClient.RcvDataBuffer.WantData]);
end;
CdataRcv_State_Body: begin //处理包体
//IClient.RcvDataBuffer.ReadBuff(IClient.RcvDataBuffer.WantData); //4个字节
IClient.RcvDataBuffer.WantData := 8;
IClient.RcvDataBuffer.State := CdataRcv_State_head;
// DeBug('处理包体<Currpost:%d ReadPos:%d NextSize:%d wantdata:%d>',
// [IClient.RcvDataBuffer.CurrPost, IClient.RcvDataBuffer.ReadPos,
// IClient.RcvDataBuffer.Memory.Position, IClient.RcvDataBuffer.wantdata]);
{处理数据包}
DataCase(IClient);
// LPrd := PRBaseCaserd(@IClient.RcvDataBuffer.Gbuff[0]);
// case LPrd^.Id of
// 1: begin //发送echo数据
// Lbuff := IClient.MemPool.GetBuff(Ckind_FreeMem);
// Lbuff.FMem.Position := 0;
// //运算并返回结果
// Lhead := 0;
// for i := 8 to 11 do begin
// inc(Lhead, IClient.RcvDataBuffer.Gbuff[i]);
// end;
// LPrd^.Pointer := Lhead;
// Lbuff.FMem.WriteBuffer(LPrd^, 8 + 4);
// IClient.SendData(Lbuff);
//// DeBug('回复->%d', [LPrd^.Pointer]);
// end;
// 2: ; //心跳包
// end;
end;
end;
end;
except
on e: exception do begin
OnException(ClientThread, e);
end;
end;
end;
procedure TCenterServer.OnConning(ClientThread: TAsioClient);
begin
if Shower <> nil then
Shower.AddShow(Format('来自%s:%d用户建立连接', [ClientThread.PeerIP, ClientThread.PeerPort]));
end;
function TCenterServer.OnCheckLogin(ClientThread: TAsioClient): boolean;
begin
Result := True;
if ClientThread.RcvDataBuffer.ReadInteger <> CTSLogin then begin
Result := False;
Socket.SendHead(STCLoginFault_Vison, ClientThread);
end;
if ClientThread.Socket.ReadInteger <> CClientID then begin
Result := False;
Socket.SendHead(STCLoginFault_Vison, ClientThread);
end;
if Result then
Socket.SendHead(STCLogined, ClientThread);
end;
procedure TCenterServer.OnDisConn(ClientThread: TAsioClient);
begin
if (ClientThread <> nil) and (ClientThread.Socket <> nil) then begin
if Shower <> nil then
Shower.AddShow('用户断开连接了');
ClientThread.Socket.Disconnect;
end
end;
function TCenterServer.OnDataCase(ClientThread: TAsioClient; Ihead: integer):
Boolean;
begin
Result := True;
end;
procedure TCenterServer.OnException(ClientThread: TAsioClient; Ie: Exception);
begin
if Shower <> nil then
Shower.AddShow(Format('用户服务线程异常 原因:%s', [Ie.ClassName + '>> ' + Ie.Message]));
end;
procedure TCenterServer.OnDestroy;
begin
if Shower <> nil then
Shower.AddShow('服务释放成功...');
end;
function TCenterServer.GetUserIpAndPort(ClientThread: TAsioClient): string;
begin
Result := ClientThread.PeerIP + ':' + IntToStr(ClientThread.PeerPort);
end;
end.
|
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright (c) 1995 Borland International }
{ Portions copyright (c) 1997 Master-Bank }
{ }
{*******************************************************}
unit StrLEdit;
interface
uses {$IFDEF WIN32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF} Classes,
Graphics, Forms, Controls, Buttons, Dialogs, StdCtrls, ExtCtrls;
type
TStrEditDlg = class(TForm)
Memo: TMemo;
LineCount: TLabel;
OpenDialog: TOpenDialog;
SaveDialog: TSaveDialog;
HelpBtn: TButton;
LoadBtn: TButton;
SaveBtn: TButton;
bibOk: TBitBtn;
bibCancel: TBitBtn;
procedure FileOpen(Sender: TObject);
procedure FileSave(Sender: TObject);
procedure UpdateStatus(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure MemoKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure HelpBtnClick(Sender: TObject);
private
SingleLine: string[15];
MultipleLines: string[15];
end;
implementation
{$R *.DFM}
uses SysUtils{, LibHelp};
{ TStrListEditDlg }
procedure TStrEditDlg.FileOpen(Sender: TObject);
begin
with OpenDialog do
if Execute then Memo.Lines.LoadFromFile(FileName);
end;
procedure TStrEditDlg.FileSave(Sender: TObject);
begin
SaveDialog.FileName := OpenDialog.FileName;
with SaveDialog do
if Execute then Memo.Lines.SaveToFile(FileName);
end;
procedure TStrEditDlg.UpdateStatus(Sender: TObject);
var
Count: Integer;
begin
Count := Memo.Lines.Count;
if Count = 1 then
LineCount.Caption := Format('%d %s', [Count, SingleLine])
else
LineCount.Caption := Format('%d %s', [Count, MultipleLines]);
end;
procedure TStrEditDlg.FormCreate(Sender: TObject);
begin
{ HelpContext := hcDStringListEditor;
OpenDialog.HelpContext := hcDStringListLoad;
SaveDialog.HelpContext := hcDStringListSave;}
SingleLine := 'Линия';
MultipleLines := 'Линий';
end;
procedure TStrEditDlg.MemoKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then bibCancel.Click;
end;
procedure TStrEditDlg.HelpBtnClick(Sender: TObject);
begin
Application.HelpContext(HelpContext);
end;
end.
|
unit DPM.IDE.MessageForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
System.Diagnostics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.StdCtrls,
Vcl.ActnList,
Vcl.ExtCtrls,
VSoft.Awaitable,
DPM.IDE.Options,
DPM.Controls.LogMemo,
ToolsAPI, System.Actions;
{$I ..\DPMIDE.inc}
type
TDPMMessageForm = class(TForm {$IFDEF THEMESERVICES}, INTAIDEThemingServicesNotifier {$ENDIF})
btnCancel: TButton;
ActionList1: TActionList;
actCanCancel: TAction;
btnCopy: TButton;
actCopyLog: TAction;
btnClose: TButton;
ClosingInTimer: TTimer;
lblClosing: TLabel;
lblDontClose: TLinkLabel;
procedure actCanCancelExecute(Sender: TObject);
procedure actCopyLogExecute(Sender: TObject);
procedure FormHide(Sender: TObject);
procedure ActionList1Update(Action: TBasicAction; var Handled: Boolean);
procedure btnCloseClick(Sender: TObject);
procedure ClosingInTimerTimer(Sender: TObject);
procedure lblDontCloseLinkClick(Sender: TObject; const Link: string;
LinkType: TSysLinkType);
private
FOptions : IDPMIDEOptions;
FLogMemo : TLogMemo;
FCancellationTokenSource : ICancellationTokenSource;
FCloseDelayInSeconds : integer;
FCurrentCloseDelay : integer;
FStopwatch : TStopwatch;
{$IFDEF THEMESERVICES}
FNotifierId : integer;
{$ENDIF}
procedure SetCancellationTokenSource(const Value: ICancellationTokenSource);
procedure SetCloseDelayInSeconds(const Value: integer);
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure CMStyleChanged(var Message: TMessage); message CM_STYLECHANGED;
//INTAIDEThemingServicesNotifier
procedure ChangingTheme;
procedure ChangedTheme;
procedure AfterSave;
procedure BeforeSave;
procedure Destroyed;
procedure Modified;
procedure ProcessMessages;
public
constructor Create(AOwner : TComponent; const options : IDPMIDEOptions);reintroduce;
destructor Destroy; override;
procedure Debug(const data : string);
procedure Error(const data : string);
procedure Information(const data : string; const important : Boolean = False);
procedure Success(const data : string; const important : Boolean = False);
procedure Verbose(const data : string; const important : Boolean = False);
procedure Warning(const data : string; const important : Boolean = False);
procedure NewLine;
procedure Clear;
procedure DelayHide;
property CancellationTokenSource : ICancellationTokenSource read FCancellationTokenSource write SetCancellationTokenSource;
property CloseDelayInSeconds : integer read FCloseDelayInSeconds write SetCloseDelayInSeconds;
end;
implementation
uses
Vcl.Themes,
Vcl.clipbrd,
DPM.IDE.ToolsAPI;
{$R *.dfm}
{ TDPMMessageForm }
procedure TDPMMessageForm.actCanCancelExecute(Sender: TObject);
var
tokenSource : ICancellationTokenSource;
begin
tokenSource := FCancellationTokenSource;
if tokenSource <> nil then
tokenSource.Cancel;
end;
procedure TDPMMessageForm.actCopyLogExecute(Sender: TObject);
begin
Clipboard.AsText := FLogMemo.Text;
end;
procedure TDPMMessageForm.ActionList1Update(Action: TBasicAction; var Handled: Boolean);
begin
actCopyLog.Enabled := FLogMemo.RowCount > 0;
actCanCancel.Enabled := (FCancellationTokenSource <> nil) and (not FCancellationTokenSource.Token.IsCancelled);
Handled := true;
end;
procedure TDPMMessageForm.AfterSave;
begin
end;
procedure TDPMMessageForm.BeforeSave;
begin
end;
procedure TDPMMessageForm.btnCloseClick(Sender: TObject);
begin
ClosingInTimer.Enabled := false;
FCurrentCloseDelay := FCloseDelayInSeconds;
Self.Hide;
end;
procedure TDPMMessageForm.ChangedTheme;
{$IFDEF THEMESERVICES}
var
ideThemeSvc : IOTAIDEThemingServices;
{$ENDIF}
begin
{$IFDEF THEMESERVICES}
ideThemeSvc := (BorlandIDEServices as IOTAIDEThemingServices);
if ideThemeSvc.IDEThemingEnabled then
ideThemeSvc.ApplyTheme(Self);
FLogMemo.StyleServices := ideThemeSvc.StyleServices;
{$ENDIF}
end;
procedure TDPMMessageForm.ChangingTheme;
begin
end;
procedure TDPMMessageForm.Clear;
begin
FLogMemo.Clear;
FCurrentCloseDelay := FCloseDelayInSeconds;
lblClosing.Visible := false;
lblDontClose.Visible := false;
end;
procedure TDPMMessageForm.ClosingInTimerTimer(Sender: TObject);
begin
ClosingInTimer.Enabled := false;
Dec(FCurrentCloseDelay);
if FCurrentCloseDelay > 0 then
begin
lblClosing.Caption := 'Closing in ' + IntToStr(FCurrentCloseDelay) + ' seconds' + StringOfChar('.', FCurrentCloseDelay);
ClosingInTimer.Enabled := true;
end
else
begin
FCurrentCloseDelay := FCloseDelayInSeconds;
Self.Hide;
end;
end;
procedure TDPMMessageForm.CMStyleChanged(var Message: TMessage);
begin
inherited;
end;
constructor TDPMMessageForm.Create(AOwner: TComponent; const options : IDPMIDEOptions);
var
{$IFDEF THEMESERVICES}
ideThemeSvc : IOTAIDEThemingServices;
{$ENDIF}
IDEStyleServices : TCustomStyleServices;
begin
inherited Create(AOwner);
FOptions := options;
Self.Width := FOptions.LogWindowWidth;
Self.Height := FOptions.LogWindowHeight;
{$IFDEF STYLEELEMENTS}
StyleElements := [seFont, seClient, seBorder];
{$ENDIF}
{$IFDEF THEMESERVICES}
ideThemeSvc := (BorlandIDEServices as IOTAIDEThemingServices);
if ideThemeSvc.IDEThemingEnabled then
ideThemeSvc.ApplyTheme(Self);
FNotifierId := ideThemeSvc.AddNotifier(Self);
IDEStyleServices := ideThemeSvc.StyleServices;
{$ELSE}
IDEStyleServices := Vcl.Themes.StyleServices;
{$ENDIF}
FLogMemo := TLogMemo.Create(Self);
FLogMemo.TabOrder := 0;
FLogMemo.TabStop := true;
FLogMemo.Top := 10;
FLogMemo.Left := 10;
FLogMemo.Width := Self.ClientWidth - 20;
FLogMemo.Height := Self.ClientHeight - 30 - btnCancel.Height;
FLogMemo.Anchors := [akLeft, akRight, akTop, akBottom];
FLogMemo.StyleServices := IDEStyleServices;
FLogMemo.Clear;
FLogMemo.Parent := Self;
Self.ActiveControl := btnCancel;
FCloseDelayInSeconds := 3;
FCurrentCloseDelay := FCloseDelayInSeconds;
FStopwatch := TStopwatch.Create;
end;
procedure TDPMMessageForm.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.ExStyle := Params.ExStyle or WS_EX_TOPMOST;
end;
procedure TDPMMessageForm.Debug(const data: string);
begin
FLogMemo.AddRow(data, TLogMessageType.mtDebug);
Self.ProcessMessages;
end;
procedure TDPMMessageForm.DelayHide;
begin
ClosingInTimer.Enabled := true;
lblClosing.Caption := 'Closing in ' + IntToStr(FCurrentCloseDelay) + ' seconds' + StringOfChar('.', FCurrentCloseDelay);
lblDontClose.Left := lblClosing.Left + lblClosing.Width + 30;
lblClosing.Visible := true;
lblDontClose.Visible := true;
lblClosing.Update;
end;
destructor TDPMMessageForm.Destroy;
{$IFDEF THEMESERVICES}
var
ideThemeSvc : IOTAIDEThemingServices;
{$ENDIF}
begin
FOptions.LogWindowWidth := Self.Width;
FOptions.LogWindowHeight := Self.Height;
FOptions.SaveToFile();
{$IFDEF THEMESERVICES}
ideThemeSvc := (BorlandIDEServices as IOTAIDEThemingServices);
ideThemeSvc.RemoveNotifier(FNotifierId);
{$ENDIF}
inherited;
end;
procedure TDPMMessageForm.Destroyed;
begin
end;
procedure TDPMMessageForm.Error(const data: string);
begin
FLogMemo.AddRow(data, TLogMessageType.mtError);
Self.ProcessMessages;
end;
procedure TDPMMessageForm.FormHide(Sender: TObject);
begin
FLogMemo.Clear;
end;
procedure TDPMMessageForm.Information(const data: string; const important: Boolean);
begin
if important then
FLogMemo.AddRow(data, TLogMessageType.mtImportantInformation)
else
FLogMemo.AddRow(data, TLogMessageType.mtInformation);
Self.ProcessMessages;
end;
procedure TDPMMessageForm.lblDontCloseLinkClick(Sender: TObject; const Link: string; LinkType: TSysLinkType);
begin
ClosingInTimer.Enabled := false;
lblClosing.Visible := false;
lblDontClose.Visible := false;
FCurrentCloseDelay := FCloseDelayInSeconds;
end;
procedure TDPMMessageForm.Modified;
begin
end;
procedure TDPMMessageForm.NewLine;
begin
FLogMemo.AddRow('',mtInformation);
Self.ProcessMessages;
end;
// We need this here because the core doesn't know it's running in a ui
// so it does not allow messages to pump, so the IDE can appear hung.
// We don't want to this to call application.processmessages too
// often as it will slow things down.
procedure TDPMMessageForm.ProcessMessages;
begin
if not FStopwatch.IsRunning then
begin
FStopwatch.Start;
Application.ProcessMessages;
end
else if FStopwatch.ElapsedMilliseconds > 100 then
begin
FStopwatch.Stop;
Application.ProcessMessages;
FStopwatch.Reset;
FStopwatch.Start;
end;
end;
procedure TDPMMessageForm.SetCancellationTokenSource(const Value: ICancellationTokenSource);
begin
FCancellationTokenSource := Value;
actCanCancel.Update;
end;
procedure TDPMMessageForm.SetCloseDelayInSeconds(const Value: integer);
begin
FCloseDelayInSeconds := Value;
FCurrentCloseDelay := FCloseDelayInSeconds;
end;
procedure TDPMMessageForm.Success(const data: string; const important: Boolean);
begin
if important then
FLogMemo.AddRow(data, TLogMessageType.mtImportantSuccess)
else
FLogMemo.AddRow(data, TLogMessageType.mtSuccess);
Self.ProcessMessages;
end;
procedure TDPMMessageForm.Verbose(const data: string; const important: Boolean);
begin
if important then
FLogMemo.AddRow(data, TLogMessageType.mtImportantVerbose)
else
FLogMemo.AddRow(data, TLogMessageType.mtVerbose);
Self.ProcessMessages;
end;
procedure TDPMMessageForm.Warning(const data: string; const important: Boolean);
begin
if important then
FLogMemo.AddRow(data, TLogMessageType.mtImportantWarning)
else
FLogMemo.AddRow(data, TLogMessageType.mtWarning);
Self.ProcessMessages;
end;
initialization
TToolsApiUtils.RegisterFormClassForTheming(TDPMMessageForm);
end.
|
unit uCounters;
interface
uses
Generics.Collections,
System.DateUtils,
System.SysUtils,
System.Math,
Winapi.Windows,
uMemory;
type
TSpeedSctimatePeriod = class(TObject)
private
FTimeInterval: Cardinal;
FBytesDone: Int64;
public
constructor Create(Interval: Cardinal; BytesDone: Int64);
property TimeInterval: Cardinal read FTimeInterval;
property BytesDone: Int64 read FBytesDone;
end;
TSpeedEstimateCounter = class(TObject)
private
FEstimateInterval: Cardinal;
FStartTime: Cardinal;
FList: TList<TSpeedSctimatePeriod>;
function GetSpeed: Int64;
public
constructor Create(EstimateInterval: Cardinal);
destructor Destroy; override;
procedure Reset;
function GetTimeRemaining(BytesRemaining: Int64): TTime;
procedure AddSpeedInterval(BytesDone: Int64);
property CurrentSpeed: Int64 read GetSpeed;
end;
implementation
{ TSpeedSctimatePeriod }
constructor TSpeedSctimatePeriod.Create(Interval: Cardinal; BytesDone: Int64);
begin
FTimeInterval := Interval;
FBytesDone := BytesDone;
end;
{ TEstimateCounter }
procedure TSpeedEstimateCounter.AddSpeedInterval(BytesDone: Int64);
var
CurrentTime: Cardinal;
CurrentSavedTime: Cardinal;
I: Integer;
begin
CurrentTime := GetTickCount;
FList.Add(TSpeedSctimatePeriod.Create(CurrentTime - FStartTime, BytesDone));
FStartTime := CurrentTime;
//perform cleanup
CurrentSavedTime := 0;
for I := FList.Count - 1 downto 0 do
begin
CurrentSavedTime := CurrentSavedTime + FList[I].TimeInterval;
if (FList.Count > 0) and (CurrentSavedTime > FEstimateInterval) then
begin
FList[I].Free;
FList.Delete(I);
end;
end;
end;
constructor TSpeedEstimateCounter.Create(EstimateInterval: Cardinal);
begin
FEstimateInterval := EstimateInterval;
FStartTime := GetTickCount;
FList := TList<TSpeedSctimatePeriod>.Create;
end;
destructor TSpeedEstimateCounter.Destroy;
begin
FreeList(FList);
inherited;
end;
function TSpeedEstimateCounter.GetSpeed: Int64;
var
S: TSpeedSctimatePeriod;
Time: Cardinal;
begin
Result := 0;
Time := 0;
for S in FList do
begin
Result := Result + S.BytesDone;
Time := Time + S.TimeInterval;
end;
if Time = 0 then
Exit(0);
Result := Round(Min(MaxInt, Result / (Time / 1000)));
end;
function TSpeedEstimateCounter.GetTimeRemaining(BytesRemaining: Int64): TTime;
var
H, M, S, SS, D: Integer;
TimeRem: Extended;
Speed: Int64;
begin
Speed := CurrentSpeed;
if Speed = 0 then
Exit(0);
TimeRem := BytesRemaining / Speed;
if TimeRem < 0 then
Exit(0);
SS := Round(Min(MaxInt, TimeRem)); // seconds
D := SS div SecsPerDay;
SS := SS - D * SecsPerDay;
H := SS div SecsPerHour;
SS := SS - H * SecsPerHour;
M := SS div SecsPerMin;
SS := SS - M * SecsPerMin;
S := SS;
//max 30 days!
if D > 30 then
D := 30;
Result := EncodeDateTime(1, 1, 1 + D, H, M, S, 1);
end;
procedure TSpeedEstimateCounter.Reset;
begin
FreeList(FList, False);
FStartTime := GetTickCount;
end;
end.
|
unit uDBDrawing;
interface
uses
System.Classes,
System.SyncObjs,
Winapi.Windows,
Vcl.Graphics,
Dmitry.Utils.Files,
Dmitry.Graphics.LayeredBitmap,
UnitDBDeclare,
uDBIcons,
uDBEntities,
uConstants,
uRuntime,
uMemory;
type
TDrawAttributesOption = (daoEXIF, daoNonImage, daoSemiTransparent);
TDrawAttributesOptions = set of TDrawAttributesOption;
procedure DrawAttributes(Bitmap: TBitmap; PistureSize: Integer; Info: TMediaItem);
procedure DrawAttributesEx(HCanvas: THandle; DeltaX, DeltaY: Integer; Info: TMediaItem; Options: TDrawAttributesOptions = []);
procedure DrawAttributesExWide(Bitmap: TBitmap; HCanvas: THandle; DeltaX, DeltaY: Integer; Info: TMediaItem; Options: TDrawAttributesOptions = []);
function GetListItemBorderColor(Data: TLVDataObject): TColor;
function RectInRect(const R1, R2: TRect): Boolean;
implementation
uses
uManagerExplorer;
procedure DrawAttributes(Bitmap: TBitmap; PistureSize: Integer; Info: TMediaItem);
var
DeltaX: Integer;
begin
DeltaX := PistureSize - 100;
DrawAttributesExWide(Bitmap, 0, DeltaX, 0, Info);
end;
procedure DrawAttributesEx(HCanvas: THandle; DeltaX, DeltaY: Integer; Info: TMediaItem; Options: TDrawAttributesOptions = []);
begin
DrawAttributesExWide(nil, HCanvas, DeltaX, DeltaY, Info, Options);
end;
procedure DrawAttributesExWide(Bitmap: TBitmap; HCanvas: THandle; DeltaX, DeltaY: Integer; Info: TMediaItem; Options: TDrawAttributesOptions = []);
var
FE, RotationNotInDB: Boolean;
FileName: string;
procedure DoDrawIconEx(HCanvas: HDC; xLeft, yTop: Integer; Index: Integer; Disabled: Boolean = False);
var
Icon: TIconEx;
bf: BLENDFUNCTION;
GrayIco: TLayeredBitmap;
begin
if Bitmap <> nil then
begin
Icon := Icons.IconsEx[Index];
if not Disabled then
Icon.Icon.DoDraw(xLeft, yTop, Bitmap, False)
else
Icon.GrayIcon.DoDraw(xLeft, yTop, Bitmap);
end else
begin
if not Disabled then
DrawIconEx(HCanvas, xLeft, yTop, Icons[Index], 16, 16, 0, 0, DI_NORMAL)
else
begin
Icon := Icons.IconsEx[Index];
GrayIco := Icon.GrayIcon;
bf.BlendOp := AC_SRC_OVER;
bf.BlendFlags := 0;
bf.AlphaFormat := AC_SRC_ALPHA;
bf.SourceConstantAlpha := $FF;
AlphaBlend(HCanvas, xLeft, yTop, GrayIco.Width, GrayIco.Height,
GrayIco.Canvas.Handle, 0, 0, GrayIco.Width, GrayIco.Height, bf);
end;
end;
end;
begin
if (Info.ID = 0) and not (daoNonImage in Options) then
DoDrawIconEx(HCanvas, DeltaX, DeltaY, DB_IC_NEW);
FileName := Info.FileName;
if Info.Exists = 0 then
begin
FE := FileExistsSafe(FileName);
if FE then
Info.Exists := 1
else
Info.Exists := -1;
end;
FE := Info.Exists <> -1;
if FolderView then
if not FE then
begin
FileName := Info.FileName;
FE := FileExistsSafe(FileName);
end;
if (daoEXIF in Options) and Info.HasExifHeader then
begin
if Info.ID = 0 then
DoDrawIconEx(HCanvas, 20 + DeltaX, DeltaY, DB_IC_EXIF)
else
DoDrawIconEx(HCanvas, 0 + DeltaX, DeltaY, DB_IC_EXIF);
end;
if Info.Encrypted then
DoDrawIconEx(HCanvas, 20 + DeltaX, DeltaY, DB_IC_KEY);
case Info.Rating of
-1: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_STAR);
1: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_1);
2: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_2);
3: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_3);
4: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_4);
5: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_5);
-10: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_1, True);
-20: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_2, True);
-30: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_3, True);
-40: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_4, True);
-50: DoDrawIconEx(HCanvas, 80 + DeltaX, DeltaY, DB_IC_RATING_5, True);
end;
RotationNotInDB := (Info.ID = 0) and (Info.Rotation and DB_IMAGE_ROTATE_NO_DB > 0);
case Info.Rotation and DB_IMAGE_ROTATE_MASK of
DB_IMAGE_ROTATE_90:
DoDrawIconEx(HCanvas, 60 + DeltaX, DeltaY, DB_IC_ROTATED_90, RotationNotInDB);
DB_IMAGE_ROTATE_180:
DoDrawIconEx(HCanvas, 60 + DeltaX, DeltaY, DB_IC_ROTATED_180, RotationNotInDB);
DB_IMAGE_ROTATE_270:
DoDrawIconEx(HCanvas, 60 + DeltaX, DeltaY, DB_IC_ROTATED_270, RotationNotInDB);
end;
if Info.Access = db_access_private then
DoDrawIconEx(HCanvas, 40 + DeltaX, DeltaY, DB_IC_PRIVATE);
if Info.Access = - 10 * db_access_private then
DoDrawIconEx(HCanvas, 40 + DeltaX, DeltaY, DB_IC_PRIVATE, True);
if not FE then
begin
if Copy(FileName, 1, 2) = '::' then
DoDrawIconEx(HCanvas, 0 + DeltaX, DeltaY, DB_IC_CD_IMAGE )
else
DoDrawIconEx(HCanvas, 0 + DeltaX, DeltaY, DB_IC_DELETE_INFO);
end;
end;
function GetListItemBorderColor(Data: TLVDataObject): TColor;
begin
if not Data.Include then
Result := $00FFFF
else
Result := clHighlight;
end;
function RectInRect(const R1, R2: TRect): Boolean;
begin
Result := PtInRect(R2, R1.TopLeft) or PtInRect(R2, R1.BottomRight) or PtInRect(R1, R2.TopLeft) or PtInRect(R1, R2.BottomRight);
end;
end.
|
unit uniteTestLecteurFichierBinaire;
interface
uses SysUtils,TestFrameWork, uniteLecteurFichierBinaire;
type
TestLecteurFichierBinaire = class (TTestCase)
published
procedure testGetTypeJpg;
procedure testGetTypeJpeg;
procedure testGetTypeGif;
procedure testGetTypeAutres;
procedure testLireContenuInexistant;
procedure testLireContenu;
end;
implementation
procedure TestLecteurFichierBinaire.testGetTypeJpg;
var
unFichierBinaire : LecteurFichierBinaire;
begin
unFichierBinaire := LecteurFichierBinaire.create('testLecteurFichierBinaire.jpg');
check(unFichierBinaire.getType = 'image/jpeg');
unFichierBinaire.destroy;
end;
procedure TestLecteurFichierBinaire.testGetTypeJpeg;
var
unFichierBinaire : LecteurFichierBinaire;
begin
unFichierBinaire := LecteurFichierBinaire.create('testLecteurFichierBinaire.jpeg');
check(unFichierBinaire.getType = 'image/jpeg');
unFichierBinaire.destroy;
end;
procedure TestLecteurFichierBinaire.testGetTypeGif;
var
unFichierBinaire : LecteurFichierBinaire;
begin
unFichierBinaire := LecteurFichierBinaire.create('testLecteurFichierBinaire.gif');
check(unFichierBinaire.getType = 'image/gif');
unFichierBinaire.destroy;
end;
procedure TestLecteurFichierBinaire.testGetTypeAutres;
var
unFichierBinaire : LecteurFichierBinaire;
begin
unFichierBinaire := LecteurFichierBinaire.create('testLecteurFichierBinaire.PFUDOR');
check(unFichierBinaire.getType = 'application/octet-stream');
unFichierBinaire.destroy;
end;
procedure TestLecteurFichierBinaire.testlireContenuInexistant;
var
unFichierBinaire : LecteurFichierBinaire;
begin
unFichierBinaire := LecteurFichierBinaire.create('inexistant.jpg');
try
unFichierBinaire.lireContenu;
fail('Le fichier n''existe pas');
except on e:Exception do
Check(e.message= 'Erreur Entrée / Sortie');
end;
unFichierBinaire.destroy;
end;
procedure TestLecteurFichierBinaire.testlireContenu;
var
unFichierBinaire : LecteurFichierBinaire;
fichier : TextFile;
begin
unFichierBinaire := LecteurFichierBinaire.create('testLecteurFichierBinaire.txt');
check(unFichierBinaire.lireContenu = '12345678');
unFichierBinaire.destroy;
end;
initialization
TestFrameWork.RegisterTest(TestLecteurFichierBinaire.Suite);
end.
|
{***************************************************************************}
{ }
{ Delphi Package Manager - DPM }
{ }
{ Copyright © 2019 Vincent Parrett and contributors }
{ }
{ vincent@finalbuilder.com }
{ https://www.finalbuilder.com }
{ }
{ }
{***************************************************************************}
{ }
{ Licensed under the Apache License, Version 2.0 (the "License"); }
{ you may not use this file except in compliance with the License. }
{ You may obtain a copy of the License at }
{ }
{ http://www.apache.org/licenses/LICENSE-2.0 }
{ }
{ Unless required by applicable law or agreed to in writing, software }
{ distributed under the License is distributed on an "AS IS" BASIS, }
{ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }
{ See the License for the specific language governing permissions and }
{ limitations under the License. }
{ }
{***************************************************************************}
unit DPM.Core.Constants;
interface
const
cDPMClientVersion = '1.0.0-alpha1';
cLockFileVersion = '0.0.1';
cLockFileExt = '.dpmlock';
cPackageFileExt = '.dpkg';
cPackageSpecExt = '.dspec';
//fixed filename for the package dspec so we can easily extract it
cPackageMetaFile = 'package' + cPackageSpecExt;
cIconFileSVG = 'icon.svg';
cIconFilePNG = 'icon.png';
cDPMConfigFileName = 'dpm.config';
cDefaultDPMFolder = '%APPDATA%\.dpm';
cDefaultConfigFile = cDefaultDPMFolder + '\' + cDPMConfigFileName;
cDefaultPackageCache = cDefaultDPMFolder + '\packages';
cDPMPackageCacheEnviromentVar = 'DPMPACKAGECACHE';
cTargetPlatformAttribute = 'targetPlatform';
cUnset = '--unset--';
cMaxPackageIdLength = 100;
cPackageFileRegex = '^(\w+\.\w+)\-([^\-]+)\-([^\-]+)\-(.*)$';
cPackageIdRegex = '^(\w+\.\w+)$';
//template regexs
//compiler version
cPackageFileRegexCV = '^(\w+\.\w+)\-(%s)\-([^\-]+)\-(.*)$';
//compiler version and platform
cPackageFileRegexCVP = '^(\w+\.\w+)\-(%s)\-(%s)\-(.*)$';
//compiler version and platform and package version
cPackageFileRegexCVPV = '^(\w+\.\w+)\-(%s)\-(%s)\-(%s)$';
//compiler version and package version - don't think this would ever be used?
cPackageFileRegexCVV = '^(\w+\.\w+)\-(%s)\-(%s)\-(%s)$';
//platform
cPackageFileRegexP = '^(\w+\.\w+)\-([^\-]+)\-(%s)\-(.*)$';
//platform and version
cPackageFileRegexPV = '^(\w+\.\w+)\-(%s)\-(%s)\-(.*)$';
//version
cPackageFileRegexV = '^(\w+\.\w+)\-([^\-]+)\-([^\-]+)\-(%s)$';
cGroupNode = 'group-node';
cRootNode = 'root-node';
cUserAgentHeader = 'User-Agent';
cDPMUserAgent = 'DPM ' + cDPMClientVersion;
implementation
end.
|
unit uMultiplierBase;
{$I ..\Include\IntXLib.inc}
interface
uses
uStrings,
uIMultiplier,
uIntX,
uIntXLibTypes;
type
/// <summary>
/// Base class for multipliers.
/// Contains default implementation of multiply operation over <see cref="TIntX" /> instances.
/// </summary>
TMultiplierBase = class abstract(TInterfacedObject, IIMultiplier)
public
/// <summary>
/// Multiplies two big integers.
/// </summary>
/// <param name="int1">First big integer.</param>
/// <param name="int2">Second big integer.</param>
/// <returns>Resulting big integer.</returns>
/// <exception cref="EArgumentNilException"><paramref name="int1" /> or <paramref name="int2" /> is a null reference.</exception>
/// <exception cref="EArgumentException"><paramref name="int1" /> or <paramref name="int2" /> is too big for multiply operation.</exception>
function Multiply(int1: TIntX; int2: TIntX): TIntX; overload; virtual;
/// <summary>
/// Multiplies two big integers represented by their digits.
/// </summary>
/// <param name="digits1">First big integer digits.</param>
/// <param name="length1">First big integer real length.</param>
/// <param name="digits2">Second big integer digits.</param>
/// <param name="length2">Second big integer real length.</param>
/// <param name="digitsRes">Where to put resulting big integer.</param>
/// <returns>Resulting big integer real length.</returns>
function Multiply(digits1: TIntXLibUInt32Array; length1: UInt32;
digits2: TIntXLibUInt32Array; length2: UInt32;
digitsRes: TIntXLibUInt32Array): UInt32; overload; virtual;
/// <summary>
/// Multiplies two big integers using pointers.
/// </summary>
/// <param name="digitsPtr1">First big integer digits.</param>
/// <param name="length1">First big integer length.</param>
/// <param name="digitsPtr2">Second big integer digits.</param>
/// <param name="length2">Second big integer length.</param>
/// <param name="digitsResPtr">Resulting big integer digits.</param>
/// <returns>Resulting big integer length.</returns>
function Multiply(digitsPtr1: PCardinal; length1: UInt32;
digitsPtr2: PCardinal; length2: UInt32; digitsResPtr: PCardinal): UInt32;
overload; virtual; abstract;
end;
implementation
function TMultiplierBase.Multiply(int1: TIntX; int2: TIntX): TIntX;
var
newLength: UInt64;
newInt: TIntX;
begin
if TIntX.CompareRecords(int1, Default (TIntX)) then
raise EArgumentNilException.Create(uStrings.CantBeNull + ' int1');
if TIntX.CompareRecords(int2, Default (TIntX)) then
raise EArgumentNilException.Create(uStrings.CantBeNull + ' int2');
// Special behavior for zero cases
if ((int1._length = 0) or (int2._length = 0)) then
begin
result := TIntX.Create(0);
Exit;
end;
// Get new big integer length and check it
newLength := UInt64(int1._length) + int2._length;
if (newLength shr 32 <> 0) then
raise EArgumentException.Create(uStrings.IntegerTooBig);
// Create resulting big int
newInt := TIntX.Create(UInt32(newLength), int1._negative xor int2._negative);
// Perform actual digits multiplication
newInt._length := Multiply(int1._digits, int1._length, int2._digits,
int2._length, newInt._digits);
// Normalization may be needed
newInt.TryNormalize();
result := newInt;
end;
function TMultiplierBase.Multiply(digits1: TIntXLibUInt32Array; length1: UInt32;
digits2: TIntXLibUInt32Array; length2: UInt32;
digitsRes: TIntXLibUInt32Array): UInt32;
var
digitsPtr1, digitsPtr2, digitsResPtr: PCardinal;
begin
digitsPtr1 := @digits1[0];
digitsPtr2 := @digits2[0];
digitsResPtr := @digitsRes[0];
result := Multiply(digitsPtr1, length1, digitsPtr2, length2, digitsResPtr);
end;
end.
|
//**********************************************************************************************************************
// $Id: udPromptReplace.pas,v 1.6 2006-08-27 19:11:06 dale Exp $
//----------------------------------------------------------------------------------------------------------------------
// DKLang Translation Editor
// Copyright ęDK Software, http://www.dk-soft.org/
//**********************************************************************************************************************
unit udPromptReplace;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,
DKLTranEdFrm, DKLang, StdCtrls, TntStdCtrls;
type
TdPromptReplace = class(TDKLTranEdForm)
bCancel: TTntButton;
bHelp: TTntButton;
bNo: TTntButton;
bReplaceAll: TTntButton;
bYes: TTntButton;
dklcMain: TDKLanguageController;
lMessage: TTntLabel;
mText: TTntMemo;
protected
procedure DoCreate; override;
end;
// Shows the Confirm replace dialog. rSnap is the rectangle of the corresponding item, in screen coordinates
function PromptForReplace(const wsSourceText, wsSearchPattern: WideString; iMatchPos: Integer; const rSnap: TRect): TModalResult;
implementation
{$R *.dfm}
uses ConsVars;
function PromptForReplace(const wsSourceText, wsSearchPattern: WideString; iMatchPos: Integer; const rSnap: TRect): TModalResult;
var iTop: Integer;
begin
with TdPromptReplace.Create(Application) do
try
lMessage.Caption := DKLangConstW('SMsg_PromptReplace', [wsSearchPattern]);
mText.Text := wsSourceText;
mText.SelStart := iMatchPos-1;
mText.SelLength := Length(wsSearchPattern);
// Position the window
iTop := rSnap.Top-Height;
if iTop<=Screen.WorkAreaTop then iTop := rSnap.Bottom;
SetBounds((rSnap.Left+rSnap.Right-Width) div 2, iTop, Width, Height);
// Show
Result := ShowModal;
finally
Free;
end;
end;
//===================================================================================================================
// TdPromptReplace
//===================================================================================================================
procedure TdPromptReplace.DoCreate;
begin
inherited DoCreate;
// Initialize help context ID
HelpContext := IDH_iface_dlg_prompt_replace;
end;
end.
|
//
// Generated by JavaToPas v1.5 20160510 - 150134
////////////////////////////////////////////////////////////////////////////////
unit android.hardware.Camera;
interface
uses
AndroidAPI.JNIBridge,
Androidapi.JNI.JavaTypes,
android.hardware.Camera_CameraInfo,
android.view.SurfaceHolder,
android.graphics.SurfaceTexture,
android.hardware.Camera_ShutterCallback;
type
JCamera_Size = interface; // merged
JCamera_Parameters = interface; // merged
JCamera_ErrorCallback = interface; // merged
JCamera_FaceDetectionListener = interface; // merged
JCamera_OnZoomChangeListener = interface; // merged
JCamera_PictureCallback = interface; // merged
JCamera_AutoFocusMoveCallback = interface; // merged
JCamera_AutoFocusCallback = interface; // merged
JCamera_PreviewCallback = interface; // merged
JCamera = interface;
JCameraClass = interface(JObjectClass)
['{54ACE522-84D9-4041-A913-58A372FF7898}']
function _GetACTION_NEW_PICTURE : JString; cdecl; // A: $19
function _GetACTION_NEW_VIDEO : JString; cdecl; // A: $19
function _GetCAMERA_ERROR_EVICTED : Integer; cdecl; // A: $19
function _GetCAMERA_ERROR_SERVER_DIED : Integer; cdecl; // A: $19
function _GetCAMERA_ERROR_UNKNOWN : Integer; cdecl; // A: $19
function enableShutterSound(enabled : boolean) : boolean; cdecl; // (Z)Z A: $11
function getNumberOfCameras : Integer; cdecl; // ()I A: $109
function getParameters : JCamera_Parameters; cdecl; // ()Landroid/hardware/Camera$Parameters; A: $1
function open : JCamera; cdecl; overload; // ()Landroid/hardware/Camera; A: $9
function open(cameraId : Integer) : JCamera; cdecl; overload; // (I)Landroid/hardware/Camera; A: $9
procedure addCallbackBuffer(callbackBuffer : TJavaArray<Byte>) ; cdecl; // ([B)V A: $11
procedure autoFocus(cb : JCamera_AutoFocusCallback) ; cdecl; // (Landroid/hardware/Camera$AutoFocusCallback;)V A: $11
procedure cancelAutoFocus ; cdecl; // ()V A: $11
procedure getCameraInfo(cameraId : Integer; cameraInfo : JCamera_CameraInfo) ; cdecl;// (ILandroid/hardware/Camera$CameraInfo;)V A: $9
procedure lock ; cdecl; // ()V A: $111
procedure reconnect ; cdecl; // ()V A: $111
procedure release ; cdecl; // ()V A: $11
procedure setAutoFocusMoveCallback(cb : JCamera_AutoFocusMoveCallback) ; cdecl;// (Landroid/hardware/Camera$AutoFocusMoveCallback;)V A: $1
procedure setDisplayOrientation(Integerparam0 : Integer) ; cdecl; // (I)V A: $111
procedure setErrorCallback(cb : JCamera_ErrorCallback) ; cdecl; // (Landroid/hardware/Camera$ErrorCallback;)V A: $11
procedure setFaceDetectionListener(listener : JCamera_FaceDetectionListener) ; cdecl;// (Landroid/hardware/Camera$FaceDetectionListener;)V A: $11
procedure setOneShotPreviewCallback(cb : JCamera_PreviewCallback) ; cdecl; // (Landroid/hardware/Camera$PreviewCallback;)V A: $11
procedure setParameters(params : JCamera_Parameters) ; cdecl; // (Landroid/hardware/Camera$Parameters;)V A: $1
procedure setPreviewCallback(cb : JCamera_PreviewCallback) ; cdecl; // (Landroid/hardware/Camera$PreviewCallback;)V A: $11
procedure setPreviewCallbackWithBuffer(cb : JCamera_PreviewCallback) ; cdecl;// (Landroid/hardware/Camera$PreviewCallback;)V A: $11
procedure setPreviewDisplay(holder : JSurfaceHolder) ; cdecl; // (Landroid/view/SurfaceHolder;)V A: $11
procedure setPreviewTexture(JSurfaceTextureparam0 : JSurfaceTexture) ; cdecl;// (Landroid/graphics/SurfaceTexture;)V A: $111
procedure setZoomChangeListener(listener : JCamera_OnZoomChangeListener) ; cdecl;// (Landroid/hardware/Camera$OnZoomChangeListener;)V A: $11
procedure startFaceDetection ; cdecl; // ()V A: $11
procedure startPreview ; cdecl; // ()V A: $111
procedure startSmoothZoom(Integerparam0 : Integer) ; cdecl; // (I)V A: $111
procedure stopFaceDetection ; cdecl; // ()V A: $11
procedure stopPreview ; cdecl; // ()V A: $11
procedure stopSmoothZoom ; cdecl; // ()V A: $111
procedure takePicture(shutter : JCamera_ShutterCallback; raw : JCamera_PictureCallback; jpeg : JCamera_PictureCallback) ; cdecl; overload;// (Landroid/hardware/Camera$ShutterCallback;Landroid/hardware/Camera$PictureCallback;Landroid/hardware/Camera$PictureCallback;)V A: $11
procedure takePicture(shutter : JCamera_ShutterCallback; raw : JCamera_PictureCallback; postview : JCamera_PictureCallback; jpeg : JCamera_PictureCallback) ; cdecl; overload;// (Landroid/hardware/Camera$ShutterCallback;Landroid/hardware/Camera$PictureCallback;Landroid/hardware/Camera$PictureCallback;Landroid/hardware/Camera$PictureCallback;)V A: $11
procedure unlock ; cdecl; // ()V A: $111
property ACTION_NEW_PICTURE : JString read _GetACTION_NEW_PICTURE; // Ljava/lang/String; A: $19
property ACTION_NEW_VIDEO : JString read _GetACTION_NEW_VIDEO; // Ljava/lang/String; A: $19
property CAMERA_ERROR_EVICTED : Integer read _GetCAMERA_ERROR_EVICTED; // I A: $19
property CAMERA_ERROR_SERVER_DIED : Integer read _GetCAMERA_ERROR_SERVER_DIED;// I A: $19
property CAMERA_ERROR_UNKNOWN : Integer read _GetCAMERA_ERROR_UNKNOWN; // I A: $19
end;
[JavaSignature('android/hardware/Camera$Parameters')]
JCamera = interface(JObject)
['{C663CAC2-3DFA-4016-B36E-C42B5A9C101E}']
function getParameters : JCamera_Parameters; cdecl; // ()Landroid/hardware/Camera$Parameters; A: $1
procedure setAutoFocusMoveCallback(cb : JCamera_AutoFocusMoveCallback) ; cdecl;// (Landroid/hardware/Camera$AutoFocusMoveCallback;)V A: $1
procedure setParameters(params : JCamera_Parameters) ; cdecl; // (Landroid/hardware/Camera$Parameters;)V A: $1
end;
TJCamera = class(TJavaGenericImport<JCameraClass, JCamera>)
end;
// Merged from: c:\users\anonymous\documents\rad studio\java2pas\android-n\android.hardware.Camera_PreviewCallback.pas
JCamera_PreviewCallbackClass = interface(JObjectClass)
['{8985324F-21D6-4304-A41B-D28063408121}']
procedure onPreviewFrame(TJavaArrayByteparam0 : TJavaArray<Byte>; JCameraparam1 : JCamera) ; cdecl;// ([BLandroid/hardware/Camera;)V A: $401
end;
[JavaSignature('android/hardware/Camera_PreviewCallback')]
JCamera_PreviewCallback = interface(JObject)
['{A5A41F4E-5A3F-4718-88DD-D21036A57027}']
procedure onPreviewFrame(TJavaArrayByteparam0 : TJavaArray<Byte>; JCameraparam1 : JCamera) ; cdecl;// ([BLandroid/hardware/Camera;)V A: $401
end;
TJCamera_PreviewCallback = class(TJavaGenericImport<JCamera_PreviewCallbackClass, JCamera_PreviewCallback>)
end;
// Merged from: c:\users\anonymous\documents\rad studio\java2pas\android-n\android.hardware.Camera_AutoFocusCallback.pas
JCamera_AutoFocusCallbackClass = interface(JObjectClass)
['{4FE86AB7-BDA6-44D9-AFDC-1BA99DAF1CC8}']
procedure onAutoFocus(booleanparam0 : boolean; JCameraparam1 : JCamera) ; cdecl;// (ZLandroid/hardware/Camera;)V A: $401
end;
[JavaSignature('android/hardware/Camera_AutoFocusCallback')]
JCamera_AutoFocusCallback = interface(JObject)
['{6452A8A4-F12A-488C-8777-CAEBC345D4C7}']
procedure onAutoFocus(booleanparam0 : boolean; JCameraparam1 : JCamera) ; cdecl;// (ZLandroid/hardware/Camera;)V A: $401
end;
TJCamera_AutoFocusCallback = class(TJavaGenericImport<JCamera_AutoFocusCallbackClass, JCamera_AutoFocusCallback>)
end;
// Merged from: c:\users\anonymous\documents\rad studio\java2pas\android-n\android.hardware.Camera_AutoFocusMoveCallback.pas
JCamera_AutoFocusMoveCallbackClass = interface(JObjectClass)
['{7A8FE438-84D3-49B9-9A57-474D73E957FE}']
procedure onAutoFocusMoving(booleanparam0 : boolean; JCameraparam1 : JCamera) ; cdecl;// (ZLandroid/hardware/Camera;)V A: $401
end;
[JavaSignature('android/hardware/Camera_AutoFocusMoveCallback')]
JCamera_AutoFocusMoveCallback = interface(JObject)
['{B0B147CA-A9D9-4F4C-9464-103974F04844}']
procedure onAutoFocusMoving(booleanparam0 : boolean; JCameraparam1 : JCamera) ; cdecl;// (ZLandroid/hardware/Camera;)V A: $401
end;
TJCamera_AutoFocusMoveCallback = class(TJavaGenericImport<JCamera_AutoFocusMoveCallbackClass, JCamera_AutoFocusMoveCallback>)
end;
// Merged from: c:\users\anonymous\documents\rad studio\java2pas\android-n\android.hardware.Camera_PictureCallback.pas
JCamera_PictureCallbackClass = interface(JObjectClass)
['{85B0A066-DA0D-4A0E-9801-72692D0D0482}']
procedure onPictureTaken(TJavaArrayByteparam0 : TJavaArray<Byte>; JCameraparam1 : JCamera) ; cdecl;// ([BLandroid/hardware/Camera;)V A: $401
end;
[JavaSignature('android/hardware/Camera_PictureCallback')]
JCamera_PictureCallback = interface(JObject)
['{21448669-B747-4B38-8CBD-6FB95C78935F}']
procedure onPictureTaken(TJavaArrayByteparam0 : TJavaArray<Byte>; JCameraparam1 : JCamera) ; cdecl;// ([BLandroid/hardware/Camera;)V A: $401
end;
TJCamera_PictureCallback = class(TJavaGenericImport<JCamera_PictureCallbackClass, JCamera_PictureCallback>)
end;
// Merged from: c:\users\anonymous\documents\rad studio\java2pas\android-n\android.hardware.Camera_OnZoomChangeListener.pas
JCamera_OnZoomChangeListenerClass = interface(JObjectClass)
['{E59B76B9-CADA-42A3-877C-C8CCBE70746A}']
procedure onZoomChange(Integerparam0 : Integer; booleanparam1 : boolean; JCameraparam2 : JCamera) ; cdecl;// (IZLandroid/hardware/Camera;)V A: $401
end;
[JavaSignature('android/hardware/Camera_OnZoomChangeListener')]
JCamera_OnZoomChangeListener = interface(JObject)
['{8354415B-3868-422F-A37E-38F0D64BB116}']
procedure onZoomChange(Integerparam0 : Integer; booleanparam1 : boolean; JCameraparam2 : JCamera) ; cdecl;// (IZLandroid/hardware/Camera;)V A: $401
end;
TJCamera_OnZoomChangeListener = class(TJavaGenericImport<JCamera_OnZoomChangeListenerClass, JCamera_OnZoomChangeListener>)
end;
// Merged from: c:\users\anonymous\documents\rad studio\java2pas\android-n\android.hardware.Camera_FaceDetectionListener.pas
JCamera_FaceDetectionListenerClass = interface(JObjectClass)
['{2AA6B725-5EB5-48D3-AA73-E31E9C97BF55}']
procedure onFaceDetection(TJavaArrayJCamera_Faceparam0 : TJavaArray<JCamera_Face>; JCameraparam1 : JCamera) ; cdecl;// ([Landroid/hardware/Camera$Face;Landroid/hardware/Camera;)V A: $401
end;
[JavaSignature('android/hardware/Camera_FaceDetectionListener')]
JCamera_FaceDetectionListener = interface(JObject)
['{406E8728-ABB5-43A2-96CC-DD248650BAF7}']
procedure onFaceDetection(TJavaArrayJCamera_Faceparam0 : TJavaArray<JCamera_Face>; JCameraparam1 : JCamera) ; cdecl;// ([Landroid/hardware/Camera$Face;Landroid/hardware/Camera;)V A: $401
end;
TJCamera_FaceDetectionListener = class(TJavaGenericImport<JCamera_FaceDetectionListenerClass, JCamera_FaceDetectionListener>)
end;
// Merged from: c:\users\anonymous\documents\rad studio\java2pas\android-n\android.hardware.Camera_ErrorCallback.pas
JCamera_ErrorCallbackClass = interface(JObjectClass)
['{04DC3AD3-FFB6-47A8-8D67-DAEC99DC54C9}']
procedure onError(Integerparam0 : Integer; JCameraparam1 : JCamera) ; cdecl;// (ILandroid/hardware/Camera;)V A: $401
end;
[JavaSignature('android/hardware/Camera_ErrorCallback')]
JCamera_ErrorCallback = interface(JObject)
['{758E0F25-4B85-452A-A6A9-E9036DD4301C}']
procedure onError(Integerparam0 : Integer; JCameraparam1 : JCamera) ; cdecl;// (ILandroid/hardware/Camera;)V A: $401
end;
TJCamera_ErrorCallback = class(TJavaGenericImport<JCamera_ErrorCallbackClass, JCamera_ErrorCallback>)
end;
// Merged from: c:\users\anonymous\documents\rad studio\java2pas\android-n\android.hardware.Camera_Parameters.pas
JCamera_ParametersClass = interface(JObjectClass)
['{F05D2ED0-6189-433F-AF1F-05183FBA64BE}']
function _GetANTIBANDING_50HZ : JString; cdecl; // A: $19
function _GetANTIBANDING_60HZ : JString; cdecl; // A: $19
function _GetANTIBANDING_AUTO : JString; cdecl; // A: $19
function _GetANTIBANDING_OFF : JString; cdecl; // A: $19
function _GetEFFECT_AQUA : JString; cdecl; // A: $19
function _GetEFFECT_BLACKBOARD : JString; cdecl; // A: $19
function _GetEFFECT_MONO : JString; cdecl; // A: $19
function _GetEFFECT_NEGATIVE : JString; cdecl; // A: $19
function _GetEFFECT_NONE : JString; cdecl; // A: $19
function _GetEFFECT_POSTERIZE : JString; cdecl; // A: $19
function _GetEFFECT_SEPIA : JString; cdecl; // A: $19
function _GetEFFECT_SOLARIZE : JString; cdecl; // A: $19
function _GetEFFECT_WHITEBOARD : JString; cdecl; // A: $19
function _GetFLASH_MODE_AUTO : JString; cdecl; // A: $19
function _GetFLASH_MODE_OFF : JString; cdecl; // A: $19
function _GetFLASH_MODE_ON : JString; cdecl; // A: $19
function _GetFLASH_MODE_RED_EYE : JString; cdecl; // A: $19
function _GetFLASH_MODE_TORCH : JString; cdecl; // A: $19
function _GetFOCUS_DISTANCE_FAR_INDEX : Integer; cdecl; // A: $19
function _GetFOCUS_DISTANCE_NEAR_INDEX : Integer; cdecl; // A: $19
function _GetFOCUS_DISTANCE_OPTIMAL_INDEX : Integer; cdecl; // A: $19
function _GetFOCUS_MODE_AUTO : JString; cdecl; // A: $19
function _GetFOCUS_MODE_CONTINUOUS_PICTURE : JString; cdecl; // A: $19
function _GetFOCUS_MODE_CONTINUOUS_VIDEO : JString; cdecl; // A: $19
function _GetFOCUS_MODE_EDOF : JString; cdecl; // A: $19
function _GetFOCUS_MODE_FIXED : JString; cdecl; // A: $19
function _GetFOCUS_MODE_INFINITY : JString; cdecl; // A: $19
function _GetFOCUS_MODE_MACRO : JString; cdecl; // A: $19
function _GetPREVIEW_FPS_MAX_INDEX : Integer; cdecl; // A: $19
function _GetPREVIEW_FPS_MIN_INDEX : Integer; cdecl; // A: $19
function _GetSCENE_MODE_ACTION : JString; cdecl; // A: $19
function _GetSCENE_MODE_AUTO : JString; cdecl; // A: $19
function _GetSCENE_MODE_BARCODE : JString; cdecl; // A: $19
function _GetSCENE_MODE_BEACH : JString; cdecl; // A: $19
function _GetSCENE_MODE_CANDLELIGHT : JString; cdecl; // A: $19
function _GetSCENE_MODE_FIREWORKS : JString; cdecl; // A: $19
function _GetSCENE_MODE_HDR : JString; cdecl; // A: $19
function _GetSCENE_MODE_LANDSCAPE : JString; cdecl; // A: $19
function _GetSCENE_MODE_NIGHT : JString; cdecl; // A: $19
function _GetSCENE_MODE_NIGHT_PORTRAIT : JString; cdecl; // A: $19
function _GetSCENE_MODE_PARTY : JString; cdecl; // A: $19
function _GetSCENE_MODE_PORTRAIT : JString; cdecl; // A: $19
function _GetSCENE_MODE_SNOW : JString; cdecl; // A: $19
function _GetSCENE_MODE_SPORTS : JString; cdecl; // A: $19
function _GetSCENE_MODE_STEADYPHOTO : JString; cdecl; // A: $19
function _GetSCENE_MODE_SUNSET : JString; cdecl; // A: $19
function _GetSCENE_MODE_THEATRE : JString; cdecl; // A: $19
function _GetWHITE_BALANCE_AUTO : JString; cdecl; // A: $19
function _GetWHITE_BALANCE_CLOUDY_DAYLIGHT : JString; cdecl; // A: $19
function _GetWHITE_BALANCE_DAYLIGHT : JString; cdecl; // A: $19
function _GetWHITE_BALANCE_FLUORESCENT : JString; cdecl; // A: $19
function _GetWHITE_BALANCE_INCANDESCENT : JString; cdecl; // A: $19
function _GetWHITE_BALANCE_SHADE : JString; cdecl; // A: $19
function _GetWHITE_BALANCE_TWILIGHT : JString; cdecl; // A: $19
function _GetWHITE_BALANCE_WARM_FLUORESCENT : JString; cdecl; // A: $19
function flatten : JString; cdecl; // ()Ljava/lang/String; A: $1
function get(key : JString) : JString; cdecl; // (Ljava/lang/String;)Ljava/lang/String; A: $1
function getAntibanding : JString; cdecl; // ()Ljava/lang/String; A: $1
function getAutoExposureLock : boolean; cdecl; // ()Z A: $1
function getAutoWhiteBalanceLock : boolean; cdecl; // ()Z A: $1
function getColorEffect : JString; cdecl; // ()Ljava/lang/String; A: $1
function getExposureCompensation : Integer; cdecl; // ()I A: $1
function getExposureCompensationStep : Single; cdecl; // ()F A: $1
function getFlashMode : JString; cdecl; // ()Ljava/lang/String; A: $1
function getFocalLength : Single; cdecl; // ()F A: $1
function getFocusAreas : JList; cdecl; // ()Ljava/util/List; A: $1
function getFocusMode : JString; cdecl; // ()Ljava/lang/String; A: $1
function getHorizontalViewAngle : Single; cdecl; // ()F A: $1
function getInt(key : JString) : Integer; cdecl; // (Ljava/lang/String;)I A: $1
function getJpegQuality : Integer; cdecl; // ()I A: $1
function getJpegThumbnailQuality : Integer; cdecl; // ()I A: $1
function getJpegThumbnailSize : JCamera_Size; cdecl; // ()Landroid/hardware/Camera$Size; A: $1
function getMaxExposureCompensation : Integer; cdecl; // ()I A: $1
function getMaxNumDetectedFaces : Integer; cdecl; // ()I A: $1
function getMaxNumFocusAreas : Integer; cdecl; // ()I A: $1
function getMaxNumMeteringAreas : Integer; cdecl; // ()I A: $1
function getMaxZoom : Integer; cdecl; // ()I A: $1
function getMeteringAreas : JList; cdecl; // ()Ljava/util/List; A: $1
function getMinExposureCompensation : Integer; cdecl; // ()I A: $1
function getPictureFormat : Integer; cdecl; // ()I A: $1
function getPictureSize : JCamera_Size; cdecl; // ()Landroid/hardware/Camera$Size; A: $1
function getPreferredPreviewSizeForVideo : JCamera_Size; cdecl; // ()Landroid/hardware/Camera$Size; A: $1
function getPreviewFormat : Integer; cdecl; // ()I A: $1
function getPreviewFrameRate : Integer; deprecated; cdecl; // ()I A: $1
function getPreviewSize : JCamera_Size; cdecl; // ()Landroid/hardware/Camera$Size; A: $1
function getSceneMode : JString; cdecl; // ()Ljava/lang/String; A: $1
function getSupportedAntibanding : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedColorEffects : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedFlashModes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedFocusModes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedJpegThumbnailSizes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPictureFormats : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPictureSizes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPreviewFormats : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPreviewFpsRange : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPreviewFrameRates : JList; deprecated; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPreviewSizes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedSceneModes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedVideoSizes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedWhiteBalance : JList; cdecl; // ()Ljava/util/List; A: $1
function getVerticalViewAngle : Single; cdecl; // ()F A: $1
function getVideoStabilization : boolean; cdecl; // ()Z A: $1
function getWhiteBalance : JString; cdecl; // ()Ljava/lang/String; A: $1
function getZoom : Integer; cdecl; // ()I A: $1
function getZoomRatios : JList; cdecl; // ()Ljava/util/List; A: $1
function isAutoExposureLockSupported : boolean; cdecl; // ()Z A: $1
function isAutoWhiteBalanceLockSupported : boolean; cdecl; // ()Z A: $1
function isSmoothZoomSupported : boolean; cdecl; // ()Z A: $1
function isVideoSnapshotSupported : boolean; cdecl; // ()Z A: $1
function isVideoStabilizationSupported : boolean; cdecl; // ()Z A: $1
function isZoomSupported : boolean; cdecl; // ()Z A: $1
procedure &set(key : JString; value : Integer) ; cdecl; overload; // (Ljava/lang/String;I)V A: $1
procedure &set(key : JString; value : JString) ; cdecl; overload; // (Ljava/lang/String;Ljava/lang/String;)V A: $1
procedure getFocusDistances(output : TJavaArray<Single>) ; cdecl; // ([F)V A: $1
procedure getPreviewFpsRange(range : TJavaArray<Integer>) ; cdecl; // ([I)V A: $1
procedure remove(key : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure removeGpsData ; cdecl; // ()V A: $1
procedure setAntibanding(antibanding : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setAutoExposureLock(toggle : boolean) ; cdecl; // (Z)V A: $1
procedure setAutoWhiteBalanceLock(toggle : boolean) ; cdecl; // (Z)V A: $1
procedure setColorEffect(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setExposureCompensation(value : Integer) ; cdecl; // (I)V A: $1
procedure setFlashMode(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setFocusAreas(focusAreas : JList) ; cdecl; // (Ljava/util/List;)V A: $1
procedure setFocusMode(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setGpsAltitude(altitude : Double) ; cdecl; // (D)V A: $1
procedure setGpsLatitude(latitude : Double) ; cdecl; // (D)V A: $1
procedure setGpsLongitude(longitude : Double) ; cdecl; // (D)V A: $1
procedure setGpsProcessingMethod(processing_method : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setGpsTimestamp(timestamp : Int64) ; cdecl; // (J)V A: $1
procedure setJpegQuality(quality : Integer) ; cdecl; // (I)V A: $1
procedure setJpegThumbnailQuality(quality : Integer) ; cdecl; // (I)V A: $1
procedure setJpegThumbnailSize(width : Integer; height : Integer) ; cdecl; // (II)V A: $1
procedure setMeteringAreas(meteringAreas : JList) ; cdecl; // (Ljava/util/List;)V A: $1
procedure setPictureFormat(pixel_format : Integer) ; cdecl; // (I)V A: $1
procedure setPictureSize(width : Integer; height : Integer) ; cdecl; // (II)V A: $1
procedure setPreviewFormat(pixel_format : Integer) ; cdecl; // (I)V A: $1
procedure setPreviewFpsRange(min : Integer; max : Integer) ; cdecl; // (II)V A: $1
procedure setPreviewFrameRate(fps : Integer) ; deprecated; cdecl; // (I)V A: $1
procedure setPreviewSize(width : Integer; height : Integer) ; cdecl; // (II)V A: $1
procedure setRecordingHint(hint : boolean) ; cdecl; // (Z)V A: $1
procedure setRotation(rotation : Integer) ; cdecl; // (I)V A: $1
procedure setSceneMode(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setVideoStabilization(toggle : boolean) ; cdecl; // (Z)V A: $1
procedure setWhiteBalance(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setZoom(value : Integer) ; cdecl; // (I)V A: $1
procedure unflatten(flattened : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
property ANTIBANDING_50HZ : JString read _GetANTIBANDING_50HZ; // Ljava/lang/String; A: $19
property ANTIBANDING_60HZ : JString read _GetANTIBANDING_60HZ; // Ljava/lang/String; A: $19
property ANTIBANDING_AUTO : JString read _GetANTIBANDING_AUTO; // Ljava/lang/String; A: $19
property ANTIBANDING_OFF : JString read _GetANTIBANDING_OFF; // Ljava/lang/String; A: $19
property EFFECT_AQUA : JString read _GetEFFECT_AQUA; // Ljava/lang/String; A: $19
property EFFECT_BLACKBOARD : JString read _GetEFFECT_BLACKBOARD; // Ljava/lang/String; A: $19
property EFFECT_MONO : JString read _GetEFFECT_MONO; // Ljava/lang/String; A: $19
property EFFECT_NEGATIVE : JString read _GetEFFECT_NEGATIVE; // Ljava/lang/String; A: $19
property EFFECT_NONE : JString read _GetEFFECT_NONE; // Ljava/lang/String; A: $19
property EFFECT_POSTERIZE : JString read _GetEFFECT_POSTERIZE; // Ljava/lang/String; A: $19
property EFFECT_SEPIA : JString read _GetEFFECT_SEPIA; // Ljava/lang/String; A: $19
property EFFECT_SOLARIZE : JString read _GetEFFECT_SOLARIZE; // Ljava/lang/String; A: $19
property EFFECT_WHITEBOARD : JString read _GetEFFECT_WHITEBOARD; // Ljava/lang/String; A: $19
property FLASH_MODE_AUTO : JString read _GetFLASH_MODE_AUTO; // Ljava/lang/String; A: $19
property FLASH_MODE_OFF : JString read _GetFLASH_MODE_OFF; // Ljava/lang/String; A: $19
property FLASH_MODE_ON : JString read _GetFLASH_MODE_ON; // Ljava/lang/String; A: $19
property FLASH_MODE_RED_EYE : JString read _GetFLASH_MODE_RED_EYE; // Ljava/lang/String; A: $19
property FLASH_MODE_TORCH : JString read _GetFLASH_MODE_TORCH; // Ljava/lang/String; A: $19
property FOCUS_DISTANCE_FAR_INDEX : Integer read _GetFOCUS_DISTANCE_FAR_INDEX;// I A: $19
property FOCUS_DISTANCE_NEAR_INDEX : Integer read _GetFOCUS_DISTANCE_NEAR_INDEX;// I A: $19
property FOCUS_DISTANCE_OPTIMAL_INDEX : Integer read _GetFOCUS_DISTANCE_OPTIMAL_INDEX;// I A: $19
property FOCUS_MODE_AUTO : JString read _GetFOCUS_MODE_AUTO; // Ljava/lang/String; A: $19
property FOCUS_MODE_CONTINUOUS_PICTURE : JString read _GetFOCUS_MODE_CONTINUOUS_PICTURE;// Ljava/lang/String; A: $19
property FOCUS_MODE_CONTINUOUS_VIDEO : JString read _GetFOCUS_MODE_CONTINUOUS_VIDEO;// Ljava/lang/String; A: $19
property FOCUS_MODE_EDOF : JString read _GetFOCUS_MODE_EDOF; // Ljava/lang/String; A: $19
property FOCUS_MODE_FIXED : JString read _GetFOCUS_MODE_FIXED; // Ljava/lang/String; A: $19
property FOCUS_MODE_INFINITY : JString read _GetFOCUS_MODE_INFINITY; // Ljava/lang/String; A: $19
property FOCUS_MODE_MACRO : JString read _GetFOCUS_MODE_MACRO; // Ljava/lang/String; A: $19
property PREVIEW_FPS_MAX_INDEX : Integer read _GetPREVIEW_FPS_MAX_INDEX; // I A: $19
property PREVIEW_FPS_MIN_INDEX : Integer read _GetPREVIEW_FPS_MIN_INDEX; // I A: $19
property SCENE_MODE_ACTION : JString read _GetSCENE_MODE_ACTION; // Ljava/lang/String; A: $19
property SCENE_MODE_AUTO : JString read _GetSCENE_MODE_AUTO; // Ljava/lang/String; A: $19
property SCENE_MODE_BARCODE : JString read _GetSCENE_MODE_BARCODE; // Ljava/lang/String; A: $19
property SCENE_MODE_BEACH : JString read _GetSCENE_MODE_BEACH; // Ljava/lang/String; A: $19
property SCENE_MODE_CANDLELIGHT : JString read _GetSCENE_MODE_CANDLELIGHT; // Ljava/lang/String; A: $19
property SCENE_MODE_FIREWORKS : JString read _GetSCENE_MODE_FIREWORKS; // Ljava/lang/String; A: $19
property SCENE_MODE_HDR : JString read _GetSCENE_MODE_HDR; // Ljava/lang/String; A: $19
property SCENE_MODE_LANDSCAPE : JString read _GetSCENE_MODE_LANDSCAPE; // Ljava/lang/String; A: $19
property SCENE_MODE_NIGHT : JString read _GetSCENE_MODE_NIGHT; // Ljava/lang/String; A: $19
property SCENE_MODE_NIGHT_PORTRAIT : JString read _GetSCENE_MODE_NIGHT_PORTRAIT;// Ljava/lang/String; A: $19
property SCENE_MODE_PARTY : JString read _GetSCENE_MODE_PARTY; // Ljava/lang/String; A: $19
property SCENE_MODE_PORTRAIT : JString read _GetSCENE_MODE_PORTRAIT; // Ljava/lang/String; A: $19
property SCENE_MODE_SNOW : JString read _GetSCENE_MODE_SNOW; // Ljava/lang/String; A: $19
property SCENE_MODE_SPORTS : JString read _GetSCENE_MODE_SPORTS; // Ljava/lang/String; A: $19
property SCENE_MODE_STEADYPHOTO : JString read _GetSCENE_MODE_STEADYPHOTO; // Ljava/lang/String; A: $19
property SCENE_MODE_SUNSET : JString read _GetSCENE_MODE_SUNSET; // Ljava/lang/String; A: $19
property SCENE_MODE_THEATRE : JString read _GetSCENE_MODE_THEATRE; // Ljava/lang/String; A: $19
property WHITE_BALANCE_AUTO : JString read _GetWHITE_BALANCE_AUTO; // Ljava/lang/String; A: $19
property WHITE_BALANCE_CLOUDY_DAYLIGHT : JString read _GetWHITE_BALANCE_CLOUDY_DAYLIGHT;// Ljava/lang/String; A: $19
property WHITE_BALANCE_DAYLIGHT : JString read _GetWHITE_BALANCE_DAYLIGHT; // Ljava/lang/String; A: $19
property WHITE_BALANCE_FLUORESCENT : JString read _GetWHITE_BALANCE_FLUORESCENT;// Ljava/lang/String; A: $19
property WHITE_BALANCE_INCANDESCENT : JString read _GetWHITE_BALANCE_INCANDESCENT;// Ljava/lang/String; A: $19
property WHITE_BALANCE_SHADE : JString read _GetWHITE_BALANCE_SHADE; // Ljava/lang/String; A: $19
property WHITE_BALANCE_TWILIGHT : JString read _GetWHITE_BALANCE_TWILIGHT; // Ljava/lang/String; A: $19
property WHITE_BALANCE_WARM_FLUORESCENT : JString read _GetWHITE_BALANCE_WARM_FLUORESCENT;// Ljava/lang/String; A: $19
end;
[JavaSignature('android/hardware/Camera_Parameters')]
JCamera_Parameters = interface(JObject)
['{8880AABF-F3F7-4508-AAED-0CC50129943D}']
function flatten : JString; cdecl; // ()Ljava/lang/String; A: $1
function get(key : JString) : JString; cdecl; // (Ljava/lang/String;)Ljava/lang/String; A: $1
function getAntibanding : JString; cdecl; // ()Ljava/lang/String; A: $1
function getAutoExposureLock : boolean; cdecl; // ()Z A: $1
function getAutoWhiteBalanceLock : boolean; cdecl; // ()Z A: $1
function getColorEffect : JString; cdecl; // ()Ljava/lang/String; A: $1
function getExposureCompensation : Integer; cdecl; // ()I A: $1
function getExposureCompensationStep : Single; cdecl; // ()F A: $1
function getFlashMode : JString; cdecl; // ()Ljava/lang/String; A: $1
function getFocalLength : Single; cdecl; // ()F A: $1
function getFocusAreas : JList; cdecl; // ()Ljava/util/List; A: $1
function getFocusMode : JString; cdecl; // ()Ljava/lang/String; A: $1
function getHorizontalViewAngle : Single; cdecl; // ()F A: $1
function getInt(key : JString) : Integer; cdecl; // (Ljava/lang/String;)I A: $1
function getJpegQuality : Integer; cdecl; // ()I A: $1
function getJpegThumbnailQuality : Integer; cdecl; // ()I A: $1
function getJpegThumbnailSize : JCamera_Size; cdecl; // ()Landroid/hardware/Camera$Size; A: $1
function getMaxExposureCompensation : Integer; cdecl; // ()I A: $1
function getMaxNumDetectedFaces : Integer; cdecl; // ()I A: $1
function getMaxNumFocusAreas : Integer; cdecl; // ()I A: $1
function getMaxNumMeteringAreas : Integer; cdecl; // ()I A: $1
function getMaxZoom : Integer; cdecl; // ()I A: $1
function getMeteringAreas : JList; cdecl; // ()Ljava/util/List; A: $1
function getMinExposureCompensation : Integer; cdecl; // ()I A: $1
function getPictureFormat : Integer; cdecl; // ()I A: $1
function getPictureSize : JCamera_Size; cdecl; // ()Landroid/hardware/Camera$Size; A: $1
function getPreferredPreviewSizeForVideo : JCamera_Size; cdecl; // ()Landroid/hardware/Camera$Size; A: $1
function getPreviewFormat : Integer; cdecl; // ()I A: $1
function getPreviewFrameRate : Integer; deprecated; cdecl; // ()I A: $1
function getPreviewSize : JCamera_Size; cdecl; // ()Landroid/hardware/Camera$Size; A: $1
function getSceneMode : JString; cdecl; // ()Ljava/lang/String; A: $1
function getSupportedAntibanding : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedColorEffects : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedFlashModes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedFocusModes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedJpegThumbnailSizes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPictureFormats : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPictureSizes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPreviewFormats : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPreviewFpsRange : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPreviewFrameRates : JList; deprecated; cdecl; // ()Ljava/util/List; A: $1
function getSupportedPreviewSizes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedSceneModes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedVideoSizes : JList; cdecl; // ()Ljava/util/List; A: $1
function getSupportedWhiteBalance : JList; cdecl; // ()Ljava/util/List; A: $1
function getVerticalViewAngle : Single; cdecl; // ()F A: $1
function getVideoStabilization : boolean; cdecl; // ()Z A: $1
function getWhiteBalance : JString; cdecl; // ()Ljava/lang/String; A: $1
function getZoom : Integer; cdecl; // ()I A: $1
function getZoomRatios : JList; cdecl; // ()Ljava/util/List; A: $1
function isAutoExposureLockSupported : boolean; cdecl; // ()Z A: $1
function isAutoWhiteBalanceLockSupported : boolean; cdecl; // ()Z A: $1
function isSmoothZoomSupported : boolean; cdecl; // ()Z A: $1
function isVideoSnapshotSupported : boolean; cdecl; // ()Z A: $1
function isVideoStabilizationSupported : boolean; cdecl; // ()Z A: $1
function isZoomSupported : boolean; cdecl; // ()Z A: $1
procedure &set(key : JString; value : Integer) ; cdecl; overload; // (Ljava/lang/String;I)V A: $1
procedure &set(key : JString; value : JString) ; cdecl; overload; // (Ljava/lang/String;Ljava/lang/String;)V A: $1
procedure getFocusDistances(output : TJavaArray<Single>) ; cdecl; // ([F)V A: $1
procedure getPreviewFpsRange(range : TJavaArray<Integer>) ; cdecl; // ([I)V A: $1
procedure remove(key : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure removeGpsData ; cdecl; // ()V A: $1
procedure setAntibanding(antibanding : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setAutoExposureLock(toggle : boolean) ; cdecl; // (Z)V A: $1
procedure setAutoWhiteBalanceLock(toggle : boolean) ; cdecl; // (Z)V A: $1
procedure setColorEffect(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setExposureCompensation(value : Integer) ; cdecl; // (I)V A: $1
procedure setFlashMode(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setFocusAreas(focusAreas : JList) ; cdecl; // (Ljava/util/List;)V A: $1
procedure setFocusMode(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setGpsAltitude(altitude : Double) ; cdecl; // (D)V A: $1
procedure setGpsLatitude(latitude : Double) ; cdecl; // (D)V A: $1
procedure setGpsLongitude(longitude : Double) ; cdecl; // (D)V A: $1
procedure setGpsProcessingMethod(processing_method : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setGpsTimestamp(timestamp : Int64) ; cdecl; // (J)V A: $1
procedure setJpegQuality(quality : Integer) ; cdecl; // (I)V A: $1
procedure setJpegThumbnailQuality(quality : Integer) ; cdecl; // (I)V A: $1
procedure setJpegThumbnailSize(width : Integer; height : Integer) ; cdecl; // (II)V A: $1
procedure setMeteringAreas(meteringAreas : JList) ; cdecl; // (Ljava/util/List;)V A: $1
procedure setPictureFormat(pixel_format : Integer) ; cdecl; // (I)V A: $1
procedure setPictureSize(width : Integer; height : Integer) ; cdecl; // (II)V A: $1
procedure setPreviewFormat(pixel_format : Integer) ; cdecl; // (I)V A: $1
procedure setPreviewFpsRange(min : Integer; max : Integer) ; cdecl; // (II)V A: $1
procedure setPreviewFrameRate(fps : Integer) ; deprecated; cdecl; // (I)V A: $1
procedure setPreviewSize(width : Integer; height : Integer) ; cdecl; // (II)V A: $1
procedure setRecordingHint(hint : boolean) ; cdecl; // (Z)V A: $1
procedure setRotation(rotation : Integer) ; cdecl; // (I)V A: $1
procedure setSceneMode(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setVideoStabilization(toggle : boolean) ; cdecl; // (Z)V A: $1
procedure setWhiteBalance(value : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
procedure setZoom(value : Integer) ; cdecl; // (I)V A: $1
procedure unflatten(flattened : JString) ; cdecl; // (Ljava/lang/String;)V A: $1
end;
TJCamera_Parameters = class(TJavaGenericImport<JCamera_ParametersClass, JCamera_Parameters>)
end;
// Merged from: .\android\android-n\android.hardware.Camera_Size.pas
JCamera_SizeClass = interface(JObjectClass)
['{7B251CEF-0351-4443-96A7-95758D689F8B}']
function _Getheight : Integer; cdecl; // A: $1
function _Getwidth : Integer; cdecl; // A: $1
function equals(obj : JObject) : boolean; cdecl; // (Ljava/lang/Object;)Z A: $1
function hashCode : Integer; cdecl; // ()I A: $1
function init(this$0 : JCamera; w : Integer; h : Integer) : JCamera_Size; cdecl;// (Landroid/hardware/Camera;II)V A: $1
procedure _Setheight(Value : Integer) ; cdecl; // A: $1
procedure _Setwidth(Value : Integer) ; cdecl; // A: $1
property height : Integer read _Getheight write _Setheight; // I A: $1
property width : Integer read _Getwidth write _Setwidth; // I A: $1
end;
[JavaSignature('android/hardware/Camera_Size')]
JCamera_Size = interface(JObject)
['{C99BEE5C-AEE2-46D1-B961-0C9451F4ED79}']
function _Getheight : Integer; cdecl; // A: $1
function _Getwidth : Integer; cdecl; // A: $1
function equals(obj : JObject) : boolean; cdecl; // (Ljava/lang/Object;)Z A: $1
function hashCode : Integer; cdecl; // ()I A: $1
procedure _Setheight(Value : Integer) ; cdecl; // A: $1
procedure _Setwidth(Value : Integer) ; cdecl; // A: $1
property height : Integer read _Getheight write _Setheight; // I A: $1
property width : Integer read _Getwidth write _Setwidth; // I A: $1
end;
TJCamera_Size = class(TJavaGenericImport<JCamera_SizeClass, JCamera_Size>)
end;
const
TJCamera_ParametersANTIBANDING_50HZ = '50hz';
TJCamera_ParametersANTIBANDING_60HZ = '60hz';
TJCamera_ParametersANTIBANDING_AUTO = 'auto';
TJCamera_ParametersANTIBANDING_OFF = 'off';
TJCamera_ParametersEFFECT_AQUA = 'aqua';
TJCamera_ParametersEFFECT_BLACKBOARD = 'blackboard';
TJCamera_ParametersEFFECT_MONO = 'mono';
TJCamera_ParametersEFFECT_NEGATIVE = 'negative';
TJCamera_ParametersEFFECT_NONE = 'none';
TJCamera_ParametersEFFECT_POSTERIZE = 'posterize';
TJCamera_ParametersEFFECT_SEPIA = 'sepia';
TJCamera_ParametersEFFECT_SOLARIZE = 'solarize';
TJCamera_ParametersEFFECT_WHITEBOARD = 'whiteboard';
TJCamera_ParametersFLASH_MODE_AUTO = 'auto';
TJCamera_ParametersFLASH_MODE_OFF = 'off';
TJCamera_ParametersFLASH_MODE_ON = 'on';
TJCamera_ParametersFLASH_MODE_RED_EYE = 'red-eye';
TJCamera_ParametersFLASH_MODE_TORCH = 'torch';
TJCamera_ParametersFOCUS_DISTANCE_FAR_INDEX = 2;
TJCamera_ParametersFOCUS_DISTANCE_NEAR_INDEX = 0;
TJCamera_ParametersFOCUS_DISTANCE_OPTIMAL_INDEX = 1;
TJCamera_ParametersFOCUS_MODE_AUTO = 'auto';
TJCamera_ParametersFOCUS_MODE_CONTINUOUS_PICTURE = 'continuous-picture';
TJCamera_ParametersFOCUS_MODE_CONTINUOUS_VIDEO = 'continuous-video';
TJCamera_ParametersFOCUS_MODE_EDOF = 'edof';
TJCamera_ParametersFOCUS_MODE_FIXED = 'fixed';
TJCamera_ParametersFOCUS_MODE_INFINITY = 'infinity';
TJCamera_ParametersFOCUS_MODE_MACRO = 'macro';
TJCamera_ParametersPREVIEW_FPS_MAX_INDEX = 1;
TJCamera_ParametersPREVIEW_FPS_MIN_INDEX = 0;
TJCamera_ParametersSCENE_MODE_ACTION = 'action';
TJCamera_ParametersSCENE_MODE_AUTO = 'auto';
TJCamera_ParametersSCENE_MODE_BARCODE = 'barcode';
TJCamera_ParametersSCENE_MODE_BEACH = 'beach';
TJCamera_ParametersSCENE_MODE_CANDLELIGHT = 'candlelight';
TJCamera_ParametersSCENE_MODE_FIREWORKS = 'fireworks';
TJCamera_ParametersSCENE_MODE_HDR = 'hdr';
TJCamera_ParametersSCENE_MODE_LANDSCAPE = 'landscape';
TJCamera_ParametersSCENE_MODE_NIGHT = 'night';
TJCamera_ParametersSCENE_MODE_NIGHT_PORTRAIT = 'night-portrait';
TJCamera_ParametersSCENE_MODE_PARTY = 'party';
TJCamera_ParametersSCENE_MODE_PORTRAIT = 'portrait';
TJCamera_ParametersSCENE_MODE_SNOW = 'snow';
TJCamera_ParametersSCENE_MODE_SPORTS = 'sports';
TJCamera_ParametersSCENE_MODE_STEADYPHOTO = 'steadyphoto';
TJCamera_ParametersSCENE_MODE_SUNSET = 'sunset';
TJCamera_ParametersSCENE_MODE_THEATRE = 'theatre';
TJCamera_ParametersWHITE_BALANCE_AUTO = 'auto';
TJCamera_ParametersWHITE_BALANCE_CLOUDY_DAYLIGHT = 'cloudy-daylight';
TJCamera_ParametersWHITE_BALANCE_DAYLIGHT = 'daylight';
TJCamera_ParametersWHITE_BALANCE_FLUORESCENT = 'fluorescent';
TJCamera_ParametersWHITE_BALANCE_INCANDESCENT = 'incandescent';
TJCamera_ParametersWHITE_BALANCE_SHADE = 'shade';
TJCamera_ParametersWHITE_BALANCE_TWILIGHT = 'twilight';
TJCamera_ParametersWHITE_BALANCE_WARM_FLUORESCENT = 'warm-fluorescent';
TJCameraACTION_NEW_PICTURE = 'android.hardware.action.NEW_PICTURE';
TJCameraACTION_NEW_VIDEO = 'android.hardware.action.NEW_VIDEO';
TJCameraCAMERA_ERROR_EVICTED = 2;
TJCameraCAMERA_ERROR_SERVER_DIED = 100;
TJCameraCAMERA_ERROR_UNKNOWN = 1;
implementation
end.
|
unit DPM.IDE.MessageService;
interface
uses
Vcl.Forms,
VSoft.Awaitable,
DPM.IDE.MessageForm,
DPM.IDE.Options;
//TODO : Make the message service own the TStringList that the Logmemo on the form currently owns?
//that way we don't need the form all the time, only when we need to display it.
type
TMessageTask = (mtNone, mtRestore, mtInstall, mtUninstall);
///<Summary>Manages the status windows that shows when installing or restoring packages</Summary>
IDPMIDEMessageService = interface
['{B2305CD4-E2E0-4746-B988-7A0E2EF4DCF6}']
procedure TaskStarted(const cancellationTokenSource : ICancellationTokenSource; const task : TMessageTask);
procedure TaskDone(const success : boolean);
procedure Debug(const data : string);
procedure Error(const data : string);
procedure Information(const data : string; const important : Boolean = False);
procedure Success(const data : string; const important : Boolean = False);
procedure Verbose(const data : string; const important : Boolean = False);
procedure Warning(const data : string; const important : Boolean = False);
procedure NewLine;
procedure Clear;
procedure Shutdown;
function CanHandleMessages : boolean;
end;
TDPMIDEMessageService = class(TInterfacedObject, IDPMIDEMessageService)
private
FOptions : IDPMIDEOptions;
FMessageForm : TDPMMessageForm;
FCancellationTokenSource : ICancellationTokenSource;
FCurrentTask : TMessageTask;
protected
procedure EnsureMessageForm;
procedure HideMessageWindow;
procedure ShowMessageWindow;
procedure Shutdown;
procedure TaskStarted(const cancellationTokenSource : ICancellationTokenSource; const task : TMessageTask);
procedure TaskDone(const success : boolean);
//Logging
procedure Debug(const data : string);
procedure Error(const data : string);
procedure Information(const data : string; const important : Boolean = False);
procedure Success(const data : string; const important : Boolean = False);
procedure Verbose(const data : string; const important : Boolean = False);
procedure Warning(const data : string; const important : Boolean = False);
procedure NewLine;
procedure Clear;
function CanHandleMessages : boolean;
public
constructor Create(const options : IDPMIDEOptions);
destructor Destroy;override;
end;
implementation
uses
System.SysUtils;
{ TDPMMessageService }
procedure TDPMIDEMessageService.Clear;
begin
if FMessageForm <> nil then
FMessageForm.Clear;
end;
constructor TDPMIDEMessageService.Create(const options : IDPMIDEOptions);
begin
FMessageForm := nil;
FOptions := options;
FCurrentTask := TMessageTask.mtNone;
end;
procedure TDPMIDEMessageService.Debug(const data: string);
begin
EnsureMessageForm;
if FMessageForm <> nil then
FMessageForm.Debug(data)
end;
destructor TDPMIDEMessageService.Destroy;
begin
if FMessageForm <> nil then
begin
FOptions.LogWindowWidth := FMessageForm.Width;
FOptions.LogWindowHeight := FMessageForm.Height;
FOptions.SaveToFile();
FMessageForm.Parent := nil;
FMessageForm.Free;
end;
inherited;
end;
procedure TDPMIDEMessageService.EnsureMessageForm;
begin
if FMessageForm = nil then
begin
FMessageForm := TDPMMessageForm.Create(nil, FOptions);
FMessageForm.Parent := Application.MainForm;
end;
FMessageForm.CancellationTokenSource := FCancellationTokenSource;
FMessageForm.CloseDelayInSeconds := FOptions.AutoCloseLogDelaySeconds;
end;
procedure TDPMIDEMessageService.Error(const data: string);
begin
EnsureMessageForm;
if FMessageForm <> nil then
FMessageForm.Error(data)
end;
procedure TDPMIDEMessageService.HideMessageWindow;
begin
if FMessageForm <> nil then
FMessageForm.DelayHide;
end;
procedure TDPMIDEMessageService.Information(const data: string; const important: Boolean);
begin
EnsureMessageForm;
if FMessageForm <> nil then
FMessageForm.Information(data, important);
end;
procedure TDPMIDEMessageService.NewLine;
begin
if FMessageForm <> nil then
FMessageForm.NewLine;
end;
function TDPMIDEMessageService.CanHandleMessages: boolean;
begin
result := (FCurrentTask <> TMessageTask.mtNone) and (FMessageForm <> nil) and FMessageForm.Showing;
end;
procedure TDPMIDEMessageService.ShowMessageWindow;
begin
EnsureMessageForm;
if not FMessageForm.Showing then
begin
FMessageForm.Show;
FMessageForm.BringToFront;
Application.ProcessMessages;//allow repaint
end;
end;
procedure TDPMIDEMessageService.Shutdown;
begin
if FMessageForm <> nil then
begin
FMessageForm.Parent := nil;
FreeAndNil(FMessageForm);
end;
end;
procedure TDPMIDEMessageService.Success(const data: string; const important: Boolean);
begin
EnsureMessageForm;
if FMessageForm <> nil then
FMessageForm.Success(data, important);
end;
procedure TDPMIDEMessageService.TaskDone(const success : boolean);
begin
FCancellationTokenSource := nil;
FCurrentTask := mtNone;
if not success then
begin
if FMessageForm <> nil then
FMessageForm.CancellationTokenSource := nil;
ShowMessageWindow;
end
else if FOptions.AutoCloseLogOnSuccess and success then
begin
if FMessageForm <> nil then
begin
FMessageForm.CancellationTokenSource := nil;
HideMessageWindow;
end;
end;
end;
procedure TDPMIDEMessageService.TaskStarted(const cancellationTokenSource: ICancellationTokenSource; const task : TMessageTask);
begin
if FCurrentTask <> task then
begin
FCancellationTokenSource := cancellationTokenSource;
FCurrentTask := task;
EnsureMessageForm;
FMessageForm.Clear;
end;
case task of
mtNone :
begin
end;
mtRestore:
begin
if FOptions.ShowLogForRestore then
ShowMessageWindow;
end;
mtInstall:
begin
if FOptions.ShowLogForInstall then
ShowMessageWindow;
end;
mtUninstall:
begin
if FOptions.ShowLogForUninstall then
ShowMessageWindow;
end;
end;
end;
procedure TDPMIDEMessageService.Verbose(const data: string; const important: Boolean);
begin
EnsureMessageForm;
if FMessageForm <> nil then
FMessageForm.Verbose(data, important);
end;
procedure TDPMIDEMessageService.Warning(const data: string; const important: Boolean);
begin
EnsureMessageForm;
if FMessageForm <> nil then
FMessageForm.Warning(data, important);
end;
end.
|
unit ThImageItem;
interface
uses
System.Types, System.Classes, System.UITypes, System.SysUtils, System.UIConsts,
FMX.Types, FMX.Objects, FMX.Controls, FMX.Graphics, ThTypes, ThItem;
type
TThImageItem = class(TThItem, IBitmapObject, IItemHighlightObject, IItemSelectionObject)
private
FItemData: TThFileItemData;
FBitmap: TBitmap;
procedure LoadImageFile(AFilename: TFileName);
function GetBitmap: TBitmap;
procedure SetBitmap(const Value: TBitmap);
protected
function CreateHighlighter: IItemHighlighter; override;
function CreateSelection: IItemSelection; override;
procedure Paint; override;
// IItemHighlightObject
procedure PaintItem(ARect: TRectF; AFillColor: TAlphaColor);
function PtInItem(Pt: TPointF): Boolean; override;
// IItemSelectionObject
function GetMinimumSize: TSizeF; virtual;
procedure DoBitmapChanged(Sender: TObject); virtual;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function IsContain(AItem: TThItem): Boolean; override;
procedure SetItemData(AItemData: IThItemData); override;
property Bitmap: TBitmap read FBitmap write SetBitmap;
end;
implementation
uses
FMX.Dialogs, ThConsts, ThItemFactory, ThItemSelection, ThItemHighlighter, DebugUtils;
{ TThImageItem }
constructor TThImageItem.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FRecalcOpacity := False;
FAbsoluteOpacity := 1;
FBitmap := TBitmap.Create(0, 0);
FBitmap.OnChange := DoBitmapChanged;
end;
destructor TThImageItem.Destroy;
begin
FBitmap.Free;
inherited;
end;
procedure TThImageItem.SetItemData(AItemData: IThItemData);
var
FN: TFileName;
begin
inherited;
FItemData := TThFileItemData(AItemData);
FN := '';
if Assigned(FItemData) then
FN := FItemData.Filename;
LoadImageFile(FN);
end;
procedure TThImageItem.DoBitmapChanged(Sender: TObject);
begin
Repaint;
UpdateEffects;
end;
function TThImageItem.CreateHighlighter: IItemHighlighter;
var
Highlighter: TThItemRectBorderHighlighter;
begin
Highlighter := TThItemRectBorderHighlighter.Create(Self);
Highlighter.HighlightColor := ItemHighlightColor;
Highlighter.HighlightSize := ItemHighlightSize;
Result := Highlighter;
end;
function TThImageItem.CreateSelection: IItemSelection;
var
Selection: TThItemSelection;
begin
Selection := TThItemSelection.Create(Self);
Selection.SetResizeSpots([scTopLeft, scTopRight, scBottomLeft, scBottomRight]);
Selection.OnTracking := SpotTracking;
Result := Selection;
end;
function TThImageItem.GetBitmap: TBitmap;
begin
Result := FBitmap;
end;
function TThImageItem.GetMinimumSize: TSizeF;
var
MinSize: Single;
begin
MinSize := ItemMinimumSize / AbsoluteScale.X;
Result := PointF(MinSize, MinSize);
end;
function TThImageItem.IsContain(AItem: TThItem): Boolean;
begin
Result := AbsoluteRect.Contains(TThItem(AItem).AbsoluteRect);
end;
procedure TThImageItem.LoadImageFile(AFilename: TFileName);
var
Dialog: TOpenDialog;
begin
if AFilename = '' then
begin
Dialog := TOpenDialog.Create(nil);
try
Dialog.Filter := TBitmapCodecManager.GetFilterString;
if Dialog.Execute then
AFilename := Dialog.FileName;
finally
Dialog.Free;
end;
end;
FBitmap.LoadFromFile(AFilename);
Width := FBitmap.Width;
Height := FBitmap.Height;
end;
procedure TThImageItem.Paint;
begin
PaintItem(GetItemRect, claNull);
end;
procedure TThImageItem.PaintItem(ARect: TRectF; AFillColor: TAlphaColor);
var
R: TRectF;
B: TBitmap;
begin
if (csDesigning in ComponentState) and not Locked and not FInPaintTo then
begin
R := LocalRect;
InflateRect(R, -0.5, -0.5);
Canvas.DrawDashRect(R, 0, 0, AllCorners, FAbsoluteOpacity, $A0909090);
end;
B := FBitmap;
if B.IsEmpty then
Exit;
R := LocalRect;
Canvas.DrawBitmap(B, RectF(0, 0, B.Width, B.Height), R,
FAbsoluteOpacity, False)
end;
function TThImageItem.PtInItem(Pt: TPointF): Boolean;
begin
Result := PtInRect(GetItemRect, Pt);
end;
procedure TThImageItem.SetBitmap(const Value: TBitmap);
begin
FBitmap.Assign(Value);
end;
initialization
RegisterItem(ItemFactoryIDImageFile, TThImageItem);
end.
|
//
// This unit is part of the GLScene Project, http://glscene.org
//
{: GLMeshCSG<p>
Constructive Solid Geometry in GLScene.
The CSG system uses BSP to optimize what triangles it considers.
Its kept on a mesh basis to simplyfy things, it allways generates new BSP's,
even if the meshes allready had BSP optimization.
Author: Joen Joensen.
Contributed to the GLScene community.
Features: CSG_Union, CSG_Subtraction, CSG_Intersection.
<b>History : </b><font size=-1><ul>
<li>30/03/07 - DaStr - Added $I GLScene.inc
<li>18/07/04 - JAJ - Bug fix, causing triangles to dissapear, once in a while.
<li>29/11/03 - JAJ - Created and Submitted to GLScene.
</ul></font>
}
unit GLMeshCSG;
interface
{$I GLScene.inc}
uses
SysUtils, Classes, GLScene, GLVectorFileObjects, GLVectorGeometry, GLBSP, GLVectorLists;
Type
TCSGOperation = (CSG_Union, CSG_Subtraction, CSG_Intersection);
Procedure CSG_Operation(obj1, obj2 : TMeshObject; Operation : TCSGOperation; Res : TMeshObject; Const MaterialName1, MaterialName2 : String);
implementation
uses Math;
const
cOwnTriangleEpsilon = 1e-5;
function IntersectPointToPointLinePlane(const point1, point2 : TAffineVector; const plane : THmgPlane; intersectPoint : PAffineVector = nil) : Boolean;
var
a, b : Extended;
t : Single;
Direction : TAffineVector;
begin
Result := False;
VectorSubtract(Point2,Point1,Direction);
a:=VectorDotProduct(plane, Direction); // direction projected to plane normal
if a<>0 then begin // direction is parallel to plane
b:=PlaneEvaluatePoint(plane, point1); // distance to plane
t:=-b/a; // parameter of intersection
Result := (t-EPSILON2 > 0) and (t+EPSILON2 < 1);
If Result and (intersectPoint <> nil) then
Begin
intersectPoint^ := VectorCombine(Point1,Direction,1,t);
If VectorEquals(intersectPoint^,point1) or VectorEquals(intersectPoint^,point2) then
Result := False;
End;
end;
end;
Type
TCSGTri = array[0..2] of PAffineVector;
Function MakeCSGTri(Const V1,V2,V3 : PAffineVector) : TCSGTri;
Begin
Result[0] := v1;
Result[1] := v2;
Result[2] := v3;
End;
procedure CSG_Iterate_tri(const vec, nor : TCSGTri; BSP : TBSPMeshObject; Node : TFGBSPNode; ResMesh : TMeshObject; ResFG : TFGVertexNormalTexIndexList; keepinside, keepoutside, inverttriangle : Boolean);
Var
vertex_offset : Integer;
Function Iterate_further(const vec, nor : TCSGTri; Node : TFGBSPNode) : Boolean;
Function MustSplit(d1,d2,d3 : Single) : Integer;
Var
side : Integer;
Function Ok(Int : Single) : Boolean;
Begin
Result := False;
If Int < 0 then
Begin
If Side > 0 then
Begin
Result := True;
Exit;
end else Side := -1;
End else
If Int > 0 then
Begin
If Side < 0 then
Begin
Result := True;
Exit;
end else Side := 1;
End;
End;
Begin
Result := 0; // no split
side := 0;
Ok(D1); // can't go wrong yet...
If Ok(D2) then
Begin
Result := 1; // pure split.
Exit;
End;
If Ok(D3) then
Begin
Result := 1; // pure split.
Exit;
End;
If side = 0 then
Begin
Result := 2; // on plane.
Exit;
End;
End;
Var
d : array[0..2] of Single;
i,i1 : Integer;
b1,b2,b3 : Boolean;
intersect_points : array[0..2] of TAffineVector;
intersect_lines : array[0..2] of Integer;
intersect_count : Integer;
t : array[0..2] of TCSGTri;
p0,p1 : Integer;
NextNode : TFGBSPNode;
plane : THmgPlane;
Begin
// This have no effect, however it removes a warning...
Result := False;
b1 := False;
b2 := False;
b3 := False;
// This have no effect, however it removes a warning...
// normally we use the Node.SplitPlane, however on the last branch this is a NullPlane, so we have to calculate it.
If VectorEquals(Node.SplitPlane,NullHmgVector) then
plane := PlaneMake(BSP.Vertices[Node.VertexIndices[0]],BSP.Vertices[Node.VertexIndices[1]],BSP.Vertices[Node.VertexIndices[2]])
else
plane := Node.SplitPlane;
// check the three points in the triangle against the plane
for i := 0 to 2 do
Begin
d[i] := PlaneEvaluatePoint(plane, Vec[i]^);
if Abs(d[i])<cOwnTriangleEpsilon then
d[i] := 0;
end;
// based on points placement determine action
Case MustSplit(d[0],d[1],d[2]) of
0 : // no split
If (d[0]+d[1]+d[2] >= 0) then
Begin
// check for sub node, and either iterate them or stop if none.
If Node.PositiveSubNodeIndex = 0 then
Result := keepoutside
else
Result := Iterate_further(Vec, nor, TFGBSPNode(BSP.FaceGroups[Node.PositiveSubNodeIndex]));
End else
Begin
// check for sub node, and either iterate them or stop if none.
If Node.NegativeSubNodeIndex = 0 then
Result := keepinside
else
Result := Iterate_further(Vec, nor, TFGBSPNode(BSP.FaceGroups[Node.NegativeSubNodeIndex]));
End;
1 : // must split.
Begin
// determine if 2 or 3 triangles are needed for the split.
intersect_count := 0;
For i := 0 to 2 do
begin
i1 := (i+1) mod 3;
If IntersectPointToPointLinePlane(Vec[i]^,Vec[i1]^,plane,@intersect_points[intersect_count]) then
Begin
intersect_lines[intersect_count] := i;
Inc(intersect_count);
End;
End;
// from here of its not thoroughly commented
// the base concept is isolate the two or three triangles, findout which to keep.
// If all is kept we can simply return true and the original triangle wont be split.
// however if only some are needed, we have to return false and add them ourselves...
Case intersect_count of
1 :
Begin
// simple split, two tri's
i := intersect_lines[0];
i1 := (i+2) mod 3;
// cannot be 0, as then intersect_lines[0] would have other value
if (d[i] > 0) then
If Node.PositiveSubNodeIndex = 0 then
Begin
NextNode := Nil;
b1 := keepoutside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.PositiveSubNodeIndex])
else
If Node.NegativeSubNodeIndex = 0 then
Begin
NextNode := Nil;
b1 := keepinside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.NegativeSubNodeIndex]);
If NextNode <> Nil then
b1 := Iterate_further(MakeCSGTri(Vec[i],@intersect_points[0],Vec[i1]),MakeCSGTri(Nor[i],Nor[i{}],Nor[i1]),NextNode);
i := (intersect_lines[0]+1) mod 3;
i1 := (i+1) mod 3;
// cannot be 0, as then intersect_lines[0] would have other value
if (d[i] > 0) then
If Node.PositiveSubNodeIndex = 0 then
Begin
NextNode := Nil;
b2 := keepoutside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.PositiveSubNodeIndex])
else
If Node.NegativeSubNodeIndex = 0 then
Begin
NextNode := Nil;
b2 := keepinside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.NegativeSubNodeIndex]);
If NextNode <> Nil then
b2 := Iterate_further(MakeCSGTri(Vec[i],Vec[i1],@intersect_points[0]),MakeCSGTri(Nor[i],Nor[i1],Nor[i{}]),NextNode);
Result := b1 and b2;
If not Result then
Begin
If B1 then
Begin
i := intersect_lines[0];
i1 := (i+2) mod 3;
vertex_offset := ResMesh.Vertices.count;
ResMesh.Vertices.Add(Vec[i]^,intersect_points[0],Vec[i1]^);
ResMesh.TexCoords.Add(Vec[i]^,intersect_points[0],Vec[i1]^);
If inverttriangle then
Begin
ResMesh.Normals.Add(VectorScale(Nor[i]^,-1),VectorScale(Nor[i{}]^,-1),VectorScale(Nor[i1]^,-1));
ResFG.VertexIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.NormalIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.TexCoordIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
End else
Begin
ResMesh.Normals.Add(Nor[i]^,Nor[i{}]^,Nor[i1]^);
ResFG.VertexIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.NormalIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.TexCoordIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
End;
End else
If B2 then
Begin
i := (intersect_lines[0]+1) mod 3;
i1 := (i+1) mod 3;
vertex_offset := ResMesh.Vertices.count;
ResMesh.Vertices.Add(Vec[i]^,Vec[i1]^,intersect_points[0]);
ResMesh.TexCoords.Add(Vec[i]^,Vec[i1]^,intersect_points[0]);
If inverttriangle then
Begin
ResMesh.Normals.Add(VectorScale(Nor[i]^,-1),VectorScale(Nor[i{}]^,-1),VectorScale(Nor[i1]^,-1));
ResFG.VertexIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.NormalIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.TexCoordIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
End else
Begin
ResMesh.Normals.Add(Nor[i]^,Nor[i{}]^,Nor[i1]^);
ResFG.VertexIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.NormalIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.TexCoordIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
End;
End;
End;
End;
2 :
Begin
// complex split, three tri's
If intersect_lines[0]+1 = intersect_lines[1] then
Begin
p0 := 0;
p1 := 1;
End else
Begin
p0 := 1;
p1 := 0;
End;
i := intersect_lines[p0];
i1 := (i+2) mod 3;
// cannot be 0 as then there would be no intersection
if (d[i] > 0) then
If Node.PositiveSubNodeIndex = 0 then
Begin
NextNode := Nil;
b1 := keepoutside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.PositiveSubNodeIndex])
else
If Node.NegativeSubNodeIndex = 0 then
Begin
NextNode := Nil;
b1 := keepinside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.NegativeSubNodeIndex]);
If NextNode <> Nil then
b1 := Iterate_further(MakeCSGTri(Vec[i],@intersect_points[p0],Vec[i1]),MakeCSGTri(Nor[i],Nor[i{}],Nor[i1]),NextNode);
i1 := (i+1) mod 3;
// cannot be 0 as then there would be no intersection
if (d[i1] > 0) then
If Node.PositiveSubNodeIndex = 0 then
Begin
NextNode := Nil;
b2 := keepoutside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.PositiveSubNodeIndex])
else
If Node.NegativeSubNodeIndex = 0 then
Begin
NextNode := Nil;
b2 := keepinside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.NegativeSubNodeIndex]);
If NextNode <> Nil then
b2 := Iterate_further(MakeCSGTri(@intersect_points[p0],Vec[i1],@intersect_points[p1]),MakeCSGTri(Nor[i1{}],Nor[i1],Nor[i1{}]),NextNode);
i1 := (i+2) mod 3;
// cannot be 0 as then there would be no intersection
if (d[i1] > 0) then
If Node.PositiveSubNodeIndex = 0 then
Begin
NextNode := Nil;
b3 := keepoutside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.PositiveSubNodeIndex])
else
If Node.NegativeSubNodeIndex = 0 then
Begin
NextNode := Nil;
b3 := keepinside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.NegativeSubNodeIndex]);
If NextNode <> Nil then
b3 := Iterate_further(MakeCSGTri(@intersect_points[p0],@intersect_points[p1],Vec[i1]),MakeCSGTri(Nor[i1{}],Nor[i1{}],Nor[i1]),NextNode);
Result := b1 and b2 and b3;
If not Result then
Begin
If B1 then
Begin
i1 := (i+2) mod 3;
vertex_offset := ResMesh.Vertices.count;
ResMesh.Vertices.Add(Vec[i]^,intersect_points[p0],Vec[i1]^);
ResMesh.TexCoords.Add(Vec[i]^,intersect_points[p0],Vec[i1]^);
If inverttriangle then
Begin
ResMesh.Normals.Add(VectorScale(Nor[i]^,-1),VectorScale(Nor[i{}]^,-1),VectorScale(Nor[i1]^,-1));
ResFG.VertexIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.NormalIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.TexCoordIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
End else
Begin
ResMesh.Normals.Add(Nor[i]^,Nor[i{}]^,Nor[i1]^);
ResFG.VertexIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.NormalIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.TexCoordIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
End;
End;
If B2 then
Begin
i1 := (i+1) mod 3;
vertex_offset := ResMesh.Vertices.count;
ResMesh.Vertices.Add(intersect_points[p0],Vec[i1]^,intersect_points[p1]);
ResMesh.TexCoords.Add(intersect_points[p0],Vec[i1]^,intersect_points[p1]);
If inverttriangle then
Begin
ResMesh.Normals.Add(VectorScale(Nor[i1{}]^,-1),VectorScale(Nor[i1]^,-1),VectorScale(Nor[i1{}]^,-1));
ResFG.VertexIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.NormalIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.TexCoordIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
End else
Begin
ResMesh.Normals.Add(Nor[i1{}]^,Nor[i1]^,Nor[i1{}]^);
ResFG.VertexIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.NormalIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.TexCoordIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
End;
End;
If B3 then
Begin
i1 := (i+2) mod 3;
vertex_offset := ResMesh.Vertices.count;
ResMesh.Vertices.Add(intersect_points[p0],intersect_points[p1],Vec[i1]^);
ResMesh.TexCoords.Add(intersect_points[p0],intersect_points[p1],Vec[i1]^);
If inverttriangle then
Begin
ResMesh.Normals.Add(VectorScale(Nor[i1{}]^,-1),VectorScale(Nor[i1{}]^,-1),VectorScale(Nor[i1]^,-1));
ResFG.VertexIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.NormalIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.TexCoordIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
End else
Begin
ResMesh.Normals.Add(Nor[i1{}]^,Nor[i1{}]^,Nor[i1]^);
ResFG.VertexIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.NormalIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.TexCoordIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
End;
End;
End;
End;
End;
End;
2 : // on plane, no split but special logic
Begin
// find out if they point the same direction.
d[0] := PlaneEvaluatePoint(Plane,VectorAdd(Vec[0]^,Nor[0]^));
// check for sub node, and either iterate them or stop if none.
If d[0] >= 0 then
If Node.PositiveSubNodeIndex = 0 then
Begin
NextNode := Nil;
Result := keepoutside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.PositiveSubNodeIndex])
else
If Node.NegativeSubNodeIndex = 0 then
Begin
NextNode := Nil;
Result := keepinside;
End else
NextNode := TFGBSPNode(BSP.FaceGroups[Node.NegativeSubNodeIndex]);
If NextNode <> Nil then
Result := Iterate_further(Vec,Nor,NextNode);
End;
End;
End;
Begin
// check this triangle.
If Iterate_Further(Vec, nor ,Node) then
Begin
// Keep this triangle, logic based on the (keepinside, keepoutside) booleans.
vertex_offset := ResMesh.Vertices.count;
ResMesh.Vertices.Add(Vec[0]^,Vec[1]^,Vec[2]^);
ResMesh.TexCoords.Add(Vec[0]^,Vec[1]^,Vec[2]^);
If inverttriangle then
Begin
ResMesh.Normals.Add(VectorScale(Nor[0]^,-1),VectorScale(Nor[1]^,-1),VectorScale(Nor[2]^,-1));
ResFG.VertexIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.NormalIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
ResFG.TexCoordIndices.Add(vertex_offset+2,vertex_offset+1,vertex_offset);
End else
Begin
ResMesh.Normals.Add(Nor[0]^, Nor[1]^, Nor[2]^);
ResFG.VertexIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.NormalIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
ResFG.TexCoordIndices.Add(vertex_offset,vertex_offset+1,vertex_offset+2);
End;
End;
End;
Procedure CSG_Operation(obj1, obj2 : TMeshObject; Operation : TCSGOperation; Res : TMeshObject; Const MaterialName1, MaterialName2 : String);
Var
v1, t1, n1 : TAffineVectorList;
v2, t2, n2 : TAffineVectorList;
BSP1, BSP2 : TBSPMeshObject;
FG1, FG2 : TFGBSPNode;
i : Integer;
FGR : TFGVertexNormalTexIndexList;
Begin
// prepare containers, fill the triangle list from the objects
BSP1 := TBSPMeshObject.Create;
BSP2 := TBSPMeshObject.Create;
BSP1.Mode := momFaceGroups;
BSP2.Mode := momFaceGroups;
FG1 := TFGBSPNode.CreateOwned(BSP1.FaceGroups);
FG2 := TFGBSPNode.CreateOwned(BSP2.FaceGroups);
t1 := TAffineVectorList.create;
n1 := TAffineVectorList.create;
v1 := obj1.ExtractTriangles(t1,n1);
v1.TransformAsPoints(obj1.Owner.Owner.Matrix);
BSP1.Mode := momTriangles;
BSP1.Vertices := v1;
BSP1.Normals := n1;
BSP1.TexCoords := t1;
FG1.VertexIndices.AddSerie(0, 1, BSP1.Vertices.Count);
t2 := TAffineVectorList.create;
n2 := TAffineVectorList.create;
v2 := obj2.ExtractTriangles(t2,n2);
v2.TransformAsPoints(obj2.Owner.Owner.Matrix);
BSP2.Mode := momTriangles;
BSP2.Vertices := v2;
BSP2.Normals := n2;
BSP2.TexCoords := t2;
FG2.VertexIndices.AddSerie(0, 1, BSP2.Vertices.Count);
// Build BSPs
FG1.PerformSplit(FG1.FindSplitPlane,1);
FG2.PerformSplit(FG2.FindSplitPlane,1);
// Start creating result.
FGR := TFGVertexNormalTexIndexList.CreateOwned(Res.FaceGroups);
FGR.MaterialName := MaterialName1;
// should be obj1.FaceGroups iteration for perfection and multiple materials!
// First iterate all triangles of object 1, one at a time, down through the BSP tree of Object 2, the last booleans are the key to what actuelly happends.
i := 0;
while i < v1.Count-2 do
Begin
Case Operation of
CSG_Union :
Begin
CSG_Iterate_tri(MakeCSGTri(@v1.List^[i],@v1.List^[i+1],@v1.List^[i+2]),MakeCSGTri(@n1.List^[i],@n1.List^[i+1],@n1.List^[i+2]),BSP2,FG2,Res,FGR,false,true,false);
End;
CSG_Subtraction :
Begin
CSG_Iterate_tri(MakeCSGTri(@v1.List^[i],@v1.List^[i+1],@v1.List^[i+2]),MakeCSGTri(@n1.List^[i],@n1.List^[i+1],@n1.List^[i+2]),BSP2,FG2,Res,FGR,false,true,false);
End;
CSG_Intersection :
Begin
CSG_Iterate_tri(MakeCSGTri(@v1.List^[i],@v1.List^[i+1],@v1.List^[i+2]),MakeCSGTri(@n1.List^[i],@n1.List^[i+1],@n1.List^[i+2]),BSP2,FG2,Res,FGR,true,false,false);
End;
End;
inc(i,3);
End;
// Then iterate all triangles of object 2, one at a time, down through the BSP tree of Object 1, the last booleans are the key to what actuelly happends.
FGR := TFGVertexNormalTexIndexList.CreateOwned(Res.FaceGroups);
FGR.MaterialName := MaterialName2;
i := 0;
while i < v2.Count-2 do
Begin
Case Operation of
CSG_Union :
Begin
CSG_Iterate_tri(MakeCSGTri(@v2.List^[i],@v2.List^[i+1],@v2.List^[i+2]),MakeCSGTri(@n2.List^[i],@n2.List^[i+1],@n2.List^[i+2]),BSP1,FG1,Res,FGR,false,true,false);
End;
CSG_Subtraction :
Begin
CSG_Iterate_tri(MakeCSGTri(@v2.List^[i],@v2.List^[i+1],@v2.List^[i+2]),MakeCSGTri(@n2.List^[i],@n2.List^[i+1],@n2.List^[i+2]),BSP1,FG1,Res,FGR,true,false,true);
End;
CSG_Intersection :
Begin
CSG_Iterate_tri(MakeCSGTri(@v2.List^[i],@v2.List^[i+1],@v2.List^[i+2]),MakeCSGTri(@n2.List^[i],@n2.List^[i+1],@n2.List^[i+2]),BSP1,FG1,Res,FGR,true,false,false);
End;
End;
inc(i,3);
End;
// clean up.
v1.Free;
n1.Free;
t1.Free;
v2.Free;
n2.Free;
t2.Free;
BSP2.Free;
BSP1.Free;
End;
end.
|
unit ufrmDialogProdSupplier;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ufrmMasterDialog, ufraFooterDialog2Button, ExtCtrls,
StdCtrls, Mask, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
cxContainer, cxEdit, Vcl.ComCtrls, dxCore, cxDateUtils, cxStyles,
cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator, Data.DB, cxDBData,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
cxClasses, cxGridCustomView, cxGrid, cxTextEdit, cxMaskEdit, cxDropDownEdit,
cxCalendar, System.Actions, Vcl.ActnList, ufraFooterDialog3Button;
type
TfrmDialogProdSupplier = class(TfrmMasterDialog)
lbl1: TLabel;
edt1: TEdit;
edt2: TEdit;
lbl2: TLabel;
lbl3: TLabel;
lbl4: TLabel;
lbl5: TLabel;
lbl6: TLabel;
lbl7: TLabel;
edt3: TEdit;
edt4: TEdit;
edTimeCreate: TEdit;
edUserCreate: TEdit;
lbl8: TLabel;
lbl9: TLabel;
edtTimeUpdate: TEdit;
edUserUpdate: TEdit;
lbl10: TLabel;
dtTglCreate: TcxDateEdit;
dtTglUpdate: TcxDateEdit;
cxGridViewSupplier: TcxGridDBTableView;
cxGridLevel1: TcxGridLevel;
cxGrid: TcxGrid;
cxGridViewSupplierColumn1: TcxGridDBColumn;
cxGridViewSupplierColumn2: TcxGridDBColumn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure footerDialogMasterbtnSaveClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmDialogProdSupplier: TfrmDialogProdSupplier;
implementation
{$R *.dfm}
procedure TfrmDialogProdSupplier.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDialogProdSupplier.FormDestroy(Sender: TObject);
begin
inherited;
frmDialogProdSupplier := nil;
end;
procedure TfrmDialogProdSupplier.footerDialogMasterbtnSaveClick(
Sender: TObject);
begin
inherited;
Close;
end;
end.
|
unit untCollectionsReflect;
interface
uses
Generics.Collections, REST.JsonReflect;
type
SerializeObjectListAttribute = class(JsonReflectAttribute)
constructor Create;
end;
implementation
uses
Rtti;
type
TListOfObjectInterceptor = class(TJSONInterceptor)
function ObjectsConverter(Data: TObject; Field: string): TListOfObjects; override;
end;
{ TListOfObjectInterceptor }
function TListOfObjectInterceptor.ObjectsConverter(Data: TObject; Field: string): TListOfObjects;
var
ctx: TRttiContext;
list: TList<TObject>;
begin
list := TList<TObject>(ctx.GetType(Data.ClassInfo).GetField(Field).GetValue(Data).AsObject);
Result := TListOfObjects(list.List);
SetLength(Result, list.Count);
end;
{ SerializeObjectListAttribute }
constructor SerializeObjectListAttribute.Create;
begin
inherited Create(ctObjects, rtObjects, TListOfObjectInterceptor);
end;
end.
|
unit uDlgDocument;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uBASE_DialogForm, Menus, cxLookAndFeelPainters, StdCtrls,
cxButtons, ExtCtrls, cxGraphics, cxButtonEdit, cxDropDownEdit,
cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, cxMaskEdit, cxCalendar,
cxControls, cxContainer, cxEdit, cxTextEdit, cxMemo, DB, ADODB;
type
TdlgDocument = class(TBASE_DialogForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
teNum: TcxTextEdit;
deDate: TcxDateEdit;
teDocName: TcxTextEdit;
lcDocType: TcxLookupComboBox;
beLink: TcxButtonEdit;
memComment: TcxMemo;
qryDocType: TADOQuery;
dsDocType: TDataSource;
OD: TOpenDialog;
procedure FormCreate(Sender: TObject);
procedure beLinkPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
private
function GetComment: variant;
function GetDate: variant;
function GetDocName: variant;
function GetDocTypeID: variant;
function GetDocTypeName: variant;
function GetLink: variant;
function GetNum: variant;
procedure SetComment(const Value: variant);
procedure SetDate(const Value: variant);
procedure SetDocName(const Value: variant);
procedure SetDocTypeID(const Value: variant);
procedure SetLink(const Value: variant);
procedure SetNum(const Value: variant);
{ Private declarations }
public
property Num: variant read GetNum write SetNum;
property Date: variant read GetDate write SetDate;
property DocName: variant read GetDocName write SetDocName;
property DocTypeID: variant read GetDocTypeID write SetDocTypeID;
property DocTypeName: variant read GetDocTypeName;
property Link: variant read GetLink write SetLink;
property Comment: variant read GetComment write SetComment;
end;
var
dlgDocument: TdlgDocument;
implementation
uses uMain, ShellAPI, uCommonUtils;
{$R *.dfm}
{ TdlgDocument }
function TdlgDocument.GetComment: variant;
begin
result:=StrToVariant(memComment.Lines.Text);
end;
function TdlgDocument.GetDate: variant;
begin
result:=StrToVariant(deDate.Text);
end;
function TdlgDocument.GetDocName: variant;
begin
result:=StrToVariant(teDocName.Text);
end;
function TdlgDocument.GetDocTypeID: variant;
begin
result:=lcDocType.EditValue;
end;
function TdlgDocument.GetDocTypeName: variant;
begin
result:=lcDocType.Text;
end;
function TdlgDocument.GetLink: variant;
begin
result:=StrToVariant(beLink.Text);
end;
function TdlgDocument.GetNum: variant;
begin
result:=StrToVariant(teNum.Text);
end;
procedure TdlgDocument.SetComment(const Value: variant);
begin
if not VarIsNull(Value) then
memComment.Lines.Text:=Value;
end;
procedure TdlgDocument.SetDate(const Value: variant);
begin
if not VarIsNull(Value) then
deDate.Text:=Value;
end;
procedure TdlgDocument.SetDocName(const Value: variant);
begin
if not VarIsNull(Value) then
teDocName.Text:=Value;
end;
procedure TdlgDocument.SetDocTypeID(const Value: variant);
begin
if not VarIsNull(Value) then
lcDocType.EditValue:=Value;
end;
procedure TdlgDocument.SetLink(const Value: variant);
begin
if not VarIsNull(Value) then
beLink.Text:=Value;
end;
procedure TdlgDocument.SetNum(const Value: variant);
begin
if not VarIsNull(Value) then
teNum.Text:=Value;
end;
procedure TdlgDocument.FormCreate(Sender: TObject);
begin
inherited;
qryDocType.Open;
end;
procedure TdlgDocument.beLinkPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
inherited;
if AButtonIndex = 0 then begin
if not OD.Execute then exit;
beLink.Text:=OD.FileName;
end;
if AButtonIndex = 1 then
ShellExecute(0, 'open', pchar(beLink.Text), nil, nil, SW_SHOWNORMAL);
end;
end.
|
unit TESTCOTACAOITENS.Entidade.Model;
interface
uses
DB,
Classes,
SysUtils,
Generics.Collections,
/// orm
ormbr.types.blob,
ormbr.types.lazy,
ormbr.types.mapping,
ormbr.types.nullable,
ormbr.mapping.classes,
ormbr.mapping.register,
ormbr.mapping.attributes,
TPAGFORNECEDOR.Entidade.Model,
TESTPRODUTO.Entidade.Model,
TESTCOTACAO.Entidade.Model;
type
[Entity]
[Table('TESTCOTACAOITENS', '')]
[PrimaryKey('CODIGO', NotInc, NoSort, False, 'Chave primária')]
TTESTCOTACAOITENS = class
private
{ Private declarations }
FCODIGO: String;
FIDCOTACAO: String;
FIDFORNECEDOR: String;
FIDPRODUTO: String;
FQTDE: Nullable<Double>;
FVALORUNITARIO: Nullable<Double>;
FVALORTOTAL: Nullable<Double>;
FDATA_CADASTRO: TDateTime;
FULTIMA_ATUALIZACAO: TDateTime;
FTESTCOTACAO_0: TTESTCOTACAO ;
FTESTPRODUTO_1: TTESTPRODUTO ;
FTPAGFORNECEDOR_2: TTPAGFORNECEDOR ;
function getCODIGO: String;
function getDATA_CADASTRO: TDateTime;
function getULTIMA_ATUALIZACAO: TDateTime;
public
{ Public declarations }
constructor Create;
destructor Destroy; override;
[Restrictions([NotNull])]
[Column('CODIGO', ftString, 64)]
[Dictionary('CODIGO', 'Mensagem de validação', '', '', '', taLeftJustify)]
property CODIGO: String read getCODIGO write FCODIGO;
[Restrictions([NotNull])]
[Column('IDCOTACAO', ftString, 64)]
[ForeignKey('FK3_TESTCOTACAOITENS', 'IDCOTACAO', 'TESTCOTACAO', 'CODIGO', Cascade, Cascade)]
[Dictionary('IDCOTACAO', 'Mensagem de validação', '', '', '', taLeftJustify)]
property IDCOTACAO: String read FIDCOTACAO write FIDCOTACAO;
[Restrictions([NotNull])]
[Column('IDFORNECEDOR', ftString, 64)]
[ForeignKey('FK1_TESTCOTACAOITENS', 'IDFORNECEDOR', 'TPAGFORNECEDOR', 'CODIGO', Cascade, Cascade)]
[Dictionary('IDFORNECEDOR', 'Mensagem de validação', '', '', '', taLeftJustify)]
property IDFORNECEDOR: String read FIDFORNECEDOR write FIDFORNECEDOR;
[Restrictions([NotNull])]
[Column('IDPRODUTO', ftString, 64)]
[ForeignKey('FK2_TESTCOTACAOITENS', 'IDPRODUTO', 'TESTPRODUTO', 'CODIGO', Cascade, Cascade)]
[Dictionary('IDPRODUTO', 'Mensagem de validação', '', '', '', taLeftJustify)]
property IDPRODUTO: String read FIDPRODUTO write FIDPRODUTO;
[Column('QTDE', ftBCD)]
[Dictionary('QTDE', 'Mensagem de validação', '0', '', '', taRightJustify)]
property QTDE: Nullable<Double> read FQTDE write FQTDE;
[Column('VALORUNITARIO', ftBCD)]
[Dictionary('VALORUNITARIO', 'Mensagem de validação', '0', '', '', taRightJustify)]
property VALORUNITARIO: Nullable<Double> read FVALORUNITARIO write FVALORUNITARIO;
[Column('VALORTOTAL', ftBCD)]
[Dictionary('VALORTOTAL', 'Mensagem de validação', '0', '', '', taRightJustify)]
property VALORTOTAL: Nullable<Double> read FVALORTOTAL write FVALORTOTAL;
[Restrictions([NotNull])]
[Column('DATA_CADASTRO', ftDateTime)]
[Dictionary('DATA_CADASTRO', 'Mensagem de validação', 'Now', '', '!##/##/####;1;_', taCenter)]
property DATA_CADASTRO: TDateTime read getDATA_CADASTRO write FDATA_CADASTRO;
[Restrictions([NotNull])]
[Column('ULTIMA_ATUALIZACAO', ftDateTime)]
[Dictionary('ULTIMA_ATUALIZACAO', 'Mensagem de validação', 'Now', '', '!##/##/####;1;_', taCenter)]
property ULTIMA_ATUALIZACAO: TDateTime read getULTIMA_ATUALIZACAO write FULTIMA_ATUALIZACAO;
[Association(OneToOne,'IDCOTACAO','TESTCOTACAO','CODIGO')]
property TESTCOTACAO: TTESTCOTACAO read FTESTCOTACAO_0 write FTESTCOTACAO_0;
[Association(OneToOne,'IDPRODUTO','TESTPRODUTO','CODIGO')]
property TESTPRODUTO: TTESTPRODUTO read FTESTPRODUTO_1 write FTESTPRODUTO_1;
[Association(OneToOne,'IDFORNECEDOR','TPAGFORNECEDOR','CODIGO')]
property TPAGFORNECEDOR: TTPAGFORNECEDOR read FTPAGFORNECEDOR_2 write FTPAGFORNECEDOR_2;
end;
implementation
constructor TTESTCOTACAOITENS.Create;
begin
FTESTCOTACAO_0 := TTESTCOTACAO.Create;
FTESTPRODUTO_1 := TTESTPRODUTO.Create;
FTPAGFORNECEDOR_2 := TTPAGFORNECEDOR.Create;
end;
destructor TTESTCOTACAOITENS.Destroy;
begin
if Assigned(FTESTCOTACAO_0) then
FTESTCOTACAO_0.Free;
if Assigned(FTESTPRODUTO_1) then
FTESTPRODUTO_1.Free;
if Assigned(FTPAGFORNECEDOR_2) then
FTPAGFORNECEDOR_2.Free;
inherited;
end;
function TTESTCOTACAOITENS.getCODIGO: String;
begin
if FCODIGO = EmptyStr then
FCODIGO := TGUID.NewGuid.ToString;
Result := FCODIGO;
end;
function TTESTCOTACAOITENS.getDATA_CADASTRO: TDateTime;
begin
if FDATA_CADASTRO = StrToDateTime('30/12/1899 00:00') then
FDATA_CADASTRO := Now;
Result := FDATA_CADASTRO;
end;
function TTESTCOTACAOITENS.getULTIMA_ATUALIZACAO: TDateTime;
begin
FULTIMA_ATUALIZACAO := Now;
Result := FULTIMA_ATUALIZACAO;
end;
initialization
TRegisterClass.RegisterEntity(TTESTCOTACAOITENS)
end.
|
unit SysRegistryDAO;
interface
uses SysRegistryCls, Classes, DB, ADODb, SysUtils;
type
TSysRegistryDAO = class
private
FConnection: TADOConnection;
registry: TSysRegistry;
public
constructor create(connection: TADOConnection);
function select(aAttributeName: string; aRows: TList ): Boolean;
function insert(): Boolean;
function update(aID: Integer): Boolean;
function isEmpty(): Boolean;
procedure setRegistry(registry: TSysRegistry);
end;
implementation
uses
Variants;
{ TSysRegistryDAO }
constructor TSysRegistryDAO.create(connection: TADOConnection);
begin
FConnection := connection;
end;
function TSysRegistryDAO.select(aAttributeName: string; aRows: TList ): Boolean;
var
qry: TADOQuery;
mySysRegistry: TSysRegistry;
begin
try
try
Assert(Assigned(aRows));
result := false;
qry := TADOQuery.Create(nil);
qry.Connection := FConnection;
qry.SQL.Add('select * from Sis_Registry');
qry.Open;
qry.First;
while (not qry.Eof) do
begin
if not Variants.VarIsNull(qry.FieldValues['AttributeName']) then
begin
if VarToStr(qry.FieldValues['AttributeName']) = aAttributeName then
begin
mySysRegistry:= TSysRegistry.Create; // to be disposed in the caller function
mySysRegistry.AttributeName:= VarToStr(qry.FieldValues['AttributeName']);
if not Variants.VarIsNull(qry.FieldValues['ID']) then
mySysRegistry.ID:= qry.FieldValues['ID'];
if not Variants.VarIsNull(qry.FieldValues['AttributeValue']) then
mySysRegistry.AttributeValue:= VarToStr(qry.FieldValues['AttributeValue']);
if not Variants.VarIsNull(qry.FieldValues['AttributeType']) then
mySysRegistry.AttributeType:= VarToStr(qry.FieldValues['AttributeType']);
if not Variants.VarIsNull(qry.FieldValues['ConstraintValue']) then
mySysRegistry.ConstraintValue:= VarToStr(qry.FieldValues['ConstraintValue']);
if not Variants.VarIsNull(qry.FieldValues['ContraintType']) then
mySysRegistry.ConstraintType:= (qry.FieldValues['ContraintType']);
aRows.Add(mySysRegistry);
end;
end;
qry.Next;
end;
result:= true;
except
on e: Exception do begin
raise Exception.Create('Failed to select from Sis_Registry');
end;
end
finally
freeAndNil(qry);
end;
end;
function TSysRegistryDAO.insert(): Boolean;
var
qry: TADOQuery;
begin
try
try
result := false;
qry := TADOQuery.Create(nil);
qry.Connection := FConnection;
qry.SQL.Add('insert into Sis_Registry (');
qry.SQL.Add('AttributeName');
qry.SQL.Add(',AttributeValue');
qry.SQL.Add(',AttributeType');
qry.SQL.Add(',ConstraintValue');
qry.SQL.Add(',ContraintType )');
qry.SQL.Add('values (');
qry.SQL.Add(':attname');
qry.SQL.Add(',:attvalue');
qry.SQL.Add(',:atttype');
qry.SQL.Add(',:constrvalue');
qry.SQL.Add(',:constrtype )');
qry.Parameters.ParamByName('attname').Value := registry.AttributeName;
qry.Parameters.ParamByName('attvalue').Value := registry.AttributeValue;
qry.Parameters.ParamByName('atttype').Value := registry.AttributeType;
qry.Parameters.ParamByName('constrvalue').Value := registry.ConstraintValue;
qry.Parameters.ParamByName('constrtype').Value := registry.ConstraintType;
qry.ExecSQL;
result := true;
except
on e: Exception do begin
raise Exception.Create('Failed to insert registry');
end;
end
finally
freeAndNil(qry);
end;
end;
function TSysRegistryDAO.update(aID: Integer): Boolean;
var
qry: TADOQuery;
begin
try
try
result := false;
qry := TADOQuery.Create(nil);
qry.Connection := FConnection;
qry.SQL.Add('update Sis_Registry set ');
qry.SQL.Add('AttributeName=:attname, ');
qry.SQL.Add('AttributeValue=:attvalue,');
qry.SQL.Add('AttributeType=:atttype,');
qry.SQL.Add('ConstraintValue=:constrvalue,');
qry.SQL.Add('ContraintType=:constrtype ');
qry.SQL.Add('where ID=:ID');
qry.Parameters.ParamByName('ID').Value := aID;
qry.Parameters.ParamByName('attname').Value := registry.AttributeName;
qry.Parameters.ParamByName('attvalue').Value := registry.AttributeValue;
qry.Parameters.ParamByName('atttype').Value := registry.AttributeType;
qry.Parameters.ParamByName('constrvalue').Value := registry.ConstraintValue;
qry.Parameters.ParamByName('constrtype').Value := registry.ConstraintType;
qry.ExecSQL;
result := true;
except
on e: Exception do begin
raise Exception.Create('Failed to insert registry');
end;
end
finally
freeAndNil(qry);
end;
end;
function TSysRegistryDAO.isEmpty: Boolean;
var
qry: TADOQuery;
begin
try
try
result := false;
qry := TADOQuery.Create(nil);
qry.Connection := FConnection;
qry.SQL.Add('select * from Sis_Registry');
qry.Open;
result := (qry.recordCount = 0 );
except
on e: Exception do begin
raise Exception.Create('Failed to read registry: '+e.Message);
end;
end
finally
freeAndNil(qry);
end;
end;
procedure TSysRegistryDAO.setRegistry(registry: TSysRegistry);
begin
self.registry := registry;
end;
end.
|
unit L_util;
interface
uses SysUtils, WinTypes, WinProcs, Messages, Classes,
StdCtrls, Gauges, FileCtrl, Forms, _Strings;
CONST
ERRLFD_NOERROR = 0;
ERRLFD_NOTEXISTS = -1;
ERRLFD_NOTLFD = -2;
ERRLFD_BADLFD = -3;
TYPE
LFD_INDEX = record
MAGIC : array[1..4] of char;
NAME : array[1..8] of char;
LEN : LongInt;
end;
LFD_BEGIN = LFD_INDEX;
function FilePosition(Handle: Integer) : Longint;
function FileSizing(Handle: Integer) : Longint; {FileSize already exists !}
function IsLFD(LFDname : TFileName) : Boolean;
function IsResourceInLFD(LFDname, RESName : TFileName; VAR IX, LEN : LongInt) : Boolean;
function LFD_GetDirList(LFDname : TFileName; VAR DirList : TListBox) : Integer;
function LFD_GetDetailedDirList(LFDname : TFileName; VAR DirList : TMemo) : Integer;
function LFD_CreateEmpty(LFDname : TFileName) : Integer;
function LFD_ExtractResource(OutputDir : String ; LFDname : TFileName; ResName : String) : Integer;
function LFD_ExtractFiles(OutputDir : String ; LFDname : TFileName; DirList : TListBox; ProgressBar : TGauge) : Integer;
function LFD_AddFiles(InputDir : String ; LFDname : TFileName; DirList : TFileListBox; ProgressBar : TGauge) : Integer;
function LFD_RemoveFiles(LFDname : TFileName; DirList : TListBox; ProgressBar : TGauge) : Integer;
implementation
function FilePosition(Handle: Integer) : Longint;
begin
FilePosition := FileSeek(Handle, 0, 1);
end;
function FileSizing(Handle: Integer) : Longint;
var tmppos : LongInt;
begin
tmppos := FilePosition(Handle);
FileSizing := FileSeek(Handle, 0, 2);
FileSeek(Handle, tmppos, 0);
end;
function IsLFD(LFDname : TFileName) : Boolean;
var gs : LFD_BEGIN;
gf : Integer;
begin
gf := FileOpen(LFDName, fmOpenRead);
FileRead(gf, gs, SizeOf(gs));
FileClose(gf);
with gs do
if (MAGIC[1] = 'R') and
(MAGIC[2] = 'M') and
(MAGIC[3] = 'A') and
(MAGIC[4] = 'P')
then
IsLFD := TRUE
else
IsLFD := FALSE;
end;
function IsResourceInLFD(LFDname, RESName : TFileName; VAR IX, LEN : LongInt) : Boolean;
var i : LongInt;
MASTERN : LongInt;
cur_idx : LongInt;
gs : LFD_BEGIN;
gx : LFD_INDEX;
gf : Integer;
found : Boolean;
begin
found := FALSE;
gf := FileOpen(LFDName, fmOpenRead);
FileRead(gf, gs, SizeOf(gs));
MASTERN := gs.LEN div 16;
cur_idx := gs.LEN + 16 + 16;
for i := 1 to MASTERN do
begin
FileRead(gf, gx, SizeOf(gx));
if (gx.MAGIC + gx.NAME) = RESName then
begin
IX := cur_idx;
LEN := gx.LEN;
Found := TRUE;
break;
end;
cur_idx := cur_idx + gx.LEN + 16;
end;
FileClose(gf);
IsResourceInLFD := Found;
end;
function LFD_GetDirList(LFDname : TFileName; VAR DirList : TListBox) : Integer;
var i : LongInt;
j,k : Integer;
MASTERN : LongInt;
gs : LFD_BEGIN;
gx : LFD_INDEX;
gf : Integer;
OldCursor : HCursor;
begin
OldCursor := SetCursor(LoadCursor(0, IDC_WAIT));
if FileExists(LFDName)
then
if IsLFD(LFDName)
then
begin
gf := FileOpen(LFDName, fmOpenRead);
FileRead(gf, gs, SizeOf(gs));
MASTERN := gs.LEN div 16;
DirList.Clear;
for i := 1 to MASTERN do
begin
FileRead(gf, gx, SizeOf(gx));
for j := 1 to 8 do if gx.NAME[j] = #0 then for k := j to 8 do gx.NAME[k] := ' ';
DirList.Items.Add(gx.MAGIC+ RTrim(gx.NAME));
end;
FileClose(gf);
LFD_GetDirList := ERRLFD_NOERROR;
end
else
LFD_GetDirList := ERRLFD_NOTLFD
else
LFD_GetDirList := ERRLFD_NOTEXISTS;
SetCursor(OldCursor);
end;
function LFD_GetDetailedDirList(LFDname : TFileName; VAR DirList : TMemo) : Integer;
var i : LongInt;
j,k : Integer;
MASTERN : LongInt;
cur_idx : LongInt;
gs : LFD_BEGIN;
gx : LFD_INDEX;
gf : Integer;
S_NAME,
S_IX,
S_LEN : String;
OldCursor : HCursor;
begin
OldCursor := SetCursor(LoadCursor(0, IDC_WAIT));
if FileExists(LFDName)
then
if IsLFD(LFDName)
then
begin
gf := FileOpen(LFDName, fmOpenRead);
FileRead(gf, gs, SizeOf(gs));
MASTERN := gs.LEN div 16;
cur_idx := gs.LEN + 16 + 16;
DirList.Clear;
DirList.Lines.BeginUpdate;
for i := 1 to MASTERN do
begin
FileRead(gf, gx, SizeOf(gx));
for j := 1 to 8 do if gx.NAME[j] = #0 then for k := j to 8 do gx.NAME[k] := ' ';
{!! BUG !! TMemo.Lines.Add n'accepte PAS une null terminated !!}
Str(cur_idx :8, S_IX);
Str(gx.LEN :8, S_LEN);
S_NAME := Copy(gx.MAGIC + RTrim(gx.NAME) + ' ',1,12);
DirList.Lines.Add(S_NAME + ' ' + S_IX + ' ' + S_LEN);
cur_idx := cur_idx + gx.LEN + 16;
end;
DirList.Lines.EndUpdate;
FileClose(gf);
LFD_GetDetailedDirList := ERRLFD_NOERROR;
end
else
LFD_GetDetailedDirList := ERRLFD_NOTLFD
else
LFD_GetDetailedDirList := ERRLFD_NOTEXISTS;
SetCursor(OldCursor);
end;
function LFD_CreateEmpty(LFDname : TFileName) : Integer;
var gs : LFD_BEGIN;
gf : Integer;
begin
gf := FileCreate(LFDName);
with gs do
begin
MAGIC := 'RMAP';
NAME := 'resource';
LEN := 0;
end;
FileWrite(gf, gs, SizeOf(gs));
FileClose(gf);
LFD_CreateEmpty := 0;
end;
function LFD_ExtractResource(OutputDir : String ; LFDname : TFileName; ResName : String) : Integer;
var i : LongInt;
j,k : Integer;
sav_len : LongInt;
cur_idx : LongInt;
MASTERN : LongInt;
gs : LFD_BEGIN;
gx : LFD_INDEX;
gf : Integer;
fsf : Integer;
fs_NAME : String;
S_NAME : String;
position : LongInt;
OldCursor : HCursor;
Buffer : array[0..4095] of Char;
begin
OldCursor := SetCursor(LoadCursor(0, IDC_WAIT));
gf := FileOpen(LFDName, fmOpenRead);
FileRead(gf, gs, SizeOf(gs));
MASTERN := gs.LEN div 16;
cur_idx := gs.LEN + 16 + 16;
for i := 1 to MASTERN do
begin
FileRead(gf, gx, SizeOf(gx));
sav_len := gx.LEN;
for j := 1 to 8 do if gx.NAME[j] = #0 then for k := j to 8 do gx.NAME[k] := ' ';
S_NAME := gx.MAGIC + RTrim(gx.NAME);
if S_NAME = ResName then
begin
position := FilePosition(gf);
fs_NAME := OutputDir;
if Length(OutputDir) <> 3 then fs_NAME := fs_NAME + '\';
fs_NAME := fs_NAME + RTrim(gx.NAME);
if gx.MAGIC = 'PLTT' then fs_NAME := fs_NAME + '.PLT';
if gx.MAGIC = 'FONT' then fs_NAME := fs_NAME + '.FON';
if gx.MAGIC = 'ANIM' then fs_NAME := fs_NAME + '.ANM';
if gx.MAGIC = 'DELT' then fs_NAME := fs_NAME + '.DLT';
if gx.MAGIC = 'VOIC' then fs_NAME := fs_NAME + '.VOC';
if gx.MAGIC = 'GMID' then fs_NAME := fs_NAME + '.GMD';
if gx.MAGIC = 'TEXT' then fs_NAME := fs_NAME + '.TXT';
if gx.MAGIC = 'FILM' then fs_NAME := fs_NAME + '.FLM';
if gx.MAGIC[4] = '?' then fs_NAME := fs_NAME + '.' + Copy(gx.MAGIC,1,3);
if TRUE then
begin
fsf := FileCreate(fs_NAME);
FileSeek(gf, cur_idx, 0);
while gx.LEN >= SizeOf(Buffer) do
begin
FileRead(gf, Buffer, SizeOf(Buffer));
FileWrite(fsf, Buffer, SizeOf(Buffer));
gx.LEN := gx.LEN - SizeOf(Buffer);
end;
FileRead(gf, Buffer, gx.LEN);
FileWrite(fsf, Buffer, gx.LEN);
FileClose(fsf);
FileSeek(gf, position, 0);
end;
end;
cur_idx := cur_idx + sav_len + 16;
end;
FileClose(gf);
SetCursor(OldCursor);
LFD_ExtractResource := ERRLFD_NOERROR;
end;
function LFD_ExtractFiles(OutputDir : String;
LFDname : TFileName;
DirList : TListBox;
ProgressBar : TGauge) : Integer;
var i : LongInt;
j,k : Integer;
sav_len : LongInt;
NSel : LongInt;
index : LongInt;
cur_idx : LongInt;
MASTERN : LongInt;
gs : LFD_BEGIN;
gx : LFD_INDEX;
gf : Integer;
fsf : Integer;
fs_NAME : String;
S_NAME : String;
position : LongInt;
tmp,tmp2 : array[0..127] of Char;
go : Boolean;
OldCursor : HCursor;
Buffer : array[0..4095] of Char;
XList : TStrings;
begin
OldCursor := SetCursor(LoadCursor(0, IDC_WAIT));
{ XList stores the selected items in the ListBox
This accelerates the processing a LOT on big LFDS
because the searches are much shorter }
XList := TStringList.Create;
NSel := 0;
for i := 0 to DirList.Items.Count - 1 do
if DirList.Selected[i] then
begin
Inc(NSel);
XList.Add(DirList.Items[i]);
end;
if XList.Count = 0 then
begin
XList.Free;
LFD_ExtractFiles := ERRLFD_NOERROR;
exit;
end;
if(ProgressBar <> NIL) then
begin
ProgressBar.MaxValue := NSel;
ProgressBar.Progress := 0;
end;
gf := FileOpen(LFDName, fmOpenRead);
FileRead(gf, gs, SizeOf(gs));
MASTERN := gs.LEN div 16;
cur_idx := gs.LEN + 16 + 16;
for i := 1 to MASTERN do
begin
FileRead(gf, gx, SizeOf(gx));
sav_len := gx.LEN;
for j := 1 to 8 do if gx.NAME[j] = #0 then for k := j to 8 do gx.NAME[k] := ' ';
S_NAME := gx.MAGIC + RTrim(gx.NAME);
index := XList.IndexOf(S_NAME);
if index <> -1 then
begin
position := FilePosition(gf);
fs_NAME := OutputDir;
if Length(OutputDir) <> 3 then fs_NAME := fs_NAME + '\';
fs_NAME := fs_NAME + RTrim(gx.NAME);
if gx.MAGIC = 'PLTT' then fs_NAME := fs_NAME + '.PLT';
if gx.MAGIC = 'FONT' then fs_NAME := fs_NAME + '.FON';
if gx.MAGIC = 'ANIM' then fs_NAME := fs_NAME + '.ANM';
if gx.MAGIC = 'DELT' then fs_NAME := fs_NAME + '.DLT';
if gx.MAGIC = 'VOIC' then fs_NAME := fs_NAME + '.VOC';
if gx.MAGIC = 'GMID' then fs_NAME := fs_NAME + '.GMD';
if gx.MAGIC = 'TEXT' then fs_NAME := fs_NAME + '.TXT';
if gx.MAGIC = 'FILM' then fs_NAME := fs_NAME + '.FLM';
if gx.MAGIC[4] = '?' then fs_NAME := fs_NAME + '.' + Copy(gx.MAGIC,1,3);
go := TRUE;
{!!!!! Test d'existence !!!!!}
if FileExists(fs_NAME) then
begin
strcopy(tmp, 'Overwrite ');
strcat(tmp, strPcopy(tmp2, fs_NAME));
if Application.MessageBox(tmp, 'LFD File Manager', mb_YesNo or mb_IconQuestion) = IDNo
then go := FALSE;
end;
if go then
begin
fsf := FileCreate(fs_NAME);
FileSeek(gf, cur_idx, 0);
while gx.LEN >= SizeOf(Buffer) do
begin
FileRead(gf, Buffer, SizeOf(Buffer));
FileWrite(fsf, Buffer, SizeOf(Buffer));
gx.LEN := gx.LEN - SizeOf(Buffer);
end;
FileRead(gf, Buffer, gx.LEN);
FileWrite(fsf, Buffer, gx.LEN);
FileClose(fsf);
if(ProgressBar <> NIL) then
ProgressBar.Progress := ProgressBar.Progress + 1;
FileSeek(gf, position, 0);
end;
end;
cur_idx := cur_idx + sav_len + 16;
end;
XList.Free;
FileClose(gf);
if(ProgressBar <> NIL) then
ProgressBar.Progress := 0;
SetCursor(OldCursor);
LFD_ExtractFiles := ERRLFD_NOERROR;
end;
function LFD_AddFiles(InputDir : String;
LFDname : TFileName;
DirList : TFileListBox;
ProgressBar : TGauge) : Integer;
var i : LongInt;
j,k : Integer;
cur_idx : LongInt;
sav_len : LongInt;
tmpstr : String;
NSel : LongInt;
index : LongInt;
MASTERN : LongInt;
gs : LFD_BEGIN;
gx : LFD_INDEX;
gf : Integer;
gbf : Integer;
gdf : Integer;
fsf : Integer;
fs_NAME : String;
S_NAME : String;
T_NAME : String;
LFDBAKName : TFileName; {original LFD }
LFDDATName : TFileName; {dynamic DATA }
position : LongInt;
tmp,tmp2 : array[0..127] of Char;
go : Boolean;
OldCursor : HCursor;
Buffer : array[0..4095] of Char;
Counter : LongInt;
begin
{
The algorithm is different for LFDs, as the index is BEFORE the datas
so use the algorithm in the other way :
1) Create a backup file named xxxxxxxx.~B~
2) in the final file, construct the index part by part, while
creating the data part in a temp file named xxxxxxxx.~D~
DON'T forget the translation XXXXxxxxx <-> xxxxxxxx.XXX !!!
}
OldCursor := SetCursor(LoadCursor(0, IDC_WAIT));
NSel := 0;
for i := 0 to DirList.Items.Count - 1 do
if DirList.Selected[i] then Inc(NSel);
if NSel = 0 then
begin
LFD_AddFiles := ERRLFD_NOERROR;
exit;
end;
FileSetAttr(LFDName, 0);
LFDBAKName := ChangeFileExt(LFDName, '.~B~');
LFDDATName := ChangeFileExt(LFDName, '.~D~');
RenameFile(LFDName, LFDBAKName);
gbf := FileOpen(LFDBAKName, fmOpenRead);
gf := FileCreate(LFDName);
gdf := FileCreate(LFDDATName);
FileRead(gbf, gs, SizeOf(gs));
FileWrite(gf, gs, SizeOf(gs));
MASTERN := gs.LEN div 16;
cur_idx := gs.LEN + 16 + 16;
if(ProgressBar <> NIL) then
begin
ProgressBar.MaxValue := NSel + MASTERN;
ProgressBar.Progress := 0;
end;
Counter := 0;
for i := 1 to MASTERN do
begin
FileRead(gbf, gx, SizeOf(gx));
for j := 1 to 8 do if gx.NAME[j] = #0 then for k := j to 8 do gx.NAME[k] := ' ';
S_NAME := gx.MAGIC + RTrim(gx.NAME);
{test name}
T_NAME := RTrim(gx.NAME);
if gx.MAGIC = 'PLTT' then T_NAME := T_NAME + '.PLT';
if gx.MAGIC = 'FONT' then T_NAME := T_NAME + '.FON';
if gx.MAGIC = 'ANIM' then T_NAME := T_NAME + '.ANM';
if gx.MAGIC = 'DELT' then T_NAME := T_NAME + '.DLT';
if gx.MAGIC = 'VOIC' then T_NAME := T_NAME + '.VOC';
if gx.MAGIC = 'GMID' then T_NAME := T_NAME + '.GMD';
if gx.MAGIC = 'TEXT' then T_NAME := T_NAME + '.TXT';
if gx.MAGIC = 'FILM' then T_NAME := T_NAME + '.FLM';
if gx.MAGIC[4] = '?' then fs_NAME := fs_NAME + '.' + Copy(gx.MAGIC,1,3);
index := DirList.Items.IndexOf(T_NAME);
go := TRUE;
if index <> -1 then
if DirList.Selected[index] then
begin
strcopy(tmp, 'Replace ');
strcat(tmp, strPcopy(tmp2, S_NAME));
if Application.MessageBox(tmp, 'LFD File Manager', mb_YesNo or mb_IconQuestion) = IDYes
then
go := FALSE
else
DirList.Selected[index] := FALSE;
end;
sav_len := gx.LEN;
if go then
begin
position := FilePosition(gbf);
FileWrite(gdf, gx, SizeOf(gx));
FileWrite(gf, gx, SizeOf(gx));
FileSeek(gbf, cur_idx, 0);
while gx.LEN >= SizeOf(Buffer) do
begin
FileRead(gbf, Buffer, SizeOf(Buffer));
FileWrite(gdf, Buffer, SizeOf(Buffer));
gx.LEN := gx.LEN - SizeOf(Buffer);
end;
FileRead(gbf, Buffer, gx.LEN);
FileWrite(gdf, Buffer, gx.LEN);
if(ProgressBar <> NIL) then
ProgressBar.Progress := ProgressBar.Progress + 1;
Inc(Counter);
FileSeek(gbf, position, 0);
end;
cur_idx := cur_idx + sav_len + 16;
end;
FileClose(gbf);
{3}
for i := 0 to DirList.Items.Count - 1 do
if DirList.Selected[i] then
begin
fs_NAME := InputDir;
if Length(InputDir) <> 3 then fs_NAME := fs_NAME + '\';
fs_NAME := fs_NAME + LowerCase(DirList.Items[i]);
fsf := FileOpen(fs_NAME, fmOpenRead);
gx.LEN := FileSizing(fsf);
T_NAME := ExtractFileName(fs_NAME) + ' ';
for j := 1 to 8 do gx.NAME[j] := T_NAME[j];
for j := 1 to 8 do if gx.NAME[j] = '.' then for k := j to 8 do gx.NAME[k] := ' ';
for j := 1 to 8 do if gx.NAME[j] = ' ' then for k := j to 8 do gx.NAME[k] := #0;
T_NAME := UpperCase(ExtractFileExt(fs_NAME));
tmpstr := Copy(Copy(T_NAME,2,3) + '????', 1,4);
gx.MAGIC[1] := tmpstr[1];
gx.MAGIC[2] := tmpstr[2];
gx.MAGIC[3] := tmpstr[3];
gx.MAGIC[4] := tmpstr[4];
if T_NAME = '.PLT' then gx.MAGIC := 'PLTT';
if T_NAME = '.FON' then gx.MAGIC := 'FONT';
if T_NAME = '.ANM' then gx.MAGIC := 'ANIM';
if T_NAME = '.DLT' then gx.MAGIC := 'DELT';
if T_NAME = '.VOC' then gx.MAGIC := 'VOIC';
if T_NAME = '.GMD' then gx.MAGIC := 'GMID';
if T_NAME = '.TXT' then gx.MAGIC := 'TEXT';
if T_NAME = '.FLM' then gx.MAGIC := 'FILM';
FileWrite(gdf, gx, SizeOf(gx));
FileWrite(gf, gx, SizeOf(gx));
while gx.LEN >= SizeOf(Buffer) do
begin
FileRead(fsf, Buffer, SizeOf(Buffer));
FileWrite(gdf, Buffer, SizeOf(Buffer));
gx.LEN := gx.LEN - SizeOf(Buffer);
end;
FileRead(fsf, Buffer, gx.LEN);
FileWrite(gdf, Buffer, gx.LEN);
FileClose(fsf);
if(ProgressBar <> NIL) then
ProgressBar.Progress := ProgressBar.Progress + 1;
Inc(Counter);
end;
FileClose(gdf);
gdf := FileOpen(LFDDATName, fmOpenRead);
gx.LEN := FileSizing(gdf);
while gx.LEN >= SizeOf(Buffer) do
begin
FileRead(gdf, Buffer, SizeOf(Buffer));
FileWrite(gf, Buffer, SizeOf(Buffer));
gx.LEN := gx.LEN - SizeOf(Buffer);
end;
FileRead(gdf, Buffer, gx.LEN);
FileWrite(gf, Buffer, gx.LEN);
FileSeek(gf, 12, 0);
Counter := Counter * 16;
FileWrite(gf, Counter, SizeOf(Counter));
FileClose(gdf);
FileClose(gf);
SysUtils.DeleteFile(LFDDATName);
SysUtils.DeleteFile(LFDBAKName);
if(ProgressBar <> NIL) then
ProgressBar.Progress := 0;
SetCursor(OldCursor);
LFD_AddFiles := ERRLFD_NOERROR;
end;
function LFD_RemoveFiles(LFDname : TFileName; DirList : TListBox; ProgressBar : TGauge) : Integer;
var i : LongInt;
j,k : Integer;
cur_idx : LongInt;
sav_len : LongInt;
MASTERN : LongInt;
gs : LFD_BEGIN;
gx : LFD_INDEX;
gf : Integer;
gbf : Integer;
gdf : Integer;
S_NAME : String;
LFDBAKName : TFileName; {original LFD }
LFDDATName : TFileName; {dynamic LFD DAT }
position : LongInt;
go : Boolean;
OldCursor : HCursor;
Buffer : array[0..4095] of Char;
Counter : LongInt;
XList : TStrings;
begin
OldCursor := SetCursor(LoadCursor(0, IDC_WAIT));
XList := TStringList.Create;
for i := 0 to DirList.Items.Count - 1 do
if DirList.Selected[i] then
XList.Add(DirList.Items[i]);
if XList.Count = 0 then
begin
XList.Free;
LFD_RemoveFiles := ERRLFD_NOERROR;
exit;
end;
FileSetAttr(LFDName, 0);
LFDBAKName := ChangeFileExt(LFDName, '.~B~');
LFDDATName := ChangeFileExt(LFDName, '.~D~');
RenameFile(LFDName, LFDBAKName);
gbf := FileOpen(LFDBAKName, fmOpenRead);
gf := FileCreate(LFDName);
gdf := FileCreate(LFDDATName);
FileRead(gbf, gs, SizeOf(gs));
FileWrite(gf, gs, SizeOf(gs));
MASTERN := gs.LEN div 16;
cur_idx := gs.LEN + 16 + 16;
if(ProgressBar <> NIL) then
begin
ProgressBar.MaxValue := MASTERN;
ProgressBar.Progress := 0;
end;
Counter := 0;
for i := 1 to MASTERN do
begin
FileRead(gbf, gx, SizeOf(gx));
for j := 1 to 8 do if gx.NAME[j] = #0 then for k := j to 8 do gx.NAME[k] := ' ';
S_NAME := gx.MAGIC + RTrim(gx.NAME);
sav_len := gx.LEN;
go := XList.IndexOf(S_NAME) = - 1;
if go then
begin
position := FilePosition(gbf);
FileWrite(gdf, gx, SizeOf(gx));
FileWrite(gf, gx, SizeOf(gx));
FileSeek(gbf, cur_idx, 0);
while gx.LEN >= SizeOf(Buffer) do
begin
FileRead(gbf, Buffer, SizeOf(Buffer));
FileWrite(gdf, Buffer, SizeOf(Buffer));
gx.LEN := gx.LEN - SizeOf(Buffer);
end;
FileRead(gbf, Buffer, gx.LEN);
FileWrite(gdf, Buffer, gx.LEN);
if(ProgressBar <> NIL) then
ProgressBar.Progress := ProgressBar.Progress + 1;
Inc(Counter);
FileSeek(gbf, position, 0);
end;
cur_idx := cur_idx + sav_len + 16;
end;
XList.Free;
FileClose(gbf);
FileClose(gdf);
gdf := FileOpen(LFDDATName, fmOpenRead);
gx.LEN := FileSizing(gdf);
while gx.LEN >= SizeOf(Buffer) do
begin
FileRead(gdf, Buffer, SizeOf(Buffer));
FileWrite(gf, Buffer, SizeOf(Buffer));
gx.LEN := gx.LEN - SizeOf(Buffer);
end;
FileRead(gdf, Buffer, gx.LEN);
FileWrite(gf, Buffer, gx.LEN);
FileClose(gdf);
{Update MASTERX field}
FileSeek(gf, 12, 0);
Counter := Counter * 16;
FileWrite(gf, Counter, SizeOf(Counter));
FileClose(gf);
SysUtils.DeleteFile(LFDDATName);
{This could be a user option}
SysUtils.DeleteFile(LFDBAKName);
if(ProgressBar <> NIL) then
ProgressBar.Progress := 0;
SetCursor(OldCursor);
LFD_RemoveFiles := ERRLFD_NOERROR;
end;
end.
|
unit uPrK_PROT_ZACH_SelFakDep;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
cxDataStorage, cxEdit, DB, cxDBData, cxLookAndFeelPainters, StdCtrls,
cxButtons, ExtCtrls, FIBDatabase, pFIBDatabase, FIBDataSet, pFIBDataSet,
cxGridLevel, cxClasses, cxControls, cxGridCustomView, IBase,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid, uPrK_PROT_ZACH,
ActnList, uPrK_Resources, uConstants;
type
TPrK_PROT_ZACH_SelFakDepForm = class(TForm)
cxGrid1DBTableView1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
DB: TpFIBDatabase;
DSet1: TpFIBDataSet;
ReadTransaction: TpFIBTransaction;
DSource1: TDataSource;
Panel1: TPanel;
cxButton1: TcxButton;
cxButton2: TcxButton;
ActionList1: TActionList;
SelectA: TAction;
CancelA: TAction;
cmnNAME_FAK: TcxGridDBColumn;
procedure CancelAExecute(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure SelectAExecute(Sender: TObject);
procedure cxGrid1DBTableView1DblClick(Sender: TObject);
private
{ Private declarations }
LangInd:Integer;
public
pID_SP_DEPARTMENT_FAK:Int64;
constructor Create(AOwner:TComponent;ADB_HANDLE:TISC_DB_HANDLE);reintroduce;
end;
implementation
uses Math;
{$R *.dfm}
constructor TPrK_PROT_ZACH_SelFakDepForm.Create(AOwner:TComponent;ADB_HANDLE:TISC_DB_HANDLE);
begin
inherited Create(AOwner);
pID_SP_DEPARTMENT_FAK:=-1;
LangInd:=SelectLanguage;
DB.Handle:=ADB_HANDLE;
ReadTransaction.Active:=True;
DSet1.SQLs.SelectSQL.Text:='SELECT * FROM PRK_FND_PRIK_ZACH_FAK_SELECT2('+IntToStr(TFormPrK_PROT_ZACH(AOwner).ID_GOD_NABORA_GLOBAL)+') ORDER BY NPP, NAME_FAK';
DSet1.Open;
cxGrid1DBTableView1.Styles:=TFormPrK_PROT_ZACH(AOwner).cxGridPrKPZDBTableView1.Styles;
Caption:=nMsgEmptyFacul[LangInd];
cmnNAME_FAK.Caption:=ncolNAME_FAK[LangInd];
SelectA.Caption:=nAction_Vibrat[LangInd];
CancelA.Caption:=nActiont_Otmena[LangInd];
end;
procedure TPrK_PROT_ZACH_SelFakDepForm.CancelAExecute(Sender: TObject);
begin
pID_SP_DEPARTMENT_FAK:=-1;
ModalResult:=mrCancel;
end;
procedure TPrK_PROT_ZACH_SelFakDepForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
ReadTransaction.Active:=False;
end;
procedure TPrK_PROT_ZACH_SelFakDepForm.SelectAExecute(Sender: TObject);
begin
if DSet1.IsEmpty then Exit;
pID_SP_DEPARTMENT_FAK:=DSet1['ID_SP_DEPARTMENT_FAK'];
ModalResult:=mrOk;
end;
procedure TPrK_PROT_ZACH_SelFakDepForm.cxGrid1DBTableView1DblClick(
Sender: TObject);
begin
SelectAExecute(Self);
end;
end.
|
{
PROG: shelf2
LANG: PASCAL
}
{$I-,Q-,R-,S-}
{Problema 12: Estante 2 [Neal Wu, 2007]
El Granjero Juan compro recientemente otro estante para la librería
vacuna, pero el estante se está llenando rápidamente, y ahora el único
espacio disponible es el de arriba.
GJ tiene N vacas (1 <= N <= 20) cada una de alguna altura de H_i (1 <=
H_i <= 1,000,000 – estas son vacas muy altas). El estante tiene altura de
B (1 <= B <= S, donde S es la suma de las alturas de todas las vacas).
Para alcanzar la parte alta del estante, uno o más de las vacas se suben
una encima de otra en una pila, de tal manera que su altura total es la
suma de sus alturas individuales. Esta altura total debe ser no menor que
la altura del estante con el propósito que las vacas alcancen la parte
superior del estante.
Como una pila más grande que la necesaria puede ser peligrosa, su tarea
es encontrar el conjunto de vacas que produce una pila de la menor altura
posible tal que la pila pueda alcanzar la parte superior del estante. Su
programa debería producir la altura de 'exceso' mínima entre la pila
óptima de vacas y el estante.
NOMBRE DEL PROBLEMA: shelf2
FORMATO DE ENTRADA:
* Línea 1: Dos enteros separados por espacio N y B
* Líneas 2..N+1: la línea i+1 contiene un solo entero: H_i
ENTRADA EJEMPLO (archivo shelf2.in):
5 16
3
1
3
5
6
FORMATO DE SALIDA:
* Línea 1: un solo entero representando la diferencia (no negativa)
entre al altura total del conjunto optimo de vacas y la altura del
estante.
SALIDA EJEMPLO (archivo shelf2.out):
1
DETALLES DE LA SALIDA:
Aquí usamos las vacas 1, 3, 4, y 5, para una altura total de 3 + 3+ 5 +
6 = 17. No es posible obtener una altura total de 16, por lo tanto, la
respuesta es 1.
}
const
mx = 1100000;
var
fe,fs : text;
n,m,sol : longint;
best : array[0..mx] of longint;
procedure open;
begin
assign(fe,'shelf2.in'); reset(fe);
assign(fs,'shelf2.out'); rewrite(fs);
readln(fe,n,m);
end;
procedure work;
var
i,j,k,t : longint;
begin
k:=0; sol:=maxlongint; k:=0;
for i:=1 to n do
begin
inc(k);
readln(fe,best[k]);
t:=k;
for j:=1 to t-1 do
begin
inc(k);
best[k]:=best[j] + best[t];
if (best[k] >= m) and (best[k] - m < sol) then
sol:=best[k] - m;
end;
end;
end;
procedure closer;
begin
writeln(fs,sol);
close(fs);
end;
begin
open;
work;
closer;
end. |
unit Lnk;
{* Additional unit. Has two procedures to get system folder by its CSIDL and
to create shortcut to the specified file object. Sources are from public place.
Actually, made on base of sample from MSDN.
Adapted to use with KOL.
Last update: 17-May-2007 (with KOL v 2.61)
}
interface
{$I KOLDEF.INC}
uses windows, shlobj, ShellAPI, ActiveX, {OLE2,} KOL;
function GetSystemFolder(Const Folder:integer):string;
{* Returns specified system folder location. Following constant can be passed
as a parameter:
|<pre>
CSIDL_DESKTOP <desktop> (root of namespace)
CSIDL_PROGRAMS Start Menu\Programs
CSIDL_STARTMENU Settings\username\Start Menu
CSIDL_PERSONAL Settings\username\My Documents
CSIDL_FAVORITES
CSIDL_STARTUP
CSIDL_INTERNET
CSIDL_CONTROLS
CSIDL_PRINTERS
CSIDL_RECENT
CSIDL_SENDTO
CSIDL_BITBUCKET
|</pre> see other in documentation on API "CSIDL Values" }
function CreateLinkDesc(const FileName,Arguments,WorkDir,IconFile:String;
IconNumber:integer; LinkName:String;
Description:String
): Boolean;
{* Creates a shortcut with description. }
function CreateLink(const FileName,Arguments,WorkDir,IconFile:String;
IconNumber:integer; LinkName:String
): Boolean;
{* Creates a shortcut to specified file object. An example:
!
! CreateLink( ParamStr( 0 ), '', '', '', 1, GetSystemFolder(CSIDL_DESKTOP)+
! '\MyProg.lnk' );
}
function ResolveLink( const LinkName: KOLString; var FileName, Arguments, WorkDir,
Description: KOLString; var IconSmall, IconLarge: HIcon; need_icons: Boolean;
DialogParentWnd: HWND ): Boolean;
{* Attempts to resolve given link (given by a path to link file). If a link is
resolved, TRUE returned and FileName, Arguments, WorkDir, Description, Icon(s)
fields are containing resolved parameters of the link. Set ParentDialogWnd to
a handle of your window (or 0), if a dialog is allowed to appear if linked
file is absent (moved or renamed). If DialogParentWnd = THandle(-1) and linked
file is not found, FALSE is returned silently, without showing dialog box.
|<br>
Note: if IconSmall and / or IconLarge are returned <> 0, your code is responsible
for releasing it calling DestroyIcon function(s). }
function IsLink2RecycleBin( const LinkName: String ): Boolean;
{* Returns TRUE, if the link is a link to Recycle Bin. }
//shlobj.h
//some CSIDL_XXX like CSIDL_PROGRAM_FILES need version 5.00
//(Shlwapi.dll, Microsoft® Internet Explorer 5)
const
CSIDL_DESKTOP =$0000; // <desktop>
CSIDL_INTERNET =$0001; // Internet Explorer (icon on desktop)
CSIDL_PROGRAMS =$0002; // Start Menu\Programs
CSIDL_CONTROLS =$0003; // My Computer\Control Panel
CSIDL_PRINTERS =$0004; // My Computer\Printers
CSIDL_PERSONAL =$0005; // My Documents
CSIDL_FAVORITES =$0006; // <user name>\Favorites
CSIDL_STARTUP =$0007; // Start Menu\Programs\Startup
CSIDL_RECENT =$0008; // <user name>\Recent
CSIDL_SENDTO =$0009; // <user name>\SendTo
CSIDL_BITBUCKET =$000a; // <desktop>\Recycle Bin
CSIDL_STARTMENU =$000b; // <user name>\Start Menu
CSIDL_MYDOCUMENTS =$000c; // logical "My Documents" desktop icon
CSIDL_MYMUSIC =$000d; // "My Music" folder
CSIDL_MYVIDEO =$000e; // "My Videos" folder
CSIDL_DESKTOPDIRECTORY =$0010; // <user name>\Desktop
CSIDL_DRIVES =$0011; // My Computer
CSIDL_NETWORK =$0012; // Network Neighborhood
CSIDL_NETHOOD =$0013; // <user name>\nethood
CSIDL_FONTS =$0014; // windows\fonts
CSIDL_TEMPLATES =$0015;
CSIDL_COMMON_STARTMENU =$0016; // All Users\Start Menu
CSIDL_COMMON_PROGRAMS =$0017; // All Users\Programs
CSIDL_COMMON_STARTUP =$0018; // All Users\Startup
CSIDL_COMMON_DESKTOPDIRECTORY =$0019; // All Users\Desktop
CSIDL_APPDATA =$001a; // <user name>\Application Data
CSIDL_PRINTHOOD =$001b; // <user name>\PrintHood
CSIDL_LOCAL_APPDATA =$001c; // <user name>\Local Settings\Applicaiton Data (non roaming)
CSIDL_ALTSTARTUP =$001d; // non localized startup
CSIDL_COMMON_ALTSTARTUP =$001e; // non localized common startup
CSIDL_COMMON_FAVORITES =$001f;
CSIDL_INTERNET_CACHE =$0020;
CSIDL_COOKIES =$0021;
CSIDL_HISTORY =$0022;
CSIDL_COMMON_APPDATA =$0023; // All Users\Application Data
CSIDL_WINDOWS =$0024; // GetWindowsDirectory()
CSIDL_SYSTEM =$0025; // GetSystemDirectory()
CSIDL_PROGRAM_FILES =$0026; // C:\Program Files
CSIDL_MYPICTURES =$0027; // C:\Program Files\My Pictures
CSIDL_PROFILE =$0028; // USERPROFILE
CSIDL_SYSTEMX86 =$0029; // x86 system directory on RISC
CSIDL_PROGRAM_FILESX86 =$002a; // x86 C:\Program Files on RISC
CSIDL_PROGRAM_FILES_COMMON =$002b; // C:\Program Files\Common
CSIDL_PROGRAM_FILES_COMMONX86 =$002c; // x86 Program Files\Common on RISC
CSIDL_COMMON_TEMPLATES =$002d; // All Users\Templates
CSIDL_COMMON_DOCUMENTS =$002e; // All Users\Documents
CSIDL_COMMON_ADMINTOOLS =$002f; // All Users\Start Menu\Programs\Administrative Tools
CSIDL_ADMINTOOLS =$0030; // <user name>\Start Menu\Programs\Administrative Tools
CSIDL_CONNECTIONS =$0031; // Network and Dial-up Connections
CSIDL_FLAG_CREATE =$8000; // combine with CSIDL_ value to force folder creation in SHGetFolderPath()
CSIDL_FLAG_DONT_VERIFY =$4000; // combine with CSIDL_ value to return an unverified folder path
CSIDL_FLAG_NO_ALIAS =$1000; // combine with CSIDL_ value to insure non-alias versions of the pidl
CSIDL_FLAG_MASK =$FF00; // mask for all possible flag values
procedure FileTypeReg(FExt,Desc,Cmd,Exe: string; IconIndex: integer; Default,Run: boolean);
{* By Dimaxx. Registers file type association.
|<pre>
FExt - file extension расширение файла
Desc - file type description описание типа файла
Cmd - context menu command команда для контекстного меню
Exe - path to executable путь к исполняемому файлу
Default - if command is default назначается действием по умолчанию
Run - if reaction needed when clicked нужны ли действия при щелчке на файле с таким расширением
|</pre>
Example:
! FileTypeReg('.abc','ABC Data File','Open','d:\abc_edit.exe',True);
}
function FileTypeGetReg(const FExt,Cmd: KOLString; var Desc, OldIcoExe: KOLString;
var OldIcoIdx: Integer; var OldId: KOLString ): KOLString;
{* Get registered file type association, if any (by command).
|<pre>
in:
FExt - file extension расширение файла
Cmd - context menu command команда для контекстного меню
out:
Desc - file type description описание типа файла
Result - path to executable путь к исполняемому файлу
|</pre>
Shell is always notified about file association changes. See also FileTypeRegEx.
}
procedure FileTypeRegEx(FExt,Desc,Cmd,Exe: string; IconIndex: integer; Default,Run: boolean;
const IcoExe: String; NotifyShell: Boolean );
{* The same as FileTypeReg, but additional parameters are available:
IcoExe - file where the icon is stored;
NotifyShell - TRUE if to notify shell about changes. }
procedure FileTypeReg2(FExt,Desc,Cmd,Exe,Id: string;
IconIndex: integer; Default,Run: boolean;
const IcoExe: String; DfltIcoExe: String; NotifyShell: Boolean );
{* The same as above (FileTypeRegEx), but should also work in XP.
Provide ID string in form 'Vendor.Appname.Version', e.g. 'Litcorp Inc.My App.5'.
DfltIcoExe and DfltIcoIndex are used to set default application icon,
this does affect associations of other files with the application,
not having its own DefaultIcon settings in the registry. }
function FileTypeReg2Ex(FExt,Desc,Cmd,Exe,Id: string;
IconIndex: integer; Default,Run: boolean;
const IcoExe: String; DfltIcoExe: String; NotifyShell: Boolean ): String;
{* The same as above (FileTypeReg2), but also returs a string which can be
passed later to FileTypeUnreg as a parameter to undo registration to a
previous state. }
procedure FileTypeUnreg( const UndoStr: String; NotifyShell: Boolean );
{* Pass as UndoStr a string returned by FileTypeReg2Ex to undo the association
made with it. }
function RegKeyDeleteAll( Key: HKey; const Subkey: KOLString ): Boolean;
{* In addition to RegKeyXXXXX functions in KOL.pas, allows to delete entire
key with all nested keys and values (careful, please!) }
implementation
function GetSystemFolder(Const Folder:integer):string;
var
PIDL: PItemIDList;
Path: array[ 0..MAX_PATH ] of Char;
begin
Result := '';
if SHGetSpecialFolderLocation(0, Folder, PIDL) = NOERROR then
begin
if SHGetPathFromIDList(PIDL, Path) then Result := IncludeTrailingPathDelimiter( Path );
CoTaskMemFree( PIDL );
end;
end;
const
IID_IPersistFile: TGUID = (
D1:$0000010B;D2:$0000;D3:$0000;D4:($C0,$00,$00,$00,$00,$00,$00,$46));
function CreateLink(const FileName,Arguments,WorkDir,IconFile:String;
IconNumber:integer; LinkName:String ): Boolean;
begin
Result := CreateLinkDesc( FileName, Arguments, WorkDir, IconFile, IconNumber,
LinkName, '' );
end;
function CreateLinkDesc(const FileName,Arguments,WorkDir,IconFile:String;
IconNumber:integer; LinkName:String;
Description:String): Boolean;
var
SLink : IShellLink;
PFile : IPersistFile;
WFileName : WideString;
begin
Result := FALSE;
CoInitialize( nil );
if CoCreateInstance( TGUID( CLSID_ShellLink ), nil, CLSCTX_INPROC_SERVER,
TGUID( IID_IShellLinkA ), SLink ) <> S_OK then Exit;
if SLink.QueryInterface( System.TGUID( IID_IPersistFile ), PFile ) <> S_OK then Exit;
SLink.SetArguments(PChar(Arguments));
SLink.SetPath(PChar(FileName));
SLink.SetWorkingDirectory(PChar(WorkDir));
SLink.SetDescription(PChar(Description));
SLink.SetIconLocation(PChar(IconFile),IconNumber);
if not DirectoryExists(ExtractFilePath(LinkName)) then
CreateDir( ExtractFilePath(LinkName) );
WFileName := LinkName;
PFile.Save(PWChar(WFileName),False);
Result := TRUE;
end;
{$IFDEF UNICODE_CTRLS}
type IShellLink_ = IShellLinkW;
{$ELSE}
type IShellLink_ = IShellLinkA;
{$ENDIF}
function ResolveLink( const LinkName: KOLString; var FileName, Arguments, WorkDir,
Description: KOLString; var IconSmall, IconLarge: HIcon; need_icons: Boolean;
DialogParentWnd: HWND ): Boolean;
var
SLink : IShellLink_;
PFile : IPersistFile;
WFileName : WideString;
Wnd: HWnd;
Flg: DWORD;
Buf: array[ 0..4095 ] of KOLChar;
FD: TWin32FindData;
I: Integer;
begin
Result := FALSE;
CoInitialize( nil );
if CoCreateInstance( TGUID( CLSID_ShellLink ), nil, CLSCTX_INPROC_SERVER,
TGUID( IID_IShellLinkA ), SLink ) <> S_OK then Exit;
if SLink.QueryInterface( System.TGUID( IID_IPersistFile ), PFile )
<> S_OK then Exit;
WFileName := LinkName;
PFile.Load(PWChar(WFileName),STGM_READ);
Wnd := DialogParentWnd;
if Wnd = THandle( -1 ) then
Wnd := 0;
Flg := SLR_UPDATE;
if DialogParentWnd = THandle(-1) then
Flg := SLR_NO_UI;
if SLink.Resolve( Wnd, Flg ) = NOERROR then
begin
if SLink.GetPath( Buf, Sizeof( Buf ) div Sizeof( KOLChar ),
PWin32FindDataA(@ FD)^ {error in ShlObj.pas !}
, 0 ) <> NOERROR then
FileName := ''
else FileName := Buf;
if SLink.GetArguments( Buf, Sizeof( Buf ) ) <> NOERROR then Exit;
Arguments := Buf;
if SLink.GetWorkingDirectory( Buf, Sizeof( Buf ) div Sizeof( KOLChar ) )
<> NOERROR then Exit;
WorkDir := Buf;
if SLink.GetDescription( Buf, Sizeof( Buf ) div Sizeof( KOLChar ) )
<> NOERROR then Exit;
Description := Buf;
IconSmall := 0;
IconLarge := 0;
if need_icons
and (SLink.GetIconLocation( Buf, Sizeof( Buf ) div Sizeof( KOLChar ), I )
= NOERROR) then
{$IFDEF UNICODE_CTRLS}
ExtractIconExW( Buf, I, IconLarge, IconSmall, 1 );
{$ELSE}
ExtractIconExA( Buf, I, IconLarge, IconSmall, 1 );
{$ENDIF}
Result := TRUE;
end;
end;
function IsLink2RecycleBin( const LinkName: String ): Boolean;
var
SLink : IShellLink;
PFile : IPersistFile;
WFileName : WideString;
Flg: DWORD;
ppidl, ppidl1, p, p1: PItemIDList;
begin
Result := FALSE;
CoInitialize( nil );
if CoCreateInstance( TGUID( CLSID_ShellLink ), nil, CLSCTX_INPROC_SERVER,
TGUID( IID_IShellLinkA ), SLink ) <> S_OK then Exit;
if SLink.QueryInterface( System.TGUID( IID_IPersistFile ), PFile ) <> S_OK then Exit;
WFileName := LinkName;
PFile.Load(PWChar(WFileName),STGM_READ);
Flg := SLR_NO_UI;
if SLink.Resolve( 0, Flg ) = NOERROR then
begin
if SLink.GetIDList( ppidl ) = NOERROR then
begin
if SHGetSpecialFolderLocation( 0, CSIDL_BITBUCKET, ppidl1 ) = NOERROR then
begin
Result := TRUE;
p := ppidl;
p1 := ppidl1;
while TRUE do
begin
if (p1.mkid.cb = p.mkid.cb) and (p1.mkid.cb = 0) then
break;
if (p1.mkid.cb <> p.mkid.cb) or
not CompareMem( @ p.mkid.abID[ 0 ], @ p1.mkid.abID[ 0 ],
p.mkid.cb ) then
begin
Result := FALSE;
break;
end;
p := Pointer( Integer( p ) + p.mkid.cb );
p1 := Pointer( Integer( p1 ) + p1.mkid.cb );
end;
CoTaskMemFree( ppidl1 );
end;
CoTaskMemFree( ppidl );
end;
end;
end;
function RegKeyDeleteAll( Key: HKey; const Subkey: KOLString ): Boolean;
type TSHDeleteKey = function( Key: HKey; Subkey: PKOLChar ): DWORD; stdcall;
var SHDeleteKey: TSHDeleteKey;
M: THandle;
begin
Result := FALSE;
M := LoadLibrary( 'shlwapi.dll' );
if M <> 0 then
TRY
SHDeleteKey := GetProcAddress( M,
{$IFDEF UNICODE_CTRLS} 'SHDeleteKeyW' {$ELSE} 'SHDeleteKeyA' {$ENDIF} );
if Assigned( SHDeleteKey ) then
Result := SHDeleteKey( Key, PKOLChar( SubKey ) ) = 0;
FINALLY
FreeLibrary( M );
END;
end;
procedure FileTypeRegEx(FExt,Desc,Cmd,Exe: string; IconIndex: integer; Default,Run: boolean;
const IcoExe: String; NotifyShell: Boolean );
begin
FileTypeRegEx( FExt, Desc, Cmd, Exe, IconIndex,
Default, Run, IcoExe, NotifyShell );
end;
//[procedure FileTypeReg]
procedure FileTypeReg(FExt,Desc,Cmd,Exe: string; IconIndex: integer; Default,Run: boolean);
begin
FileTypeRegEx( Fext,Desc,Cmd,Exe, IconIndex, Default, Run, Exe, TRUE );
end;
procedure FileTypeReg2(FExt,Desc,Cmd,Exe,Id: string;
IconIndex: integer;
Default,Run: boolean;
const IcoExe: String; DfltIcoExe: String; NotifyShell: Boolean );
var Reg: HKey;
Key: string;
begin
Reg:=RegKeyOpenWrite(HKEY_CLASSES_ROOT,'Applications');
//if not RegKeyExists(Reg,ExtractFileName(Exe)) then
begin
RegKeyClose(Reg);
Reg := RegKeyOpenCreate(HKEY_CLASSES_ROOT,
'Applications\'+ExtractFileName(Exe)+'\Shell\Open\Command');
RegKeySetStr(Reg,'',Exe+' "%1"');
RegKeyClose(Reg);
end;
//else RegKeyClose( Reg ); // {VK}
if Id <> '' then
begin
Reg := RegKeyOpenCreate(HKEY_CURRENT_USER,
'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\' + FExt);
RegKeySetStr( Reg, 'Progid', Id );
RegKeyClose( Reg );
end;
// HKCR\.ext Default=extfile
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,FExt);
Key:=LowerCase(FExt)+'file';
Delete(Key,1,1);
RegKeySetStr(Reg,'',Key);
RegKeyClose(Reg);
// HKCR\extfile Default=id
if Id <> '' then
begin
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key);
RegKeySetStr(Reg,'',Id);
RegKeyClose(Reg);
end;
// HKCR\id Default=pathto.exe
if Id <> '' then
begin
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Id);
RegKeySetStr(Reg,'',Exe);
RegKeyClose(Reg);
end;
if DfltIcoExe <> '' then
begin
// HKCR\id\DefaultIcon Default=DfltIcoExe
Reg := RegKeyOpenCreate(HKEY_CLASSES_ROOT,Id + '\DefaultIcon');
RegKeySetStr(Reg,'',DfltIcoExe);
RegKeyClose( Reg );
end;
if (IcoExe <> '') {or (IconIndex<>-1)} then
begin
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key+'\DefaultIcon');
if IconIndex = -1 then
RegKeySetStr(Reg,'',IcoExe + ',0' )
else RegKeySetStr(Reg,'',IcoExe + ',' + Int2Str(IconIndex) );
RegKeyClose(Reg);
end;
if Run then
begin
{Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key+'\Shell');
if Default then RegKeySetStr(Reg,'',Cmd)
else RegKeySetStr(Reg,'','');
RegKeyClose(Reg);
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key+'\Shell\'+Cmd);
RegKeyClose(Reg);}
{$IFNDEF LNK_NODELETE_OLDCMD}
Reg := RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key+'\Shell\');
RegKeyDeleteAll( Reg, Cmd );
if Default then
RegKeySetStr(Reg,'',Cmd);
RegKeyClose( Reg );
{$ENDIF}
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key+'\Shell\'+Cmd+'\Command');
RegKeySetStr(Reg,'',Exe+' "%1"');
RegKeyClose(Reg);
end;
//+ {VK}
if NotifyShell then
begin
SHChangeNotify( SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil );
//SHChangeNotify( SHCNE_ALLEVENTS, SHCNF_IDLIST, nil, nil );
end;
end;
function FileTypeReg2Ex(FExt,Desc,Cmd,Exe,Id: string;
IconIndex: integer; Default,Run: boolean;
const IcoExe: String; DfltIcoExe: String; NotifyShell: Boolean ): String;
var Reg: HKey;
Key: string;
Strm: PStream;
procedure add4Undo( const RegClass, RegKey, Cmd, Value: String );
var s: String;
begin
s := RegClass+',';
if RegKey <> '' then
s := s +Int2Str(Length(RegKey))+'('+RegKey+'),';
s := s+Cmd;
if Value <> '' then
s := s + ',' + Int2Str(Length(Value))+'('+Value+')';
Strm.WriteStr( s+#13 );
end;
procedure DeleteAllSubKeys( const RegClass, RegKey: String; Reg: THandle; const SubKey: String );
var SL: PKOLStrList;
i: Integer;
Reg1: THandle;
procedure not_supported;
asm
nop
end;
begin
SL := NewKOLStrList;
Reg1 := RegKeyOpenWrite( Reg, SubKey );
TRY
RegKeyGetSubKeys(Reg1, SL);
for i := 0 to SL.Count-1 do
begin
DeleteAllSubKeys( RegClass, RegKey + '\' + SL.Items[ i ], Reg1, SL.Items[ i ] );
end;
SL.Clear;
RegKeyGetValueNames( Reg1, SL );
for i := 0 to SL.Count-1 do
begin //todo: support more types of values
CASE RegKeyGetValueTyp(Reg1, SL.Items[ i ]) OF
REG_BINARY: not_supported;
REG_DWORD : // = REG_DWORD_LITTLE_ENDIAN
add4Undo( RegClass, RegKey, 'd=' + SL.Items[i], Int2Str( RegKeyGetDw(Reg1,SL.Items[i]) ) );
REG_DWORD_BIG_ENDIAN:
add4Undo( RegClass, RegKey, 'D=' + SL.Items[i], Int2Str( RegKeyGetDw(Reg1,SL.Items[i]) ) );
REG_EXPAND_SZ:
add4Undo( RegClass, RegKey, 'X=' + SL.Items[i], RegKeyGetStr(Reg1,SL.Items[i]) );
REG_LINK: not_supported;
REG_MULTI_SZ: not_supported;
REG_NONE: not_supported;
REG_RESOURCE_LIST: not_supported;
REG_SZ:
add4Undo( RegClass, RegKey, 'S=' + SL.Items[i], RegKeyGetStr(Reg1,SL.Items[i]) );
END;
end;
FINALLY
SL.Free;
RegKeyClose( Reg1 );
add4Undo( RegClass, RegKey, 'K-', SubKey );
RegKeyDelete( Reg, SubKey );
END;
end;
function q( const s: String ): String;
begin
if pos( ' ', s ) > 0 then Result := '"' + s + '"'
else Result := s;
end;
begin
Result := '';
Strm := NewMemoryStream;
TRY
Reg:=RegKeyOpenWrite(HKEY_CLASSES_ROOT,'Applications');
if not RegKeyExists( Reg, ExtractFileName(Exe) ) then
add4Undo( 'HKCR', 'Applications', 'K+',
ExtractFileName(Exe)+'\Shell\Open\Command' );
//if not RegKeyExists(Reg,ExtractFileName(Exe)) then
begin
RegKeyClose(Reg);
Reg := RegKeyOpenCreate(HKEY_CLASSES_ROOT,
'Applications\'+ExtractFileName(Exe)+'\Shell\Open\Command');
add4Undo( 'HKCR',
'Applications\'+ExtractFileName(Exe)+'\Shell\Open\Command',
'S=', RegKeyGetStr(Reg,'') );
RegKeySetStr(Reg,'',q(Exe)+' "%1"');
RegKeyClose(Reg);
end;
//else RegKeyClose( Reg ); // {VK}
if Id <> '' then
begin
if not RegKeyExists( HKEY_CURRENT_USER,
'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\' + FExt ) then
add4Undo( 'HKCU', '', 'K+',
'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\' + FExt );
Reg := RegKeyOpenCreate(HKEY_CURRENT_USER,
'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\' + FExt);
if not RegKeyValExists( Reg, 'ProgId' ) then
add4Undo( 'HKCU',
'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\' + FExt,
'V+', 'ProgId' )
else
add4Undo( 'HKCU',
'Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\' + FExt,
'S=ProgId', RegKeyGetStr(Reg,'ProgId') );
RegKeySetStr( Reg, 'Progid', Id );
RegKeyClose( Reg );
end;
// HKCR\.ext Default=extfile
if not RegKeyExists( HKEY_CLASSES_ROOT, FExt ) then
add4Undo( 'HKCR', '', 'K+', FExt );
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,FExt);
Key:=LowerCase(FExt)+'file';
Delete(Key,1,1);
add4Undo( 'HKCR', FExt, 'S=', RegKeyGetStr( Reg, '' ) );
RegKeySetStr(Reg,'',Key);
RegKeyClose(Reg);
// HKCR\extfile Default=id
if Id <> '' then
begin
if not RegKeyExists( HKEY_CLASSES_ROOT, Key ) then
add4Undo( 'HKCR', '', 'K+', Key );
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key);
add4Undo( 'HKCR', Key, 'S=', RegKeyGetStr( Reg, '' ) );
RegKeySetStr(Reg,'',Id);
RegKeyClose(Reg);
end;
// HKCR\id Default=pathto.exe
if Id <> '' then
begin
if not RegKeyExists( HKEY_CLASSES_ROOT, Id ) then
add4Undo( 'HKCR', '', 'K+', Id );
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Id);
add4Undo( 'HKCR', Id, 'S=', RegKeyGetStr( Reg, '' ) );
RegKeySetStr(Reg,'',Exe);
RegKeyClose(Reg);
end;
if DfltIcoExe <> '' then
begin
// HKCR\id\DefaultIcon Default=DfltIcoExe
if not RegKeyExists( HKEY_CLASSES_ROOT, Id + '\DefaultIcon' ) then
add4Undo( 'HKCR', '', 'K+', Id + '\DefaultIcon' );
Reg := RegKeyOpenCreate(HKEY_CLASSES_ROOT,Id + '\DefaultIcon');
add4Undo( 'HKCR', Id+'\DefaultIcon', 'S=', RegKeyGetStr( Reg, '' ) );
RegKeySetStr(Reg,'',DfltIcoExe);
RegKeyClose( Reg );
end;
if (IcoExe <> '') then
begin
if not RegKeyExists( HKEY_CLASSES_ROOT, Key + '\DefaultIcon' ) then
add4Undo( 'HKCR', '', 'K+', Key + '\DefaultIcon' );
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key+'\DefaultIcon');
add4Undo( 'HKCR', Key+'\DefaultIcon', 'S=', RegKeyGetStr( Reg, '' ) );
if IconIndex = -1 then
RegKeySetStr(Reg,'',IcoExe + ',0' )
else
RegKeySetStr(Reg,'',IcoExe + ',' + Int2Str(IconIndex) );
RegKeyClose(Reg);
end;
if Run then
begin
{$IFNDEF LNK_NODELETE_OLDCMD}
if not RegKeyExists( HKEY_CLASSES_ROOT, Key + '\Shell' ) then
add4Undo( 'HKCR', '', 'K+', Key + '\Shell' );
Reg := RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key+'\Shell\');
DeleteAllSubKeys( 'HKCR', Key + '\Shell', Reg, Cmd );
if Default then
begin
add4Undo( 'HKCR', Key+'\Shell', 'S=', RegKeyGetStr( Reg, '' ) );
RegKeySetStr(Reg,'',Cmd);
end;
RegKeyClose( Reg );
{$ENDIF}
if not RegKeyExists( HKEY_CLASSES_ROOT, Key+'\Shell\'+Cmd+'\Command' ) then
add4Undo( 'HKCR', '', 'K+', Key+'\Shell\'+Cmd+'\Command' );
Reg:=RegKeyOpenCreate(HKEY_CLASSES_ROOT,Key+'\Shell\'+Cmd+'\Command');
add4Undo( 'HKCR', Key+'\Shell\'+Cmd+'\Command', 'S=', RegKeyGetStr( Reg, '' ) );
RegKeySetStr(Reg,'',Exe+' "%1"');
RegKeyClose(Reg);
end;
if NotifyShell then
SHChangeNotify( SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil );
SetString( Result, PChar( Strm.Memory ), Strm.Size );
FINALLY
Strm.Free;
END;
end;
procedure FileTypeUnreg( const UndoStr: String; NotifyShell: Boolean );
var SL: PStrList;
i: Integer;
s: KOLString;
RegClass, RegKey, Cmd, Value, ValName: KOLString;
R: THandle;
Cls: DWORD;
procedure ExtractStr( var s: KOLString );
var i: Integer;
begin
if s = '' then Exit;
i := Str2Int( s );
if i = 0 then Exit;
Parse( s, '(' );
s := Copy( s, 1, i );
end;
begin
SL := NewStrList;
TRY
SL.Text := UndoStr;
for i := SL.Count-1 downto 0 do
begin
s := SL.Items[ i ];
RegClass := Parse( S, ',' );
RegKey := Parse( S, ',' );
ExtractStr( RegKey );
Cmd := Parse( s, ',' );
Value := s; ExtractStr( Value );
if RegClass = 'HKCU' then Cls := HKEY_CURRENT_USER
else if RegClass = 'HKLM' then Cls := HKEY_LOCAL_MACHINE
else if RegClass = 'HKCR' then Cls := HKEY_CLASSES_ROOT
else Cls := HKEY_CURRENT_USER;
if Cmd = 'K+' then // удалить ключ
RegKeyDelete( Cls, RegKey )
else
if Cmd = 'K-' then // восстановить ключ
begin
R := RegKeyOpenCreate( Cls, RegKey + '\' + Value );
RegKeyClose( R );
end
else
begin
R := RegKeyOpenWrite( Cls, RegKey );
ValName := CopyEnd( Cmd, 3 );
TRY
if Cmd = 'V+' then // удалить значение
RegKeyDeleteValue( R, Value )
else if Cmd[1] = 'S' then // восстановить строковое значение
RegKeySetStr( R, ValName, Value )
else if Cmd[1] = 'd' then // восстановить значение типа DWORD:
RegKeySetDw( R, ValName, Str2Int( Value ) )
else if Cmd[1] = 'X' then
RegKeySetStrEx( R, ValName, Value, TRUE );
FINALLY
RegKeyClose( R );
END;
end;
end;
if NotifyShell then
SHChangeNotify( SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil );
FINALLY
SL.Free;
END;
end;
function FileTypeGetReg(const FExt,Cmd: KOLString; var Desc, OldIcoExe: KOLString;
var OldIcoIdx: Integer; var OldId: KOLString ): KOLString;
var Reg: HKey;
Key: KOLString;
S: KOLString;
begin
Result := '';
Desc := '';
Reg := RegKeyOpenRead(HKEY_CLASSES_ROOT,FExt);
if Reg = 0 then Exit;
OldId := RegKeyGetStr( Reg, '' );
Key:=LowerCase(FExt)+'file';
Delete(Key,1,1);
Key := RegKeyGetStr(Reg,'');
RegKeyClose(Reg);
Reg:=RegKeyOpenRead(HKEY_CLASSES_ROOT,Key);
Desc := RegKeyGetStr(Reg,'');
RegKeyClose(Reg);
Reg:=RegKeyOpenRead(HKEY_CLASSES_ROOT,Key+'\Shell\'+Cmd+'\Command');
Result := Trim( RegKeyGetStr(Reg,'') );
RegKeyClose(Reg);
if CopyTail( Result, 4 ) = '"%1"' then
Result := Trim( Copy( Result, 1, Length( Result )-4 ) );
Reg:=RegKeyOpenRead(HKEY_CLASSES_ROOT,Key+'\DefaultIcon');
S := RegKeyGetStr(Reg,'' );
OldIcoExe := Parse( S, ',' );
OldIcoIdx := Str2Int( S );
RegKeyClose(Reg);
end;
end.
|
unit ShopByItemsForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, CheckLst, Menus,
InflatablesList_ShopSelectArray,
InflatablesList_Manager;
type
TfShopByItemsForm = class(TForm)
lblItems: TLabel;
clbItems: TCheckListBox;
lblShops: TLabel;
lvShops: TListView;
pmnItems: TPopupMenu;
mniSL_UnselectAll: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure clbItemsClickCheck(Sender: TObject);
procedure clbItemsDrawItem(Control: TWinControl; aIndex: Integer;
Rect: TRect; State: TOwnerDrawState);
procedure mniSL_UnselectAllClick(Sender: TObject);
private
{ Private declarations }
fDrawBuffer: TBitmap;
fILManager: TILManager;
fWorkTable: TILCountedDynArraySelectionShops;
procedure BuildTable;
procedure RecountShops;
procedure FillItems;
procedure FillShops;
procedure UpdateSelCount;
public
{ Public declarations }
procedure Initialize(ILManager: TILManager);
procedure Finalize;
procedure ShowSelection;
end;
var
fShopByItemsForm: TfShopByItemsForm;
implementation
{$R *.dfm}
uses
InflatablesList_Utils,
InflatablesList_LocalStrings,
InflatablesList_ShopSelectItemsArray,
InflatablesList_Item;
procedure TfShopByItemsForm.BuildTable;
var
i,j: Integer;
Index: Integer;
Temp: TILSelectionShopEntry;
Entry: TILShopSelectItemEntry;
begin
// enumerate existing shops by name
CDA_Init(fWorkTable);
For i := fILManager.ItemLowIndex to fILManager.ItemHighIndex do
If fILManager[i].DataAccessible and (fILManager[i].ShopsUsefulCount > 0) then
For j := fILManager[i].ShopLowIndex to fILManager[i].ShopHighIndex do
begin
Temp.ShopName := fILManager[i][j].Name;
Index := CDA_IndexOf(fWorkTable,Temp);
If not CDA_CheckIndex(fWorkTable,Index) then
begin
// shop is not in the table, add it
CDA_Init(Temp.Items);
Index := CDA_Add(fWorkTable,Temp);
end;
If fILManager[i][j].IsAvailableHere(True) then
begin
Entry.ItemObject := fILManager[i];
Entry.Price := fILManager[i][j].Price; // price of this item in this shop
CDA_Add(CDA_GetItemPtr(fWorkTable,Index)^.Items,Entry);
end;
end;
CDA_Sort(fWorkTable);
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.RecountShops;
var
i,j: Integer;
Index: Integer;
CheckCount: Integer;
begin
// init counters
For i := CDA_Low(fWorkTable) to CDA_High(fWorkTable) do
with CDA_GetItemPtr(fWorkTable,i)^ do
begin
Selected := 0;
PriceOfSel := 0;
end;
// do the counting
CheckCount := 0;
For i := 0 to Pred(clbItems.Count) do
If clbItems.Checked[i] then
begin
Inc(CheckCount);
For j := CDA_Low(fWorkTable) to CDA_High(fWorkTable) do
begin
Index := CDA_IndexOfObject(CDA_GetItem(fWorkTable,j).Items,TILItem(clbItems.Items.Objects[i]));
If CDA_CheckIndex(CDA_GetItem(fWorkTable,j).Items,Index) then
with CDA_GetItemPtr(fWorkTable,j)^ do
begin
Inc(Selected);
with CDA_GetItem(CDA_GetItem(fWorkTable,j).Items,Index) do
Inc(PriceOfSel,Price * ItemObject.Pieces);
end;
end;
end;
// finalize
If CheckCount > 0 then
begin
For i := CDA_Low(fWorkTable) to CDA_High(fWorkTable) do
with CDA_GetItemPtr(fWorkTable,i)^ do
If Selected < CheckCount then
Selected := 0;
end
else
begin
// to show all shops when nothing is selected...
For i := CDA_Low(fWorkTable) to CDA_High(fWorkTable) do
with CDA_GetItemPtr(fWorkTable,i)^ do
begin
Selected := 1;
PriceOfSel := 0;
end;
end;
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.FillItems;
var
i: Integer;
begin
clbItems.Items.BeginUpdate;
try
clbItems.Clear;
For i := fILManager.ItemLowIndex to fILManager.ItemHighIndex do
If fILManager[i].DataAccessible and (fILManager[i].ShopsUsefulCount > 0) then
clbItems.AddItem(fILManager[i].TitleStr,fILManager[i]);
For i := 0 to Pred(clbItems.Count) do
clbItems.Checked[i] := False;
finally
clbItems.Items.EndUpdate;
end;
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.FillShops;
var
i: Integer;
Cntr: Integer;
begin
// count numer of shops that will be shown
Cntr := 0;
For i := CDA_Low(fWorkTable) to CDA_High(fWorkTable) do
If CDA_GetItem(fWorkTable,i).Selected > 0 then
Inc(Cntr);
// adjust item count
lvShops.Items.BeginUpdate;
try
If lvShops.Items.Count < Cntr then
begin
For i := lvShops.Items.Count to Pred(Cntr) do
with lvShops.Items.Add do
SubItems.Add(''); // price
end
else If lvShops.Items.Count > Cntr then
begin
For i := Pred(lvShops.Items.Count) downto Cntr do
lvShops.Items.Delete(i);
end;
finally
lvShops.Items.EndUpdate;
end;
// fill the list
Cntr := 0;
For i := CDA_Low(fWorkTable) to CDA_High(fWorkTable) do
If (CDA_GetItem(fWorkTable,i).Selected > 0) and (Cntr < lvShops.Items.Count) then
begin
lvShops.Items[Cntr].Caption := CDA_GetItem(fWorkTable,i).ShopName;
If CDA_GetItem(fWorkTable,i).PriceOfSel > 0 then
lvShops.Items[Cntr].SubItems[0] := IL_Format('%d %s',[CDA_GetItem(fWorkTable,i).PriceOfSel,IL_CURRENCY_SYMBOL])
else
lvShops.Items[Cntr].SubItems[0] := '';
Inc(Cntr);
end;
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.UpdateSelCount;
var
i,Cntr: Integer;
begin
Cntr := 0;
For i := 0 to Pred(clbItems.Count) do
If clbItems.Checked[i] then
Inc(Cntr);
lblItems.Caption := IL_Format('Items (%d selected):',[Cntr]);
end;
//==============================================================================
procedure TfShopByItemsForm.Initialize(ILManager: TILManager);
begin
fILManager := ILManager;
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.Finalize;
begin
// nothing to do
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.ShowSelection;
var
i: Integer;
begin
BuildTable;
FillItems;
RecountShops;
FillShops;
// reinit only for actually shown, not all
For i := 0 to Pred(clbItems.Count) do
with TILItem(clbItems.Items.Objects[i]) do
begin
BeginUpdate;
try
ReinitSmallDrawSize(clbItems.ClientWidth,clbItems.ItemHeight,clbItems.Font);
ChangeSmallStripSize(16);
finally
EndUpdate;
end;
end;
UpdateSelCount;
ShowModal;
end;
//==============================================================================
procedure TfShopByItemsForm.FormCreate(Sender: TObject);
begin
fDrawBuffer := TBitmap.Create;
fDrawBuffer.PixelFormat := pf24bit;
fDrawBuffer.Canvas.Font.Assign(clbItems.Font);
clbItems.DoubleBuffered := True;
lvShops.DoubleBuffered := True;
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.FormDestroy(Sender: TObject);
begin
FreeAndNil(fDrawBuffer);
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.clbItemsClickCheck(Sender: TObject);
begin
RecountShops;
FillShops;
UpdateSelCount;
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.clbItemsDrawItem(Control: TWinControl; aIndex: Integer; Rect: TRect; State: TOwnerDrawState);
var
BoundsRect: TRect;
TempStr: String;
TempInt: Integer;
begin
If Assigned(fDrawBuffer) then
begin
// adjust draw buffer size
If fDrawBuffer.Width < Rect.Right then
fDrawBuffer.Width := Rect.Right;
If fDrawBuffer.Height < (Rect.Bottom - Rect.Top) then
fDrawBuffer.Height := Rect.Bottom - Rect.Top;
BoundsRect := Classes.Rect(0,0,Rect.Right,Rect.Bottom - Rect.Top);
with fDrawBuffer.Canvas do
begin
// content
Draw(BoundsRect.Left,BoundsRect.Top,TILItem(clbItems.Items.Objects[aIndex]).RenderSmall);
TILItem(clbItems.Items.Objects[aIndex]).RenderSmall.Dormant;
// separator line
Pen.Style := psSolid;
Pen.Color := clSilver;
MoveTo(BoundsRect.Left,Pred(BoundsRect.Bottom));
LineTo(BoundsRect.Right,Pred(BoundsRect.Bottom));
// marker
Pen.Style := psClear;
Brush.Style := bsSolid;
Brush.Color := $00F7F7F7;
Rectangle(BoundsRect.Left,BoundsRect.Top,BoundsRect.Left +
TILItem(clbItems.Items.Objects[aIndex]).SmallStrip,BoundsRect.Bottom);
// shop price
TempStr := IL_Format('%d %s',[TILItem(clbItems.Items.Objects[aIndex]).UnitPrice,IL_CURRENCY_SYMBOL]);
Brush.Style := bsClear;
Font.Style := [fsBold];
Font.Color := clWindowText;
Font.Size := 10;
TextOut(BoundsRect.Right - TextWidth(TempStr) - 64,BoundsRect.Top + 2,TempStr);
// states
If odSelected in State then
begin
Pen.Style := psClear;
Brush.Style := bsSolid;
Brush.Color := clLime;
Rectangle(BoundsRect.Left,BoundsRect.Top,BoundsRect.Left +
TILItem(clbItems.Items.Objects[aIndex]).SmallStrip,BoundsRect.Bottom);
end;
// checkbox
Pen.Style := psSolid;
Pen.Color := clGray;
Brush.Style := bsSolid;
Brush.Color := clWindow;
TempInt := BoundsRect.Top + (clbItems.ItemHeight - 13) div 2;
with TILItem(clbItems.Items.Objects[aIndex]) do
begin
Rectangle(BoundsRect.Left + 1,TempInt,BoundsRect.Left + SmallStrip - 2,TempInt + 13);
If clbItems.Checked[aIndex] then
begin
Pen.Style := psClear;
Brush.Style := bsSolid;
Brush.Color := clBlue;
Rectangle(BoundsRect.Left + 3,TempInt + 2,BoundsRect.Left + SmallStrip - 3,TempInt + 12);
end;
end;
end;
// move drawbuffer to the canvas
clbItems.Canvas.CopyRect(Classes.Rect(0,Rect.Top,Rect.Right,Rect.Bottom),fDrawBuffer.Canvas,BoundsRect);
// remove focus rect
If odFocused in State then
clbItems.Canvas.DrawFocusRect(Rect);
end;
end;
//------------------------------------------------------------------------------
procedure TfShopByItemsForm.mniSL_UnselectAllClick(Sender: TObject);
var
i: Integer;
begin
For i := 0 to Pred(clbItems.Count) do
clbItems.Checked[i] := False;
RecountShops;
FillShops;
UpdateSelCount;
end;
end.
|
unit MainForm;
{$mode objfpc}{$H+}
interface
uses
SysUtils, Forms, Controls, Dialogs, StdCtrls, ActnList,
main_datamodule, lclintf, Menus, ComCtrls, ExtCtrls, Buttons,
SynHighlighterSQL, SynEdit;
type
{ TApplicationMainForm }
TApplicationMainForm = class(TForm)
ActionOpenReportsFolder: TAction;
ActionEditorTests: TAction;
ActionAbout: TAction;
ActionExecQuery: TAction;
BitBtn1: TBitBtn;
CheckBoxSaveToFile: TCheckBox;
LabeledEditFileName: TLabeledEdit;
MainActionList: TActionList;
MainMenu: TMainMenu;
MenuItem1: TMenuItem;
MenuItemQueries: TMenuItem;
MenuItemDuplicates: TMenuItem;
MenuItemSetup: TMenuItem;
MenuItemAbout: TMenuItem;
PanelAppPanel: TPanel;
StatusBar: TStatusBar;
SynEditorSql: TSynEdit;
SynSQLSyn: TSynSQLSyn;
procedure ActionAboutExecute(Sender: TObject);
procedure ActionExecQueryExecute(Sender: TObject);
procedure ActionOpenReportsFolderExecute(Sender: TObject);
procedure CheckBoxSaveToFileChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure SynEditorSqlChange(Sender: TObject);
function GetSqlEditorTextLength: Integer;
function IsSqlEditorEmpty: Boolean;
private
public
end;
var
ApplicationMainForm: TApplicationMainForm;
implementation
{$R *.lfm}
{ TApplicationMainForm }
const
ZERO_LENGH_TEXT_SIZE : Integer = 2;
function TApplicationMainForm.GetSqlEditorTextLength : Integer;
begin
Result := Length(SynEditorSql.Text) - ZERO_LENGH_TEXT_SIZE;
end;
function TApplicationMainForm.IsSqlEditorEmpty: Boolean;
begin
Result := GetSqlEditorTextLength() = 0;
end;
procedure TApplicationMainForm.FormCreate(Sender: TObject);
const
DATABASE_SERVER_INFO_TEMPLATE : String = 'Servidor: %s:%s';
var
HistoryFile : THandle;
begin
If Not DirectoryExists(MainDataModule.GetReportsFolderRelativePath) then
If Not CreateDir (MainDataModule.GetReportsFolderRelativePath) Then
MessageDlg('Informação', 'Não foi possível Criar a pasta de Relatórios', mtError, [mbOK], 0);
If Not FileExists(MainDataModule.HISTORY_FILE_NAME) then
begin
HistoryFile := FileCreate(MainDataModule.HISTORY_FILE_NAME);
FileClose(HistoryFile);
end;
StatusBar.Panels[0].Text := Format(DATABASE_SERVER_INFO_TEMPLATE, [MainDataModule.DatabaseConnection.HostName, MainDataModule.DatabaseConnection.Params[0].Remove(0, 5)]);
StatusBar.Panels[1].Text := 'Relatórios: ' + MainDataModule.GetReportsFolderFullPath;
end;
procedure TApplicationMainForm.ActionExecQueryExecute(Sender: TObject);
var
Query : String;
MessageText : String = 'Deseja realmente executar o código informado?' + sLineBreak + 'Recomenda-se muita atenção para não executar comandos que têm potencial de Deletar ou Modificar informações da Base de Dados';
begin
Query := SynEditorSql.Lines.Text;
if MessageDlg(MainDataModule.MESSAGE_TITLE, MessageText, mtConfirmation, [mbNo, mbYes], 0) = mrYes then
If CheckBoxSaveToFile.Checked then
MainDataModule.ExecuteQuery(Query, LabeledEditFileName.Text)
else
MainDataModule.ExecuteQuery(Query);
end;
procedure TApplicationMainForm.ActionOpenReportsFolderExecute(Sender: TObject);
begin
OpenDocument(MainDataModule.GetReportsFolderFullPath);
end;
procedure TApplicationMainForm.CheckBoxSaveToFileChange(Sender: TObject);
begin
LabeledEditFileName.Enabled := CheckBoxSaveToFile.Checked;
end;
procedure TApplicationMainForm.ActionAboutExecute(Sender: TObject);
const
LICENCE : String = 'Licença:';
begin
MessageDlg(MainDataModule.MESSAGE_TITLE, 'Desenvolvolvimento: Gedean Dias (gedean.dias@akapu.com.br)', mtInformation, [mbOK], 0);
end;
procedure TApplicationMainForm.SynEditorSqlChange(Sender: TObject);
begin
ActionExecQuery.Enabled := not IsSqlEditorEmpty;
end;
end.
|
// This software is Copyright (c) 2014 Embarcadero Technologies, Inc.
// You may only use this software if you are an authorized licensee
// of one of Embarcadero's developer tools products.
// This software is considered a Redistributable as defined under
// the software license agreement that comes with the Embarcadero Products
// and is subject to that software license agreement.
unit uGlassLevel;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, System.Sensors,
FMX.StdCtrls, FMX.Objects, FMX.Ani, Generics.Collections,
FMX.Platform, System.Sensors.Components
{$IFDEF Android}
, Androidapi.JNI.PowerManager
{$ENDIF}
;
type
TForm2 = class(TForm)
StyleBook1: TStyleBook;
MotionSensor1: TMotionSensor;
LineActive: TLine;
LabelX: TLabel;
LabelZ: TLabel;
LineReference: TLine;
FloatAnimationX: TFloatAnimation;
FloatAnimationZ: TFloatAnimation;
Timer1: TTimer;
procedure MotionSensor1DataChanged(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FloatAnimationXFinish(Sender: TObject);
procedure FloatAnimationZFinish(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
FXSample: TList<Single>;
FZSample: TList<Single>;
const SampleCount = 20;
procedure UpdateZ;
procedure UpdateX;
public
{ Public declarations }
function HandleAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean;
end;
var
Form2: TForm2;
implementation
{$R *.fmx}
function Average(collection: TList<Single>): Single;
var
sample: Single;
begin
result := 0;
if collection.Count = 0 then exit;
for sample in collection do
begin
result := result + sample;
end;
result := result / collection.Count;
end;
procedure TForm2.FloatAnimationXFinish(Sender: TObject);
begin
UpdateX;
end;
procedure TForm2.FloatAnimationZFinish(Sender: TObject);
begin
UpdateZ;
end;
procedure TForm2.FormCreate(Sender: TObject);
var
aFMXApplicationEventService: IFMXApplicationEventService;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationEventService, IInterface(aFMXApplicationEventService)) then
aFMXApplicationEventService.SetApplicationEventHandler(HandleAppEvent);
FXSample := TList<Single>.Create;
FZSample := TList<Single>.Create;
end;
procedure TForm2.FormDestroy(Sender: TObject);
begin
{$IFDEF Android}
ReleaseWakeLock;
{$ENDIF}
end;
function TForm2.HandleAppEvent(AAppEvent: TApplicationEvent;
AContext: TObject): Boolean;
begin
{$IFDEF Android}
Result := True;
case AAppEvent of
TApplicationEvent.FinishedLaunching: AcquireWakeLock;
TApplicationEvent.BecameActive: AcquireWakeLock;
TApplicationEvent.WillBecomeInactive: ReleaseWakeLock;
TApplicationEvent.EnteredBackground: ReleaseWakeLock;
TApplicationEvent.WillBecomeForeground: AcquireWakeLock;
TApplicationEvent.WillTerminate: ReleaseWakeLock;
else
Result := False;
end;
{$ENDIF}
end;
procedure TForm2.UpdateX();
var
x: Single;
begin
if not FloatAnimationX.Running then
begin
x := Average(FXSample) * -90;
FXSample.Clear;
FloatAnimationX.Enabled := False;
LabelX.Text := Format('L/R: %6.2f ', [X]);
FloatAnimationX.StopValue := X;
FloatAnimationX.Enabled := True;
end;
end;
procedure TForm2.UpdateZ;
var
z: Single;
begin
if not FloatAnimationZ.Running then
begin
z := Average(FZSample);
FZSample.Clear;
LabelZ.Text := Format('U/D: %6.2f ', [Z * 100]);
FloatAnimationZ.Enabled := False;
FloatAnimationZ.StopValue := LineReference.Position.Y + (Z * (Height));
if FloatAnimationZ.StopValue < 0 then
FloatAnimationZ.StopValue := 0
else if FloatAnimationZ.StopValue > Height - 5 then
FloatAnimationZ.StopValue := Height - 5;
FloatAnimationZ.Enabled := True;
end;
end;
procedure TForm2.MotionSensor1DataChanged(Sender: TObject);
var
LProp: TCustomMotionSensor.TProperty;
x, z: Single;
begin
x := 0;
z := 0;
if Assigned(MotionSensor1.Sensor) then
begin
for LProp in MotionSensor1.Sensor.AvailableProperties do
begin
{ get the data from the sensor }
case LProp of
TCustomMotionSensor.TProperty.AccelerationX:
begin
x := MotionSensor1.Sensor.AccelerationX;
end;
TCustomMotionSensor.TProperty.AccelerationZ:
begin
z := MotionSensor1.Sensor.AccelerationZ;
end;
end;
end;
end;
FXSample.Add(X);
FZSample.Add(Z);
end;
end.
|
unit weather_types;
interface
type
TWeatherRec = record
Location: string;
Time: string;
Wind: string;
Visibility: string;
SkyConditions: string;
Temperature: string;
DewPoint: string;
RelativeHumidity: string;
Pressure: string;
Status: string;
end;
implementation
end.
|
unit MainUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, CoolTrayIcon, Menus,ShellApi,Ini;
const
WM_TrayIcon = WM_USER + 1280;
type
TMain = class(TForm)
Timer: TTimer;
Logs: TMemo;
CoolTrayIcon: TCoolTrayIcon;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
procedure N4Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure CoolTrayIconDblClick(Sender: TObject);
procedure TimerTimer(Sender: TObject);
procedure FormHide(Sender: TObject);
private
{ Private declarations }
IconData: TNotifyIconData;
public
{ Public declarations }
procedure AddIconToTray;
procedure DelIconFromTray;
end;
var
Main: TMain;
ServerDescription: ShortString;
Cl,shows,OverWrite,Del:Boolean;
fileFrom,fileTo : string;
implementation
{$R *.dfm}
procedure TMain.AddIconToTray;
begin
ZeroMemory(@IconData, SizeOf(TNotifyIconData));
IconData.cbSize := SizeOf(TNotifyIconData);
IconData.Wnd := Handle;
IconData.uID := 1;
IconData.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
IconData.uCallbackMessage := WM_TrayIcon;
IconData.hIcon := Application.Icon.Handle;
StrPCopy(IconData.szTip, ServerDescription);
Shell_NotifyIcon(NIM_ADD, @IconData);
end;
procedure TMain.CoolTrayIconDblClick(Sender: TObject);
begin
if shows then Hide
else Show;
end;
procedure TMain.DelIconFromTray;
begin
Shell_NotifyIcon(NIM_DELETE, @IconData);
end;
procedure TMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if not Cl then
begin
Hide;
Abort;
end;
end;
procedure TMain.FormCreate(Sender: TObject);
var
Temp:string;
begin
Cl := False;
fileFrom := Ini.ReadIni('server','fileFrom');
fileTo := Ini.ReadIni('server','fileTo');
Temp := Ini.ReadIni('server','time');
if Temp = '' then Timer.Interval := 1 * 1000
else Timer.Interval := StrToInt(Temp) * 1000;
OverWrite := Ini.ReadIni('server','overwrite') = 'True';
Del := Ini.ReadIni('server','Del') = 'True';
Timer.Enabled := True;
end;
procedure TMain.FormHide(Sender: TObject);
begin
shows := False;
end;
procedure TMain.FormShow(Sender: TObject);
begin
shows := True;
end;
procedure TMain.N2Click(Sender: TObject);
begin
Show;
end;
procedure TMain.N3Click(Sender: TObject);
begin
Hide;
end;
procedure TMain.N4Click(Sender: TObject);
begin
DelIconFromTray;
Cl := True;
Close;
end;
procedure TMain.TimerTimer(Sender: TObject);
var
sr:TSearchRec;
HFile,Times : Integer;
Today : string;
begin
Application.ProcessMessages;
Today := FormatDateTime('yyyy-MM-dd',Now);
if SysUtils.FindFirst(fileFrom + '\*', faAnyFile, sr) = 0 then
begin
repeat
if (sr.Name<>'.') and (sr.Name<>'..') then
begin
CopyFile(PChar(fileFrom + '\' + sr.Name),PChar(fileTo + '\' + sr.Name),OverWrite);
if Logs.Lines.Count > 200 then Logs.Lines.Clear;
Logs.Lines.Add(FormatDateTime('hh:mm:ss', now) + ' ¸´ÖÆÁË:' + sr.Name);
if Del then
begin
// HFile := FileOpen(fileFrom + '\' + sr.Name,fmOpenRead);
// Times := FileGetDate(HFile);
// FileClose(HFile);
//
// if FormatDateTime('yyyy-mm-dd',FileDateToDateTime(Times)) <> Today then
// begin
DeleteFile(PChar(fileFrom + '\' + sr.Name));
Logs.Lines.Add(FormatDateTime('hh:mm:ss', now) + ' ɾ³ýÁË:' + sr.Name);
// end;
end;
end;
until SysUtils.FindNext(sr) <> 0;
SysUtils.FindClose(sr);
end;
end;
end.
|
unit uFrUsuario;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, uFrPadrao, Data.DB, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
FireDAC.Comp.DataSet, FireDAC.Comp.Client, Vcl.Buttons, Vcl.Grids,
Vcl.DBGrids, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.ComCtrls, uUsuarioController,
uPermissoesModel, uUsuarioModel;
type
TfrUsuario = class(TfrPadrao)
edtNome: TLabeledEdit;
edtCodigo: TLabeledEdit;
edtCPF: TLabeledEdit;
edtSenha: TLabeledEdit;
edtCelular: TLabeledEdit;
gbxPermissoes: TGroupBox;
cbxUsuario: TCheckBox;
cbxAutor: TCheckBox;
cbxEmprestimo: TCheckBox;
cbxEditora: TCheckBox;
cbxLivro: TCheckBox;
cbxPermissoes: TCheckBox;
qryPermissoes: TFDQuery;
procedure btnIncluirClick(Sender: TObject);
procedure btnPesquisarClick(Sender: TObject);
procedure btnExcluirClick(Sender: TObject);
procedure btnGravarClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure dbgPadraoDblClick(Sender: TObject);
private
FCodigoPermissoes: Integer;
FUsuarioController: TUsuarioController;
procedure LimpaCampos();
procedure IncluirRegistro();
function GravarRegistro(): Boolean;
function ExcluirRegistro(): Boolean;
procedure PesquisarRegistros();
function ValidaCampos(): Boolean;
procedure EditarRegistro();
procedure EditarRegistroPermissoes();
function GravaRegistoUsuario(): Boolean;
function GravaRegistoPermissoes(LCodigoUsuario: Integer): Boolean;
public
end;
var
frUsuario: TfrUsuario;
implementation
{$R *.dfm}
{ TfrUsuario }
procedure TfrUsuario.btnExcluirClick(Sender: TObject);
begin
inherited;
ExcluirRegistro();
PesquisarRegistros();
end;
procedure TfrUsuario.btnGravarClick(Sender: TObject);
begin
inherited;
GravarRegistro();
end;
procedure TfrUsuario.btnIncluirClick(Sender: TObject);
begin
inherited;
IncluirRegistro();
end;
procedure TfrUsuario.btnPesquisarClick(Sender: TObject);
begin
inherited;
PesquisarRegistros();
end;
procedure TfrUsuario.dbgPadraoDblClick(Sender: TObject);
begin
inherited;
EditarRegistro();
end;
procedure TfrUsuario.EditarRegistro;
begin
if not (qryPadrao.FieldByName('codigo').AsInteger > 0) then
Exit;
edtCodigo.Text := qryPadrao.FieldByName('codigo').AsString;
edtNome.Text := qryPadrao.FieldByName('nome').AsString;
edtCPF.Text := qryPadrao.FieldByName('cpf').AsString;
edtSenha.Text := qryPadrao.FieldByName('senha').AsString;
edtCelular.Text := qryPadrao.FieldByName('celular').AsString;
pgcPadrao.TabIndex := 1;
EditarRegistroPermissoes();
AjustaVisibilidadeBotoes();
end;
procedure TfrUsuario.EditarRegistroPermissoes;
var LSQL: String;
begin
if not (qryPadrao.FieldByName('codigo').AsInteger > 0) then
Exit;
LSQL :=
'SELECT * FROM PERMISSOES WHERE USUARIO_CODIGO = :usuario_codigo';
if qryPermissoes.Active then
qryPermissoes.Close;
qryPermissoes.SQL.Text := LSQL;
qryPermissoes.ParamByName('usuario_codigo').AsInteger := qryPadrao.FieldByName('codigo').AsInteger;
qryPermissoes.Open;
FCodigoPermissoes := qryPermissoes.FieldByName('codigo').AsInteger;
cbxUsuario.Checked := qryPermissoes.FieldByName('acesso_usuario').AsBoolean;
cbxAutor.Checked := qryPermissoes.FieldByName('acesso_autor').AsBoolean;
cbxEmprestimo.Checked := qryPermissoes.FieldByName('acesso_emprestimo').AsBoolean;
cbxEditora.Checked := qryPermissoes.FieldByName('acesso_editora').AsBoolean;
cbxLivro.Checked := qryPermissoes.FieldByName('acesso_livro').AsBoolean;
cbxPermissoes.Checked := qryPermissoes.FieldByName('acesso_permissoes').AsBoolean;
end;
function TfrUsuario.ExcluirRegistro: Boolean;
begin
FUsuarioController.ExcluirRegistroPermissoes(qryPadrao.FieldByName('CODIGO').AsInteger);
FUsuarioController.frMain := frMain;
FUsuarioController.ExcluirRegistro(qryPadrao.FieldByName('CODIGO').AsInteger);
end;
procedure TfrUsuario.FormCreate(Sender: TObject);
begin
inherited;
FUsuarioController := TUsuarioController.Create;
end;
procedure TfrUsuario.FormDestroy(Sender: TObject);
begin
inherited;
FreeAndNil(FUsuarioController);
end;
procedure TfrUsuario.FormShow(Sender: TObject);
begin
inherited;
PesquisarRegistros();
end;
function TfrUsuario.GravaRegistoPermissoes(LCodigoUsuario: Integer): Boolean;
var LPermissoes: TPermissoesModel;
LUsuario: TUsuarioModel;
begin
LPermissoes := TPermissoesModel.Create;
LUsuario := TUsuarioModel.Create(LCodigoUsuario);
try
LPermissoes.Codigo := FCodigoPermissoes;
LPermissoes.Usuario := LUsuario;
LPermissoes.AcessoUsuario := cbxUsuario.Checked;
LPermissoes.AcessoAutor := cbxAutor.Checked;
LPermissoes.AcessoEditora := cbxEditora.Checked;
LPermissoes.AcessoLivro := cbxLivro.Checked;
LPermissoes.AcessoEmprestimo := cbxEmprestimo.Checked;
LPermissoes.AcessoPermissoes := cbxPermissoes.Checked;
Result := FUsuarioController.GravarRegistroPermissoes(LPermissoes);
finally
FreeAndNil(LPermissoes);
end;
end;
function TfrUsuario.GravaRegistoUsuario: Boolean;
var LUsuario: TUsuarioModel;
LCodigo: Integer;
begin
LUsuario := TUsuarioModel.Create;
try
LUsuario.Codigo := StrToIntDef(edtCodigo.Text,0);
LUsuario.Nome := edtNome.Text;
LUsuario.CPF := edtCPF.Text;
LUsuario.Senha := edtSenha.Text;
LUsuario.Celular := edtCelular.Text;
FUsuarioController.frMain := frMain;
LCodigo := FUsuarioController.GravarRegistro(LUsuario);
Result := LCodigo > 0;
GravaRegistoPermissoes(LCodigo);
finally
FreeAndNil(LUsuario);
end;
end;
function TfrUsuario.GravarRegistro: Boolean;
var LUsuario: TUsuarioModel;
begin
if not ValidaCampos() then
Exit;
if not GravaRegistoUsuario() then
Exit;
LimpaCampos();
ShowMessage('Registro incluído com sucesso.');
end;
procedure TfrUsuario.IncluirRegistro;
begin
LimpaCampos();
end;
procedure TfrUsuario.LimpaCampos;
begin
edtCodigo.Text := '';
edtNome.Text := '';
edtCPF.Text := '';
edtSenha.Text := '';
edtCelular.Text := '';
FCodigoPermissoes := 0;
cbxUsuario.Checked := false;
cbxAutor.Checked := false;
cbxEmprestimo.Checked := false;
cbxEditora.Checked := false;
cbxLivro.Checked := false;
cbxPermissoes.Checked := false;
end;
procedure TfrUsuario.PesquisarRegistros;
var LSQL: String;
LPesquisaComFiltro: Boolean;
begin
LSQL :=
'SELECT * FROM USUARIO ';
LPesquisaComFiltro := Trim(edtPesquisar.Text) <> '';
if LPesquisaComFiltro then
LSQL := LSQL + 'WHERE UPPER(NOME) LIKE UPPER(:nome)';
if qryPadrao.Active then
qryPadrao.Close;
qryPadrao.SQL.Text := LSQL;
if LPesquisaComFiltro then
qryPadrao.ParamByName('nome').AsString := '%' + edtPesquisar.Text + '%';
qryPadrao.Open;
qryPadrao.FieldByName('senha').Visible := false;
qryPadrao.FieldByName('administrador').Visible := false;
end;
function TfrUsuario.ValidaCampos: Boolean;
var LCamposPreechidos: Boolean;
begin
LCamposPreechidos :=
(Trim(edtNome.Text) <> '') and
(Trim(edtCPF.Text) <> '') and
(Trim(edtSenha.Text) <> '');
if not (Trim(edtNome.Text) <> '') then
ShowMessage('Preencha o campo nome');
if not (Trim(edtCPF.Text) <> '') then
ShowMessage('Preencha o campo CPF');
if not (Trim(edtSenha.Text) <> '') then
ShowMessage('Preencha o campo senha');
Result := LCamposPreechidos;
end;
end.
|
unit DSA.Tree.AVLTreeMap;
{$mode objfpc}{$H+}
interface
uses
Classes,
SysUtils,
DSA.Interfaces.DataStructure,
DSA.List_Stack_Queue.ArrayList,
DSA.Tree.AVLTree;
type
{ TAVLTreeMap }
generic TAVLTreeMap<K, V, TKeyCmp> = class(TInterfacedObject,
specialize IMap<K, V>)
private
type
TAVLTree_K_V = specialize TAVLTree<K, V, TKeyCmp>;
TPtrV = specialize TPtr_V<V>;
TArrayList_K = specialize TArrayList<K>;
var
__alt: TAVLTree_K_V;
public
constructor Create;
destructor Destroy; override;
function Contains(key: K): boolean;
function Get(key: K): TPtrV;
function GetSize: integer;
function IsEmpty: boolean;
function Remove(key: K): TPtrV;
procedure Add(key: K; Value: V);
procedure Set_(key: K; newValue: V);
function KeySets: TArrayList_K;
end;
implementation
{ TAVLTreeMap }
constructor TAVLTreeMap.Create;
begin
__alt := TAVLTree_K_V.Create();
end;
procedure TAVLTreeMap.Add(key: K; Value: V);
begin
__alt.Add(Key, Value);
end;
function TAVLTreeMap.Contains(key: K): boolean;
begin
Result := __alt.Contains(key);
end;
destructor TAVLTreeMap.Destroy;
begin
FreeAndNil(__alt);
inherited Destroy;
end;
function TAVLTreeMap.Get(key: K): TPtrV;
begin
Result := __alt.Get(Key);
end;
function TAVLTreeMap.GetSize: integer;
begin
Result := __alt.GetSize;
end;
function TAVLTreeMap.IsEmpty: boolean;
begin
Result := __alt.IsEmpty;
end;
function TAVLTreeMap.KeySets: TArrayList_K;
begin
Result := __alt.KeySets;
end;
function TAVLTreeMap.Remove(key: K): TPtrV;
begin
Result := __alt.Remove(Key);
end;
procedure TAVLTreeMap.Set_(key: K; newValue: V);
begin
__alt.Set_(Key, newValue);
end;
end.
|
unit SDL2_SimpleGUI_Console;
{:< The console object and its supporting types
- NOT IMPLEMENTED YET IN SimpleGUI -
}
{
Simple GUI is based upon Lachlans GUI (LK GUI). LK GUI's original source code
remark is shown below.
Written permission to re-license the library has been granted to me by the
original author.
}
{*******************************************************}
{ }
{ SDL Console Library for LK_GUI }
{ Pretty much written for RL development }
{ but could be used for other TUIs }
{ }
{ Copyright (c) 2009-10 Lachlan Kingsford }
{ }
{*******************************************************}
{
Simple GUI
**********
Copyright (c) 2016 Matthias J. Molski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
}
interface
uses SDL2, SDL2_TTF, SDL2_SimpleGUI_Canvas, SDL2_SimpleGUI_Base, SDL_Tools;
const
{$WARNINGS OFF}
Color_Black: TSDL_Color = (R: 0; G: 0; B: 0);
Color_Blue: TSDL_Color = (R: 0; G: 0; B: 170);
Color_Green: TSDL_Color = (R: 0; G: 170; B: 0);
Color_Cyan: TSDL_Color = (R: 0; G: 170; B: 170);
Color_Red: TSDL_Color = (R: 170; G: 0; B: 0);
Color_Magenta: TSDL_Color = (R: 170; G: 0; B: 170);
Color_Brown: TSDL_Color = (R: 170; G: 85; B: 0);
Color_LI_White: TSDL_Color = (R: 170; G: 170; B: 170);
Color_Gray: TSDL_Color = (R: 85; G: 85; B: 85);
Color_LightBlue: TSDL_Color = (R: 85; G: 85; B: 255);
Color_LighGreen: TSDL_Color = (R: 85; G: 255; B: 85);
Color_LighCyan: TSDL_Color = (R: 85; G: 255; B: 255);
Color_LightRed: TSDL_Color = (R: 255; G: 85; B: 85);
Color_LightMagenta: TSDL_Color = (R: 255; G: 85; B: 255);
Color_LightBrown: TSDL_Color = (R: 255; G: 170; B: 85);
Color_White: TSDL_Color = (R: 255; G: 255; B: 255);
{$WARNINGS ON}
type
(*
pXYWord = ^tXYWord;
tXYWord = record
X, Y: Word;
end;
pVideoCell = ^tVideoCell;
tVideoCell = record
Character: Word;
fore: TSDL_Color;
back: TSDL_Color;
transback: Boolean;
end;
pVidArray = ^tVidArray;
tVidArray = array [0..32767] of tVideoCell;
PGUI_Console = ^TGUI_Console;
TGUI_Console = object(TGUI_Canvas)
public
Display: tVidArray;
AARender: Boolean;
constructor Init_Console;
destructor Done_Console;
function GetCursor: tXYWord;
procedure SetCursor(X, Y: Word);
function GetTransBackDefault: Boolean;
procedure SetTransBackDefault(NewDefault: Boolean);
function GetConsoleSize: tXYWord;
procedure SetConsoleSize(X, Y: Word);
procedure SetConsoleSize(Size: tXYWord);
procedure SetForeColor(NewSDLColor: TSDL_Color);
procedure SetBackColor(NewSDLColor: TSDL_Color);
procedure Render; virtual;
procedure ClearScr;
function GetRef(X, Y: Word): Word; inline;
procedure Write(InStr: string);
protected
Cursor: tXYWord;
Dimensions: tXYWord;
TransBackDefault: Boolean;
end;
*)
implementation
(*
constructor TGUI_Console.Init_Console;
begin
inherited Init_Canvas;
SetConsoleSize(80, 25);
SetCursor(0, 0);
SetForeColor(Color_Li_White);
SetBackColor(Color_Black);
SetTransBackDefault(True);
SetFillStyle(FS_None);
ClearScr;
end;
destructor TGUI_Console.Done_Console;
begin
inherited Done_Canvas;
end;
//Accessors for Cursor Functions
function TGUI_Console.GetCursor: tXYWord;
begin
GetCursor.X := Cursor.X;
GetCursor.Y := Cursor.Y;
end;
procedure TGUI_Console.SetCursor(X, Y: Word);
begin
Cursor.X := X;
Cursor.Y := Y;
end;
function TGUI_Console.GetTransBackDefault: Boolean;
begin
GetTransBackDefault := TransBackDefault;
end;
procedure TGUI_Console.SetTransBackDefault(NewDefault: Boolean);
begin
TransBackDefault := NewDefault;
end;
//Accessors for Console Size
//(TODO) - Console Size's should rearrange the display
function TGUI_Console.GetConsoleSize: tXYWord;
begin
GetConsoleSize := Dimensions;
end;
procedure TGUI_Console.SetConsoleSize(X, Y: Word);
begin
Dimensions.X := X;
Dimensions.Y := Y;
end;
procedure TGUI_Console.SetConsoleSize(Size: tXYWord);
begin
Dimensions := Size;
end;
function TGUI_Console.GetRef(X, Y: Word): Word; inline;
begin
GetRef := X + Y * Dimensions.X;
end;
procedure TGUI_Console.SetForeColor(NewSDLColor: TSDL_Color);
begin
ForeColor.R := NewSDLColor.R;
ForeColor.G := NewSDLColor.G;
ForeColor.B := NewSDLColor.B;
end;
procedure TGUI_Console.SetBackColor(NewSDLColor: TSDL_Color);
begin
BackColor.R := NewSDLColor.R;
BackColor.G := NewSDLColor.G;
BackColor.B := NewSDLColor.B;
end;
//Writes a line of text
procedure TGUI_Console.Write(InStr: string);
var
i: Word;
begin
for i := 1 to length(InStr) do
with display[GetRef(Cursor.X + i - 1, Cursor.Y)] do
begin
Character := Word(InStr[i]);
Fore.r := ForeColor.r;
Fore.g := ForeColor.g;
Fore.b := ForeColor.b;
Back.r := BackColor.r;
Back.g := BackColor.g;
Back.b := BackColor.b;
TransBack := TransBackDefault;
end;
end;
//Draws the console to the surface
procedure TGUI_Console.Render;
var
CurX, CurY, FWidth: LongInt;
MinX, MaxX, MinY, MaxY, d: LongInt;
curglyph: pSDL_Surface;
Loc: SDL_Rect;
begin
inherited Render;
if font <> nil then
begin
TTF_GlyphMetrics(Font, Word('w'), MinX, FWidth, MinY, MaxY, d);
for CurX := 0 to (Dimensions.x - 1) do
begin
for CurY := 0 to (Dimensions.y) do
with Display[GetRef(CurX, CurY)] do
begin
//CurGlyph := TTF_RenderGlyph_Solid(font, Character, fore);
if not (transback) then
CurGlyph := TTF_RenderGlyph_Shaded(font, Character, fore, back)
else
CurGlyph := TTF_RenderGlyph_Blended(font, Character, fore);
TTF_GlyphMetrics(Font, Character, MinX, MaxX, MinY, MaxY, d);
loc.x := CurX * FWidth;
loc.y := (CurY * FontHeight) - MaxY + FontAscent;
//SDL_BlitSurface(CurGlyph, nil, Surface, @Loc);
if FillStyle = FS_None then
begin
SDL_SetAlpha(CurGlyph, 0, surface^.format^.alpha);
SDL_BlitSurface(CurGlyph, nil, Surface, @Loc);
SDL_SetAlpha(CurGlyph, SDL_SRCALPHA, surface^.format^.alpha);
end
else
begin
SDL_BlitSurface(CurGlyph, nil, Surface, @Loc);
end;
SDL_freesurface(CurGlyph);
end;
end;
if GetSelected then
begin
drawline(Cursor.X * Fwidth, (Cursor.Y * FontHeight) - MaxY + FontAscent,
(Cursor.X + 1) * Fwidth, (Cursor.Y * FontHeight) - MaxY + FontAscent, surface,
ForeColor.r, ForeColor.G, ForeColor.B);
end;
end;
end;
//Clears every character
procedure TGUI_Console.ClearScr;
var
i: Word;
begin
for i := 0 to high(Display) do
with display[i] do
begin
character := $20;
fore.r := forecolor.r;
fore.g := forecolor.g;
fore.b := forecolor.b;
back.r := backcolor.r;
back.g := backcolor.g;
back.b := backcolor.b;
transback := transbackdefault;
end;
end;
*)
begin
end.
|
unit QR_ISO88592;
// ISO 8859-2 (Latin 2) encoder class for TDelphiZXingQRCode
interface
uses
DelphiZXIngQRCode;
const
ENCODING_ISO88592 = 8;
type
TIso88592Encoder = class(TEncoder)
protected
function FilterContent(const Content: WideString; Mode: TMode;
EncodeOptions: Integer): WideString; override;
procedure AppendBytes(const Content: WideString; Mode: TMode;
Bits: TBitArray; EncodeOptions: Integer); override;
end;
implementation
uses
Windows;
function TIso88592Encoder.FilterContent(const Content: WideString; Mode: TMode;
EncodeOptions: Integer): WideString;
var
X: Integer;
CanAdd: Boolean;
function Is88592Char(Char: WideChar): Boolean;
begin
Result := TRUE;
// just let anything through for now
// any invalid chars will be replaced with question marks by cWideCharToMultiByte which
// will make our string safe for QR
// to-do?: do a proper ISO-8859-2 test anyway, as it appears that this library prefers
// removing invalid chars from string as opposed to replacing them with '?'
end;
begin
if EncodeOptions = ENCODING_ISO88592
then
begin
Result := '';
for X := 1 to Length(Content) do
begin
CanAdd := Is88592Char(Content[X]);
if CanAdd then
Result := Result + Content[X];
end;
end
else
Result := inherited FilterContent(Content, Mode, EncodeOptions)
end;
procedure TIso88592Encoder.AppendBytes(const Content: WideString; Mode: TMode;
Bits: TBitArray; EncodeOptions: Integer);
var
I, X: Integer;
Bytes: TByteArray;
begin
if EncodeOptions = ENCODING_ISO88592
then
begin
{$WARNINGS OFF} // I hate these "Unsafe code @ operator" warnings but I never
// turn them off completely. Sometimes they are really useful
X := WideCharToMultiByte(28592{iso-8859-2}, WC_COMPOSITECHECK or WC_DISCARDNS or
WC_SEPCHARS or WC_DEFAULTCHAR, @Content[1], -1, nil, 0, nil, nil);
SetLength(Bytes, X - 1);
if X > 1 then
WideCharToMultiByte(28592{iso-8859-2}, WC_COMPOSITECHECK or WC_DISCARDNS or
WC_SEPCHARS or WC_DEFAULTCHAR, @Content[1], -1, @Bytes[0], X - 1, nil,
nil);
{$WARNINGS ON}
for I := 0 to Length(Bytes) - 1 do
Bits.AppendBits(Bytes[I], 8);
end
else
inherited AppendBytes(Content, Mode, Bits, EncodeOptions);
end;
end.
|
// --------------------------------------------------------
// converted from Select C++ header file (source)
// 1/3/03 3:56:54 PM
// --------------------------------------------------------
//===========================================================================
//
// NAME: pd_dsp_es.h
//
// DESCRIPTION: PowerDAQ DLL Low-Level Driver
// Interface functions. File handle
//
// NOTES: This is ESSI port register definitions
//
// AUTHOR: dk
//
// DATE: 01-JUN-2001
//
// HISTORY:
//
// Rev 0.1, 01-JUN-2001, dk, Initial version.
//
//---------------------------------------------------------------------------
//
// Copyright (C) 2001 United Electronic Industries, Inc.
// All rights reserved.
// United Electronic Industries Confidential Information.
//
//===========================================================================
//
// General Information
//
// Using of ESSI port require proper initialization procedure.
// Generally at least two control registers, CRA and CRB need to be defined.
// Also generally port C(ESSI0)/D(ESSI1) control/direction/GPIO registers
// should be set before outputting any data.
// See Motorola DSP56301 User Manual for the details about ESSI programming
// Manual is available for download from http:\\www.mot.com
//
// PD2-DIO ESSI Support
//
// General Information
//
// PowerDAQ DIO board has two Enhanced Synchronous Serial Interface (ESSI).
// The ESSI provides a full-duplex serial port for communicating with a variety of
// serial devices. The ESSI comprises independent transmitter and receiver sections
// and a common ESSI clock generator. Three transmit shift registers enable it to
// transmit from three different pins simultaneously.
//
// Please refer to the Motorola DSP56301 User Manual for the details
//
//
//
//---------------------------------------------------------------------------
//
// DSP EQUATES for I/O Port Programming
//
//------------------------------------------------------------------------
unit pd_dsp_es;
interface
{$IFDEF FPC} {$mode delphi} {$DEFINE AcqElphy2} {$A1} {$Z1} {$ENDIF}
const
M_PCRC = $FFFFBF;// Port C Control Register
M_PRRC = $FFFFBE;// Port C Direction Register
M_PDRC = $FFFFBD;// Port C GPIO Data Register
M_PCRC0 = $2F;
M_PRRC0 = $2F;
M_PDRC0 = $2F;
const
M_PCRD = $FFFFAF;// Port D Control Register
M_PRRD = $FFFFAE;// Port D Direction Register
M_PDRD = $FFFFAD;// Port D GPIO Data Register
M_PCRD0 = $2F;
M_PRRD0 = $2F;
M_PDRD0 = $2F;
//------------------------------------------------------------------------
//
// EQUATES for Enhanced Synchronous Serial Interface (ESSI)
//
//------------------------------------------------------------------------
// Register Addresses Of ESSI0
const
M_TX00 = $FFFFBC;// ESSI0 Transmit Data Register 0
M_TX01 = $FFFFBB;// ESSIO Transmit Data Register 1
M_TX02 = $FFFFBA;// ESSIO Transmit Data Register 2
M_TSR0 = $FFFFB9;// ESSI0 Time Slot Register
M_RX0 = $FFFFB8;// ESSI0 Receive Data Register
M_SSISR0 = $FFFFB7;// ESSI0 Status Register
M_CRB0 = $FFFFB6;// ESSI0 Control Register B
M_CRA0 = $FFFFB5;// ESSI0 Control Register A
M_TSMA0 = $FFFFB4;// ESSI0 Transmit Slot Mask Register A
M_TSMB0 = $FFFFB3;// ESSI0 Transmit Slot Mask Register B
M_RSMA0 = $FFFFB2;// ESSI0 Receive Slot Mask Register A
M_RSMB0 = $FFFFB1;// ESSI0 Receive Slot Mask Register B
// Register Addresses Of ESSI1
const
M_TX10 = $FFFFAC;// ESSI1 Transmit Data Register 0
M_TX11 = $FFFFAB;// ESSI1 Transmit Data Register 1
M_TX12 = $FFFFAA;// ESSI1 Transmit Data Register 2
M_TSR1 = $FFFFA9;// ESSI1 Time Slot Register
M_RX1 = $FFFFA8;// ESSI1 Receive Data Register
M_SSISR1 = $FFFFA7;// ESSI1 Status Register
M_CRB1 = $FFFFA6;// ESSI1 Control Register B
M_CRA1 = $FFFFA5;// ESSI1 Control Register A
M_TSMA1 = $FFFFA4;// ESSI1 Transmit Slot Mask Register A
M_TSMB1 = $FFFFA3;// ESSI1 Transmit Slot Mask Register B
M_RSMA1 = $FFFFA2;// ESSI1 Receive Slot Mask Register A
M_RSMB1 = $FFFFA1;// ESSI1 Receive Slot Mask Register B
// ESSI Control Register A Bit Flags
const
M_PM = $FF; // Prescale Modulus Select Mask (PM0-PM7)
M_PM0 = 0;
M_PSR = 11; // Prescaler Range
M_DC = $1F000; // Frame Rate Divider Control Mask (DC0-DC7)
M_DC0 = 12;
M_ALC = 18; // Alignment Control (ALC)
M_WL = $380000; // Word Length Control Mask (WL0-WL7)
M_WL0 = 19;
M_SSC1 = 22; // Select SC1 as TR #0 drive enable (SSC1)
// ESSI Control Register B Bit Flags
const
M_OF = $3;// Serial Output Flag Mask
M_OF0 = 0;// Serial Output Flag 0
M_OF1 = 1;// Serial Output Flag 1
M_SCD = $1C;// Serial Control Direction Mask
M_SCD0 = 2;// Serial Control 0 Direction
M_SCD1 = 3;// Serial Control 1 Direction
M_SCD2 = 4;// Serial Control 2 Direction
M_SCKD = 5;// Clock Source Direction
M_SHFD = 6;// Shift Direction
M_FSL = $180;// Frame Sync Length Mask (FSL0-FSL1)
M_FSL0 = 7;// Frame Sync Length 0
M_FSL1 = 8;// Frame Sync Length 1
M_FSR = 9;// Frame Sync Relative Timing
M_FSP = 10;// Frame Sync Polarity
M_CKP = 11;// Clock Polarity
M_SYN = 12;// Sync/Async Control
M_MOD = 13;// ESSI Mode Select
M_SSTE = $1C000;// ESSI Transmit enable Mask
M_SSTE2 = 14;// ESSI Transmit #2 Enable
M_SSTE1 = 15;// ESSI Transmit #1 Enable
M_SSTE0 = 16;// ESSI Transmit #0 Enable
M_SSRE = 17;// ESSI Receive Enable
M_SSTIE = 18;// ESSI Transmit Interrupt Enable
M_SSRIE = 19;// ESSI Receive Interrupt Enable
M_STLIE = 20;// ESSI Transmit Last Slot Interrupt Enable
M_SRLIE = 21;// ESSI Receive Last Slot Interrupt Enable
M_STEIE = 22;// ESSI Transmit Error Interrupt Enable
M_SREIE = 23;// ESSI Receive Error Interrupt Enable
// ESSI Status Register Bit Flags
const
M_IF = $3;// Serial Input Flag Mask
M_IF0 = 0;// Serial Input Flag 0
M_IF1 = 1;// Serial Input Flag 1
M_TFS = 2;// Transmit Frame Sync Flag
M_RFS = 3;// Receive Frame Sync Flag
M_TUE = 4;// Transmitter Underrun Error FLag
M_ROE = 5;// Receiver Overrun Error Flag
M_TDE = 6;// Transmit Data Register Empty
M_RDF = 7;// Receive Data Register Full
// ESSI Transmit Slot Mask Register A
const
M_SSTSA = $FFFF;// ESSI Transmit Slot Bits Mask A (TS0-TS15)
// ESSI Transmit Slot Mask Register B
const
M_SSTSB = $FFFF;// ESSI Transmit Slot Bits Mask B (TS16-TS31)
// ESSI Receive Slot Mask Register A
const
M_SSRSA = $FFFF;// ESSI Receive Slot Bits Mask A (RS0-RS15)
// ESSI Receive Slot Mask Register B
const
M_SSRSB = $FFFF;// ESSI Receive Slot Bits Mask B (RS16-RS31)
// Word Length Control Mask. CRA[21:19]
const
M_WL_MASK0 = $00000000;
M_WL_MASK1 = $00080000;
M_WL_MASK2 = $00100000;
M_WL_MASK3 = $00180000;
implementation
begin
end.
|
(*
Category: SWAG Title: MATH ROUTINES
Original name: 0024.PAS
Description: Factoring Program
Author: LOU DUCHEZ
Date: 08-27-93 21:17
*)
{LOU DUCHEZ
> Could anybody explain how to Write such a routine in Pascal?
Here's a dorky little "Factoring" Program I wrote to display the factors
of a number:
}
Program factors;
Var
lin,
lcnt : LongInt;
begin
Write('Enter number to factor: ');
readln(lin);
lcnt := 2;
While lcnt * lcnt <= lin do
begin
if lin mod lcnt = 0 then
Writeln('Factors:', lcnt : 9, (lin div lcnt) : 9);
lcnt := lcnt + 1;
end;
end.
{
Notice that I only check For factors up to the square root of the number
Typed in. Also, notice the "mod" operator: gives the remainder of Integer
division ("div" gives the Integer result of division).
Not Really knowing exactly what you want to accomplish, I don't Really know
if the above is of much help. But what the hey.
}
|
unit servidor;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ScktComp, StdCtrls, ExtCtrls;
type
TfrmServidor = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Memo2: TMemo;
ListBox1: TListBox;
Splitter1: TSplitter;
Panel3: TPanel;
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Label2: TLabel;
Panel4: TPanel;
ServerSocket1: TServerSocket;
procedure ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
procedure ServerSocket1ClientConnect(Sender: TObject;
Socket: TCustomWinSocket);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
procedure EnviarMsgBroadcast(msg: String);
public
{ Public declarations }
end;
var
frmServidor: TfrmServidor;
implementation
{$R *.DFM}
// Esta rotina é responsável por traduzir uma mensagem enviada ou recebida. Para isso elimina o
// identificador da mensagem, comando, (ADDNICK, DELNICK ou MSG) e retorna o restante
// do string em mensagem
function RecConteudoMsg(comando, mensagem: String): String;
var
p: Integer;
begin
p:= Pos(comando, mensagem);
if p > 0 then
Result:= Copy(mensagem, p + Length(comando), Length(mensagem));
end;
// Esta rotina é responsável por enviar uma determinada mensagem para
// todos os clientes conectados
procedure TfrmServidor.EnviarMsgBroadcast(msg: String);
var i: Integer;
begin
try
for i:= 0 to ServerSocket1.Socket.ActiveConnections - 1 do
ServerSocket1.Socket.Connections[i].SendText(msg);
except
Beep;
end;
end;
procedure TfrmServidor.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var
buff: String;
begin
// Recupera a mensagem do buffer do socket
buff:= Socket.ReceiveText;
// Coloca o usuário recém-conectado da lista
If Pos('ADDNICK=', buff) > 0 then
begin
Listbox1.Items.Add(RecConteudoMsg('ADDNICK=', buff));
Memo2.Lines.Add('<' + RecConteudoMsg('ADDNICK=', buff) + '>entrou na sala.');
// Avisa a todos os clientes conectados
EnviarMsgBroadcast('MSG=<' + RecConteudoMsg('ADDNICK=', buff) + '>entrou na sala.');
end;
// Retira o usuário conectado da lista
If Pos('DELNICK=', buff) > 0 then
begin
// Exclui o elemento da lista de usuários conectados
Listbox1.Items.Delete(Listbox1.Items.IndexOf(RecConteudoMsg('DELNICK=', buff)));
// Apresenta mensagem de abandono da sala
Memo2.Lines.Add('<' + RecConteudoMsg('DELNICK=', buff) + '>deixou a sala.');
// Espera enquanto o socket ainda estiver ativo (essa espera
// evita que se trabalhe com objetos desatualizados)
while Socket.Connected do
Application.ProcessMessages;
// Apresenta o número de clientes conectados (opcionalmente
// poderia ficar no evento OnClientDisconnect)
Label2.Caption:= IntToStr(ServerSocket1.Socket.ActiveConnections);
// Avisa a todos os clientes conectados
EnviarMsgBroadcast('MSG=<' + RecConteudoMsg('DELNICK=', buff) + '>deixou a sala.');
end;
// Coloca a nova mensagem na lista de mensagem e posta para todos os clientes uma cópia para que
// atualizem suas listas locais
If Pos('MSG=', buff) > 0 then
begin
Memo2.Lines.Add(RecConteudoMsg('MSG=', buff));
// Avisa a todos os clientes conectados
EnviarMsgBroadcast(buff);
end;
end;
// Apresenta o número de clientes conectados
procedure TfrmServidor.ServerSocket1ClientConnect(Sender: TObject;
Socket: TCustomWinSocket);
begin
Label2.Caption:= IntToStr(ServerSocket1.Socket.ActiveConnections);
end;
procedure TfrmServidor.Button1Click(Sender: TObject);
begin
// Elimina o usuário conectado da sala
If Listbox1.ItemIndex > -1 then
Listbox1.Items.Delete(Listbox1.ItemIndex);
end;
procedure TfrmServidor.Button2Click(Sender: TObject);
begin
// Checa se o estado do botão é desligar ou religar
if Button2.Caption = 'Desligar' then
begin
// Avisa a todos os clientes conectados
EnviarMsgBroadcast('Servidor desligado !');
Listbox1.Items.Clear;
Memo2.Lines.Clear;
ServerSocket1.Close;
Label2.Caption:= '0';
Button2.Caption:= 'Religar';
end
else
begin
// Coloca o servidor no estado de espera de
// conexões
ServerSocket1.Open;
Button2.Caption:= 'Desligar';
end;
end;
procedure TfrmServidor.FormShow(Sender: TObject);
begin
// Coloca o servidor no estado de espera de conexões
ServerSocket1.Open;
end;
end.
|
unit uAAText;
interface
uses
Graphics, sysutils, classes, IntfGraphics;
const
MAX_NUM_SUPERSAMPLING = 2;
procedure DrawAAText(Dest: TBitmap; DX, DY: Integer; Text: String);
implementation
type
TRGBTriple = record
rgbtRed, rgbtGreen, rgbtBlue : Byte;
end;
pRGBLine = ^TRGBLine;
TRGBLine = Array[Word] of TRGBTriple;
{Separate R, G and B values from the color}
procedure SeparateColor(Color: TColor; var r: Byte; var g: byte; var b: byte);
begin
R := Color and $FF0000 shr 16;
G := Color and $00FF00 shr 8;
B := Color and $0000FF;
end;
procedure DrawAAText(Dest: TBitmap; DX, DY: Integer; Text: String);
var
TempBitmap: TBitmap;
x, y : Integer;
totr,
totg,
totb : Integer;
j, i, l : Integer;
Line : pRGBLine;
TempLine : Array[0..MAX_NUM_SUPERSAMPLING - 1] of pRGBLine;
lazDest,lazTempBitmap : TLazIntfImage;
begin
{Creates a temporary bitmap do work with supersampling}
TempBitmap := TBitmap.Create;
with TempBitmap do
begin
PixelFormat := pf24bit;
{Copy attributes from previous bitmap}
Canvas.Font.Assign(Dest.Canvas.Font);
Canvas.Brush.Assign(Dest.Canvas.Brush);
Canvas.Pen.Assign(Dest.Canvas.Pen);
Canvas.Font.Size := Canvas.Font.Size * MAX_NUM_SUPERSAMPLING;
{Make it twice larger to apply supersampling later}
Width := Canvas.TextWidth(Text);
Height := Canvas.TextHeight(Text);
{To prevent unexpected junk}
if (Width div MAX_NUM_SUPERSAMPLING) + DX > Dest.Width then
Width := (Dest.Width - DX) * MAX_NUM_SUPERSAMPLING;
if (Height div MAX_NUM_SUPERSAMPLING) + DY > Dest.Height then
Height := (Dest.Height - DY) * MAX_NUM_SUPERSAMPLING;
{If the brush style is clear, then copy the image from the}
{previous image to create the propher effect}
if Canvas.Brush.Style = bsClear then
begin
Canvas.Draw(-DX, -DY, Dest);
Canvas.Stretchdraw(Rect(0, 0, Width * MAX_NUM_SUPERSAMPLING, Height * MAX_NUM_SUPERSAMPLING), TempBitmap);
end;
{Draws the text using double size}
Canvas.TextOut(0, 0, Text);
end;
{Draws the antialiased image}
lazDest:=dest.CreateIntfImage;
lazTempBitmap:=TempBitmap.CreateIntfImage;
for y := 0 to ((TempBitmap.Height) div MAX_NUM_SUPERSAMPLING) - 1 do begin
{If the y pixel is outside the clipping region, do the proper action}
if dy + y < 0 then
Continue
else if Dy + y > Dest.Height - 1 then
Break;
{Scanline for faster access}
Line := lazDest.GetDataLineStart(DY + y);
for l := 0 to MAX_NUM_SUPERSAMPLING - 1 do
TempLine[l] := lazTempBitmap.GetDataLineStart((MAX_NUM_SUPERSAMPLING*y) + l);
for x := 0 to ((TempBitmap.Width) div MAX_NUM_SUPERSAMPLING) - 1 do begin
{If the x pixel is outside the clipping region, do the proper
action}
if dx + x < 0 then
Continue
else if Dx + x > Dest.Width - 1 then
Break;
{Compute the value of the output pixel (x, y) }
TotR := 0;
TotG := 0;
TotB := 0;
for j := 0 to MAX_NUM_SUPERSAMPLING - 1 do begin
for i := 0 to MAX_NUM_SUPERSAMPLING - 1 do
begin
(*
inc(TotR, TempLine[j][MAX_NUM_SUPERSAMPLING*x+i] .rgbtRed);
inc(TotG, TempLine[j][MAX_NUM_SUPERSAMPLING*x+i].rgbtGreen);
inc(TotB, TempLine[j][MAX_NUM_SUPERSAMPLING*x+i].rgbtBlue);
*)
end;
end;
{Set the pixel values thru scanline}
with Line^[DX + x] do
begin
rgbtRed := TotR div (MAX_NUM_SUPERSAMPLING*MAX_NUM_SUPERSAMPLING);
rgbtGreen := TotG div (MAX_NUM_SUPERSAMPLING*MAX_NUM_SUPERSAMPLING);
rgbtBlue := TotB div (MAX_NUM_SUPERSAMPLING*MAX_NUM_SUPERSAMPLING);
end;
end;
end;
dest.LoadFromIntfImage(lazDest);
{Free the temporary bitmap}
lazdest.free;
lazTempBitmap.free;
TempBitmap.Free;
end;
end.
|
unit uClassDBDataSet;
interface
uses uClassDBConnection, Data.SqlExpr, Datasnap.Provider, Datasnap.DBClient,
Data.DB, System.Generics.Collections, uClassDBToJson;
type
TBaseDBDataSet = Class
private
sqlConn : TBaseDBConnection;
sqlBase : TSQLDataSet;
dspBase : TDataSetProvider;
cdsBase : TClientDataSet;
dsBase : TDataSource;
sJson : TBaseDBToJson;
FCommandText: String;
FActivated: boolean;
FDataSource: TDataSource;
FDictParams : TDictionary<String, String>;
FDataJson: String;
procedure SetCommandText(const Value: String);
procedure SetActivated(const Value: boolean);
procedure SetDataSource(const Value: TDataSource);
function LoadData(value : TDataSet) : String ;
procedure SetDataJson(const Value: String);
public
constructor Create;
destructor Destroy;
property CommandText : String read FCommandText write SetCommandText;
property Activated : boolean read FActivated write SetActivated;
property DataSource : TDataSource read FDataSource write SetDataSource;
property DataJson : String read FDataJson write SetDataJson;
procedure ParamByName(name : string; value : variant);
End;
implementation
uses
System.SysUtils;
{ TBaseDBDataSet }
constructor TBaseDBDataSet.Create;
procedure createComponents;
begin
sqlConn := TBaseDBConnection.getInstance;
sqlBase := TSQLDataSet.Create(nil);
dspBase := TDataSetProvider.Create(nil);
cdsBase := TClientDataSet.Create(Nil);
dsBase := TDataSource.Create(Nil);
end;
procedure setPropertys;
begin
sqlBase.SQLConnection := sqlConn.Connection;
dspBase.DataSet := sqlBase;
dspBase.Options := [poAllowCommandText];
cdsBase.SetProvider(dspBase);
dsBase.DataSet := cdsBase;
SetDataSource(dsBase);
end;
begin
createComponents;
setPropertys;
end;
destructor TBaseDBDataSet.Destroy;
begin
FreeAndNil(sqlConn);
FreeAndNil(sqlBase);
FreeAndNil(dspBase);
FreeAndNil(cdsBase);
FreeAndNil(dsBase);
end;
function TBaseDBDataSet.LoadData(value: TDataSet): String;
begin
sJson := TBaseDBToJson.Create;
result := sJson.convert(value);
end;
procedure TBaseDBDataSet.ParamByName(name : string; value : variant);
begin
cdsbase.ParamByName(name).Value := value;
end;
procedure TBaseDBDataSet.SetActivated(const Value: boolean);
begin
FActivated := Value;
cdsBase.Active := FActivated;
SetDataJson(LoadData(cdsBase));
end;
procedure TBaseDBDataSet.SetCommandText(const Value: String);
begin
FCommandText := Value;
cdsBase.CommandText := FCommandText;
end;
procedure TBaseDBDataSet.SetDataJson(const Value: String);
begin
FDataJson := Value;
end;
procedure TBaseDBDataSet.SetDataSource(const Value: TDataSource);
begin
FDataSource := Value;
end;
end.
|
unit LblEffct;
{
This unit implements a label component with 3D effects.
Written by Keith Wood - 27 May 1995.
The label has a highlight and a shadow. The colours of these
can be controlled through properties as can their distance
from the label and their direction. There are also preset
combinations of direction/distance and colours.
The label can be set to operate as a button, ie. initially
raised it will depress when clicked.
The label can be rotated to any angle.
Version 2.0 - 1 Feb 1996
Added extrusion, keep letters vertical, graduated face and version.
Version 2.1 - 14 Jun 1996
Update to work with Delphi 2.0, fix bug with Transparent property,
fix bug with Alignment property, prepare label offscreen and then display.
Thanks to Paradox Informant and their starter article on 3D labels.
Thanks to Bill Murto and his RotateLabel.
Thanks to Curtis Keisler and his TxtRotat example.
}
interface
uses
SysUtils, WinTypes, WinProcs, Classes, Graphics, Controls, StdCtrls;
type
{ Range of offsets for the shadows }
TEffectDepth = 0..10;
{ Directions in which the offsets can be positioned }
TEffectDirection = (edNone, edUp, edUpRight, edRight, edDownRight, edDown,
edDownLeft, edLeft, edUpLeft);
{ Constants for specifying direction component }
TDirXY = (drX, drY);
{ The preset styles of label effects available }
TEffectStyle = (esNone, esCustom, esRaised, esSunken, esShadow, esFlying);
{ The preset colour schemes available }
TColourScheme = (csCustom, csText, csWindows, csEmbossed, csGold, csSteel);
{ Constants for specifying positions of colours }
TColourPosition = (cpHighlight, cpShadow, cpFace);
{ Range for rotation }
TAngleRange = 0..360;
{ Options for varying the shadow/highlight for the label }
TEffectOption = (eoNormal, eoReal, eoExtrude, eoGraduated);
{ Options for varying the face of the label }
TGraduateOption = (goNone, goVertical, goHorizontal);
const
{ Offsets for drawing in the nominated directions }
IOffsets: array [TEffectDirection, TDirXY] of -1..1 =
((0,0),(0,-1),(+1,-1),(+1,0),(+1,+1),(0,+1),(-1,+1),(-1,0),(-1,-1));
type
TLabelEffect = class(TCustomLabel)
private
{ Private declarations }
FDepthHighlight,
FDepthShadow: TEffectDepth;
FDirectionHighlight,
FDirectionShadow: TEffectDirection;
FColourHighlight,
FColourShadow: TColor;
FGraduateFace: TGraduateOption;
FGraduateFrom: TColor;
FStyleHighlight,
FStyleShadow: TEffectOption;
FEffectStyle: TEffectStyle;
FColourScheme: TColourScheme;
FAsButton: Boolean;
FAngle: TAngleRange;
FKeepLettersVertical: Boolean;
FVersion: String;
BChangingStyle, { Is preset style being invoked ? }
BChangingScheme: Boolean; { Is preset colour scheme being invoked ? }
ClrSchemes: array [TColourScheme,TColourPosition] of TColor;
DDegToRad, DCosAngle, DSinAngle, DCosSquared, DSinSquared: Double;
procedure SetDepthHighlight(IDepth: TEffectDepth);
procedure SetDepthShadow(IDepth: TEffectDepth);
procedure SetDirectionHighlight(EdDirection: TEffectDirection);
procedure SetDirectionShadow(EdDirection: TEffectDirection);
procedure SetColourHighlight(ClrHighlight: TColor);
procedure SetColourShadow(ClrShadow: TColor);
procedure SetGraduateFace(GoGrad: TGraduateOption);
procedure SetGraduateFrom(ClrGrad: TColor);
procedure SetStyleHighlight(EoStyle: TEffectOption);
procedure SetStyleShadow(EoStyle: TEffectOption);
procedure SetEffectStyle(EsStyle: TEffectStyle);
procedure SetColourScheme(CsScheme: TColourScheme);
procedure SetAsButton(BBtn: Boolean);
procedure SetAngle(AAngle: TAngleRange);
procedure SetTextAngle(Cnv: TCanvas; AAngle: TAngleRange);
procedure SetKeepLettersVertical(BKeep: Boolean);
protected
{ Protected declarations }
procedure Paint; override;
procedure MouseDown(MbBtn: TMouseButton; SsShift: TShiftState;
X, Y: Integer); override;
procedure MouseMove(SsShift: TShiftState; X, Y: Integer); override;
procedure MouseUp(MbBtn: TMouseButton; SsShift: TShiftState;
X, Y: Integer); override;
public
{ Public declarations }
constructor Create(AOwner:TComponent); override;
property Version: String read FVersion; { Read-only }
published
{ Publish specialised properties }
property DepthHighlight: TEffectDepth read FDepthHighlight
write SetDepthHighlight default 1;
property DepthShadow: TEffectDepth read FDepthShadow
write SetDepthShadow default 1;
property DirectionHighlight: TEffectDirection read FDirectionHighlight
write SetDirectionHighlight default edUpLeft;
property DirectionShadow: TEffectDirection read FDirectionShadow
write SetDirectionShadow default edDownRight;
property ColourHighlight: TColor read FColourHighlight
write SetColourHighlight default clWhite;
property ColourShadow: TColor read FColourShadow
write SetColourShadow default clBlack;
property GraduateFace: TGraduateOption read FGraduateFace
write SetGraduateFace default goNone;
property GraduateFrom: TColor read FGraduateFrom
write SetGraduateFrom default clGray;
property StyleHighlight: TEffectOption read FStyleHighlight
write SetStyleHighlight default eoNormal;
property StyleShadow: TEffectOption read FStyleShadow
write SetStyleShadow default eoNormal;
property EffectStyle: TEffectStyle read FEffectStyle
write SetEffectStyle default esRaised;
property ColourScheme: TColourScheme read FColourScheme
write SetColourScheme default csWindows;
property AsButton: Boolean read FAsButton write SetAsButton default False;
property Angle: TAngleRange read FAngle write SetAngle default 0;
property KeepLettersVertical: Boolean read FKeepLettersVertical
write SetKeepLettersVertical default False;
{ Publish inherited properties }
property Align;
property Alignment;
property Caption;
property Color;
property Cursor;
property DragCursor;
property DragMode;
property Enabled;
property FocusControl;
property Font;
property ParentColor;
property ParentFont;
property ParentShowHint;
property ShowAccelChar;
property ShowHint;
property Transparent default True;
property Visible;
property WordWrap;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
end;
procedure Register;
implementation
const
LabelEffectVersion = '2.1';
procedure Register;
begin
RegisterComponents('NewPower', [TLabelEffect]);
end;
constructor TLabelEffect.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{ Colour schemes cannot be constant since Custom version varies }
ClrSchemes[csText,cpHighlight] := clWhite;
ClrSchemes[csText,cpFace] := clBlack;
ClrSchemes[csText,cpShadow] := clGray;
ClrSchemes[csWindows,cpHighlight] := clWhite;
ClrSchemes[csWindows,cpFace] := clGray;
ClrSchemes[csWindows,cpShadow] := clBlack;
ClrSchemes[csEmbossed,cpHighlight] := clWhite;
ClrSchemes[csEmbossed,cpFace] := clSilver;
ClrSchemes[csEmbossed,cpShadow] := clBlack;
ClrSchemes[csGold,cpHighlight] := clYellow;
ClrSchemes[csGold,cpFace] := clOlive;
ClrSchemes[csGold,cpShadow] := clBlack;
ClrSchemes[csSteel,cpHighlight] := clAqua;
ClrSchemes[csSteel,cpFace] := clTeal;
ClrSchemes[csSteel,cpShadow] := clNavy;
ClrSchemes[csCustom,cpHighlight] := ClrSchemes[csWindows,cpHighlight];
ClrSchemes[csCustom,cpFace] := ClrSchemes[csWindows,cpFace];
ClrSchemes[csCustom,cpShadow] := ClrSchemes[csWindows,cpShadow];
{ Initialise default values for internal fields }
FDepthHighlight := 1;
FDepthShadow := 1;
FDirectionHighlight := edUpLeft;
FDirectionShadow := edDownRight;
FStyleHighlight := eoNormal;
FStyleShadow := eoNormal;
FEffectStyle := esRaised;
FColourScheme := csWindows;
FColourHighlight := ClrSchemes[FColourScheme,cpHighlight];
FColourShadow := ClrSchemes[FColourScheme,cpShadow];
FGraduateFace := goNone;
FGraduateFrom := Font.Color;
FAsButton := False;
FAngle := 0;
FKeepLettersVertical := False;
FVersion := LabelEffectVersion;
BChangingStyle := False;
BChangingScheme := False;
DDegToRad := PI / 180;
DCosAngle := 1; { Cos(FAngle * DDegToRad) }
DCosSquared := 1;
DSinAngle := 0; { Sin(FAngle * DDegToRad) }
DSinSquared := 0;
AutoSize := False;
Height := 33;
Width := 142;
Transparent := True;
Font.Color := ClrSchemes[FColourScheme,cpFace];
Font.Name := 'Times New Roman';
Font.Size := 20;
end;
procedure TLabelEffect.SetDepthHighlight(IDepth: TEffectDepth);
begin
if FDepthHighlight <> IDepth then
begin
FDepthHighlight := IDepth;
if not BChangingStyle then { Default to custom style when changed }
SetEffectStyle(esCustom);
Invalidate;
end;
end;
procedure TLabelEffect.SetDepthShadow(IDepth: TEffectDepth);
begin
if FDepthShadow <> IDepth then
begin
FDepthShadow := IDepth;
if not BChangingStyle then { Default to custom style when changed }
SetEffectStyle(esCustom);
Invalidate;
end;
end;
procedure TLabelEffect.SetDirectionHighlight(EdDirection: TEffectDirection);
begin
if FDirectionHighlight <> EdDirection then
begin
FDirectionHighlight := EdDirection;
if not BChangingStyle then { Default to custom style when changed }
SetEffectStyle(esCustom);
Invalidate;
end;
end;
procedure TLabelEffect.SetDirectionShadow(EdDirection: TEffectDirection);
begin
if FDirectionShadow <> EdDirection then
begin
FDirectionShadow := EdDirection;
if not BChangingStyle then { Default to custom style when changed }
SetEffectStyle(esCustom);
Invalidate;
end;
end;
procedure TLabelEffect.SetColourHighlight(ClrHighlight: TColor);
begin
if FColourHighlight <> ClrHighlight then
begin
FColourHighlight := ClrHighlight;
ClrSchemes[csCustom,cpHighlight] := ClrHighlight;
if not BChangingScheme then { Default to custom colour scheme when changed }
SetColourScheme(csCustom);
Invalidate;
end;
end;
procedure TLabelEffect.SetColourShadow(ClrShadow: TColor);
begin
if FColourShadow <> ClrShadow then
begin
FColourShadow := ClrShadow;
ClrSchemes[csCustom,cpShadow] := ClrShadow;
if not BChangingScheme then { Default to custom colour scheme when changed }
SetColourScheme(csCustom);
Invalidate;
end;
end;
procedure TLabelEffect.SetGraduateFace(GoGrad: TGraduateOption);
begin
if FGraduateFace <> GoGrad then
begin
FGraduateFace := GoGrad;
Invalidate;
end;
end;
procedure TLabelEffect.SetGraduateFrom(ClrGrad: TColor);
begin
if FGraduateFrom <> ClrGrad then
begin
FGraduateFrom := ClrGrad;
if GraduateFace <> goNone then { Only has effect if GraduateFace is not goNone }
Invalidate;
end;
end;
procedure TLabelEffect.SetStyleHighlight(EoStyle: TEffectOption);
begin
if FStyleHighlight <> EoStyle then
begin
FStyleHighlight := EoStyle;
Invalidate;
end;
end;
procedure TLabelEffect.SetStyleShadow(EoStyle: TEffectOption);
begin
if FStyleShadow <> EoStyle then
begin
FStyleShadow := EoStyle;
Invalidate;
end;
end;
procedure TLabelEffect.SetEffectStyle(EsStyle: TEffectStyle);
begin
if FEffectStyle <> EsStyle then
begin
BChangingStyle := True; { So it doesn't reset to custom }
BChangingScheme := True; { " }
FEffectStyle := EsStyle;
SetColourHighlight(ClrSchemes[ColourScheme,cpHighlight]);
case FEffectStyle of
esRaised:
begin
SetDirectionHighlight(edUpLeft);
SetDirectionShadow(edDownRight);
SetDepthHighlight(1);
SetDepthShadow(1);
end;
esSunken:
begin
SetDirectionHighlight(edDownRight);
SetDirectionShadow(edUpLeft);
SetDepthHighlight(1);
SetDepthShadow(1);
end;
esShadow:
begin
SetDirectionHighlight(edNone);
SetDirectionShadow(edDownRight);
SetDepthHighlight(0);
SetDepthShadow(2);
SetAsButton(False);
end;
esFlying:
begin
SetDirectionHighlight(edDownRight);
SetDirectionShadow(edDownRight);
SetDepthHighlight(1);
SetDepthShadow(5);
SetColourHighlight(ClrSchemes[ColourScheme,cpShadow]); { Flying has two shadows }
SetAsButton(False);
end;
esNone:
begin
SetDirectionHighlight(edNone);
SetDirectionShadow(edNone);
SetDepthHighlight(0);
SetDepthShadow(0);
SetAsButton(False);
end;
else
SetAsButton(False);
end;
BChangingStyle := False; { So further changes set style to custom }
BChangingScheme := False; { So further changes set colour scheme to custom }
end;
end;
procedure TLabelEffect.SetColourScheme(CsScheme: TColourScheme);
begin
if FColourScheme <> CsScheme then
begin
BChangingScheme := True; { So it doesn't reset to custom }
FColourScheme := CsScheme;
SetColourHighlight(ClrSchemes[FColourScheme,cpHighlight]);
Font.Color := ClrSchemes[FColourScheme,cpFace];
SetColourShadow(ClrSchemes[FColourScheme,cpShadow]);
if FColourScheme <> csCustom then { Save for future reference }
begin
ClrSchemes[csCustom,cpHighlight] := ClrSchemes[FColourScheme,cpHighlight];
ClrSchemes[csCustom,cpFace] := ClrSchemes[FColourScheme,cpFace];
ClrSchemes[csCustom,cpShadow] := ClrSchemes[FColourScheme,cpShadow];
end;
BChangingScheme := False; { So further changes set colour scheme to custom }
end;
end;
procedure TLabelEffect.SetAsButton(BBtn: Boolean);
begin
if FAsButton <> BBtn then
begin
FAsButton := BBtn;
if BBtn then { If not already raised, raise it }
SetEffectStyle(esRaised);
end;
end;
procedure TLabelEffect.SetAngle(AAngle: TAngleRange);
begin
if FAngle <> AAngle then
begin
FAngle := AAngle;
DCosAngle := Cos(FAngle * DDegToRad); { Calculate values for later use }
DCosSquared := DCosAngle * DCosAngle;
DSinAngle := Sin(FAngle * DDegToRad);
DSinSquared := DSinAngle * DSinAngle;
if FAngle <> 0 then Alignment := taLeftJustify; { Cannot align when rotated }
Invalidate;
end;
end;
procedure TLabelEffect.SetKeepLettersVertical(BKeep: Boolean);
begin
if FKeepLettersVertical <> BKeep then
begin
FKeepLettersVertical := BKeep;
if Angle <> 0 then { Only has effect if Angle is non-zero }
Invalidate;
end;
end;
function Min(I, J: Integer): Integer;
begin
if I < J then Result := I else Result := J;
end;
function Max(I, J: Integer): Integer;
begin
if I > J then Result := I else Result := J;
end;
procedure GetRGB(Clr: TColor; var IR, IG, IB: Byte);
begin
IR := GetRValue(Clr);
IG := GetGValue(Clr);
IB := GetBValue(Clr);
end;
procedure TLabelEffect.SetTextAngle(Cnv: TCanvas; AAngle: TAngleRange);
var
FntLogRec: TLogFont; { Storage area for font information }
begin
{ Get the current font information. We only want to modify the angle }
GetObject(Cnv.Font.Handle, SizeOf(FntLogRec), Addr(FntLogRec));
{ Modify the angle. "The angle, in tenths of a degrees, between the base
line of a character and the x-axis." (Windows API Help file.)}
FntLogRec.lfEscapement := AAngle * 10;
FntLogRec.lfOutPrecision := OUT_TT_ONLY_PRECIS; { Request TrueType precision }
{ Delphi will handle the deallocation of the old font handle }
Cnv.Font.Handle := CreateFontIndirect(FntLogRec);
end;
procedure TLabelEffect.Paint;
const
WAlignments: array [TAlignment] of word = (DT_LEFT, DT_RIGHT, DT_CENTER);
var
IMinOffset, IMaxOffset: Integer;
RctTemp, RctFirst, RctLast: TRect;
StrText: array [0..255] of char;
I, IMid, IH, IW, IX, IY, IU, IV, ILimit, IL, ILen: Integer;
I1, I2, I3, I4, IAdj: Integer;
P1, P2, P3, P4, P5, P6, P7, P8: TPoint;
IFromR, IFromG, IFromB, IToR, IToG, IToB: Byte;
RAdjustR, RAdjustG, RAdjustB: Real;
BmpTemp, BmpWork: TBitmap;
CnvWork: TCanvas;
begin
{ Find minimum and maximum of all offsets (including font itself) }
IMinOffset := Min(Min(Min(Min(IOffsets[DirectionHighlight, drX] * DepthHighlight,
IOffsets[DirectionShadow, drX] * DepthShadow),
IOffsets[DirectionHighlight, drY] * DepthHighlight),
IOffsets[DirectionShadow, drY] * DepthShadow), 0);
IMaxOffset := Max(Max(Max(Max(IOffsets[DirectionHighlight, drX] * DepthHighlight,
IOffsets[DirectionShadow, drX] * DepthShadow),
IOffsets[DirectionHighlight, drY] * DepthHighlight),
IOffsets[DirectionShadow, drY] * DepthShadow), 0);
ILen := Length(Caption);
case Alignment of
taLeftJustify: IAdj := 0;
taCenter: IAdj := (IMaxOffset - IMinOffset) div 2;
taRightJustify: IAdj := IMaxOffset - IMinOffset;
end;
{ Create temporary drawing surfaces }
BmpTemp := TBitmap.Create;
BmpWork := TBitmap.Create;
try
BmpTemp.Height := Self.Height; { Same size as original }
BmpTemp.Width := Self.Width;
BmpTemp.Canvas.Font := Self.Font; { Ensure canvas font is set }
BmpWork.Height := Self.Height; { Same size as original }
BmpWork.Width := Self.Width;
BmpWork.Canvas.Font := Self.Font; { Ensure canvas font is set }
BmpWork.Canvas.CopyRect(Self.ClientRect, Self.Canvas, Self.ClientRect);
if (Angle <> 0) and not KeepLettersVertical then { Need to generate an angled font }
begin
SetTextAngle(BmpTemp.Canvas, Angle);
SetTextAngle(BmpWork.Canvas, Angle);
end;
with BmpWork.Canvas do
begin
{ Set starting point for text - IX, IY }
if Angle = 0 then
begin
IX := 0; IY := 0;
end
else if KeepLettersVertical then
begin
IH := Round((TextHeight(Caption) * (ILen - 1) * DSinSquared) +
(TextWidth(Copy(Caption, 1, ILen - 1)) * DCosSquared));
IX := Max(0, - Round(IH * DCosAngle)) + 10;
IY := Max(0, Round(IH * DSinAngle)) + 10;
IL := IMaxOffset - IMinOffset + 4;
{ Find rectangles surrounding first and last characters }
RctFirst := Bounds(IX - 2, IY - 2,
TextWidth(Copy(Caption, 1, 1)) + IL, TextHeight(Caption) + IL);
RctLast := Bounds(IX - 2 + Round(IH * DCosAngle), IY - 2 - Round(IH * DSinAngle),
TextWidth(Copy(Caption, ILen, 1)) + IL, TextHeight(Caption) + IL);
end
else
begin
IW := TextWidth(Caption);
IH := TextHeight(Caption);
IMid := TextWidth(Caption+' ') div 2;
IX := IMid - Trunc(IW / 2 * DCosAngle) - Trunc(IH / 2 * DSinAngle);
IY := IMid + Trunc(IW / 2 * DSinAngle) - Trunc(IH / 2 * DCosAngle);
IMid := IMid + (IMaxOffset - IMinOffset + 4) div 2;
IW := IW + IMaxOffset + IMinOffset + 4;
IH := IH + IMaxOffset + IMinOffset + 4;
I1 := Trunc(IW / 2 * DCosAngle);
I2 := Trunc(IH / 2 * DSinAngle);
I3 := Trunc(IW / 2 * DSinAngle);
I4 := Trunc(IH / 2 * DCosAngle);
P1 := Point(IMid - I1 - I2 + 2, IMid + I3 - I4 + 2);
P2 := Point(IMid + I1 - I2 + 2, IMid - I3 - I4 + 2);
P3 := Point(IMid + I1 + I2 + 2, IMid - I3 + I4 + 2);
P4 := Point(IMid - I1 + I2 + 2, IMid + I3 + I4 + 2);
end;
if not Transparent then { Fill in background }
begin
Brush.Color := Self.Color;
Brush.Style := bsSolid;
if Angle = 0 then
FillRect(ClientRect) { Original label canvas }
else if KeepLettersVertical then
begin { Calculate enclosing polygon }
P1 := Point(RctFirst.Left, RctFirst.Top);
P2 := Point(RctFirst.Left, RctFirst.Bottom);
P3 := Point(RctFirst.Right, RctFirst.Top);
P4 := Point(RctFirst.Right, RctFirst.Bottom);
P5 := Point(RctLast.Left, RctLast.Top);
P6 := Point(RctLast.Left, RctLast.Bottom);
P7 := Point(RctLast.Right, RctLast.Top);
P8 := Point(RctLast.Right, RctLast.Bottom);
case Angle of
1..90 : Polygon([P1, P5, P7, P8, P4, P2]);
91..180 : Polygon([P3, P7, P5, P6, P2, P4]);
181..270 : Polygon([P1, P5, P6, P8, P4, P3]);
271..360 : Polygon([P3, P7, P8, P6, P2, P1]);
end;
end
else
Polygon([P1, P2, P3, P4]);
end;
Brush.Style := bsClear; { Don't overwrite background above }
end;
GetTextBuf(StrText, SizeOf(StrText)); { Get label's caption }
{ Prepare for extruding shadow, if requested }
GetRGB(ColourShadow, IFromR, IFromG, IFromB);
RAdjustR := 0; RAdjustG := 0; RAdjustB := 0;
ILimit := DepthShadow;
if StyleShadow = eoReal then
GetRGB(clBlack, IFromR, IFromG, IFromB)
else if (StyleShadow <> eoNormal) and (DepthShadow > 1) then
begin
ILimit := 1;
if StyleShadow = eoGraduated then { Find changes in RGB colours }
begin
GetRGB(Font.Color, IToR, IToG, IToB);
RAdjustR := (IToR - IFromR) / (DepthShadow - 1);
RAdjustG := (IToG - IFromG) / (DepthShadow - 1);
RAdjustB := (IToB - IFromB) / (DepthShadow - 1);
end;
end;
if StyleShadow = eoReal then { Work on copy then transfer }
CnvWork := BmpTemp.Canvas
else { Work directly on label's canvas }
CnvWork := BmpWork.Canvas;
{ Process for each copy of the shadow - several if extruding }
for I := DepthShadow downto ILimit do
begin
CnvWork.Font.Color :=
RGB(IFromR + Round(RAdjustR * (DepthShadow - I)),
IFromG + Round(RAdjustG * (DepthShadow - I)),
IFromB + Round(RAdjustB * (DepthShadow - I)));
if Angle = 0 then
begin
{ Create a rect that is offset for the shadow }
RctTemp:= Rect(
Self.ClientRect.Left - IMinOffset -IAdj + IOffsets[DirectionShadow, drX] * I,
Self.ClientRect.Top - IMinOffset + IOffsets[DirectionShadow, drY] * I,
Self.ClientRect.Right - IMinOffset - IAdj + IOffsets[DirectionShadow, drX] * I,
Self.ClientRect.Bottom - IMinOffset + IOffsets[DirectionShadow, drY] * I);
{ Draw shadow text with alignment }
DrawText(CnvWork.Handle, StrText, StrLen(StrText), RctTemp,
DT_EXPANDTABS or DT_WORDBREAK or WAlignments[Alignment]);
end
else if KeepLettersVertical then
for IL := 1 to ILen do { For each character }
begin
IW := 0; IH := 0;
if IL > 1 then { Position based on substring length and height }
begin
IH := Round((CnvWork.TextHeight(Caption) * (IL - 1) * DSinSquared) +
(CnvWork.TextWidth(Copy(Caption, 1, IL - 1)) * DCosSquared));
IW := Round(IH * DCosAngle);
IH := Round(IH * DSinAngle);
end;
CnvWork.TextOut(IX - IMinOffset + IW + IOffsets[DirectionShadow, drX] * I,
IY - IMinOffset - IH + IOffsets[DirectionShadow, drY] * I,
Copy(Caption, IL, 1));
end
else
{ Draw angled shadow text without alignment }
CnvWork.TextOut(IX - IMinOffset + IOffsets[DirectionShadow, drX] * I,
IY - IMinOffset + IOffsets[DirectionShadow, drY] * I, Caption);
end;
if StyleShadow = eoReal then { Real/transparent shadow }
begin
for IU := 0 to Width do
for IV := 0 to Height do
if BmpTemp.Canvas.Pixels[IU, IV] = clBlack then
begin { Make halfway to black }
GetRGB(BmpWork.Canvas.Pixels[IU, IV], IToR, IToG, IToB);
BmpWork.Canvas.Pixels[IU, IV] := RGB(IToR div 2, IToG div 2, IToB div 2);
end;
end;
{ Prepare for extruding highlight, if requested }
GetRGB(ColourHighlight, IFromR, IFromG, IFromB);
RAdjustR := 0; RAdjustG := 0; RAdjustB := 0;
ILimit := DepthHighlight;
if StyleHighlight = eoReal then
GetRGB(clBlack, IFromR, IFromG, IFromB)
else if (StyleHighlight <> eoNormal) and (DepthHighlight > 1) then
begin
ILimit := 1;
if StyleHighlight = eoGraduated then { Find changes in RGB colours }
begin
GetRGB(Font.Color, IToR, IToG, IToB);
RAdjustR := (IToR - IFromR) / (DepthHighlight - 1);
RAdjustG := (IToG - IFromG) / (DepthHighlight - 1);
RAdjustB := (IToB - IFromB) / (DepthHighlight - 1);
end;
end;
if StyleHighlight = eoReal then { Work on copy then transfer }
begin
BmpTemp.Canvas.FillRect(ClientRect);
CnvWork := BmpTemp.Canvas;
end
else { Work directly on label's canvas }
CnvWork := BmpWork.Canvas;
{ Process for each copy of the highlight - several if extruding }
for I := DepthHighlight downto ILimit do
begin
CnvWork.Font.Color :=
RGB(IFromR + Round(RAdjustR * (DepthHighlight - I)),
IFromG + Round(RAdjustG * (DepthHighlight - I)),
IFromB + Round(RAdjustB * (DepthHighlight - I)));
if Angle = 0 then
begin
{ Create a rect that is offset for the highlight }
RctTemp:= Rect(
Self.ClientRect.Left - IMinOffset - IAdj + IOffsets[DirectionHighlight, drX] * I,
Self.ClientRect.Top - IMinOffset + IOffsets[DirectionHighlight, drY] * I,
Self.ClientRect.Right - IMinOffset - IAdj + IOffsets[DirectionHighlight, drX] * I,
Self.ClientRect.Bottom - IMinOffset + IOffsets[DirectionHighlight, drY] * I);
{ Draw highlight text with alignment }
DrawText(CnvWork.Handle, StrText, StrLen(StrText), RctTemp,
DT_EXPANDTABS or DT_WORDBREAK or WAlignments[Alignment]);
end
else if KeepLettersVertical then
for IL := 1 to ILen do { For each character }
begin
IW := 0; IH := 0;
if IL > 1 then { Position based on substring length and height }
begin
IH := Round((CnvWork.TextHeight(Caption) * (IL - 1) * DSinSquared) +
(CnvWork.TextWidth(Copy(Caption, 1, IL - 1)) * DCosSquared));
IW := Round(IH * DCosAngle);
IH := Round(IH * DSinAngle);
end;
CnvWork.TextOut(IX - IMinOffset + IW + IOffsets[DirectionHighlight, drX] * I,
IY - IMinOffset - IH + IOffsets[DirectionHighlight, drY] * I,
Copy(Caption, IL, 1));
end
else
{ Draw angled highlight text without alignment }
CnvWork.TextOut(IX - IMinOffset + IOffsets[DirectionHighlight, drX] * I,
IY - IMinOffset + IOffsets[DirectionHighlight, drY] * I, Caption);
end;
if StyleHighlight = eoReal then { Real/transparent highlight }
begin
for IU := 0 to Width do
for IV := 0 to Height do
if BmpTemp.Canvas.Pixels[IU, IV] = clBlack then
begin { Make halfway to white }
GetRGB(BmpWork.Canvas.Pixels[IU, IV], IToR, IToG, IToB);
BmpWork.Canvas.Pixels[IU, IV] :=
RGB((255 + IToR) div 2, (255 + IToG) div 2, (255 + IToB) div 2);
end;
end;
if GraduateFace <> goNone then
begin
{ Copy original canvas to work area }
BmpTemp.Canvas.CopyRect(Self.ClientRect, BmpWork.Canvas, Self.ClientRect);
{ Choose an unusual colour }
BmpTemp.Canvas.Font.Color := $00FE09F1;
BmpTemp.Canvas.Brush.Style := bsClear;
CnvWork := BmpTemp.Canvas;
end
else
begin
BmpWork.Canvas.Font.Color := Font.Color; { Restore original font colour }
CnvWork := BmpWork.Canvas;
end;
if Angle = 0 then
begin
{ Create a rect that is offset for the original text }
RctTemp:= Rect(Self.ClientRect.Left - IMinOffset - IAdj,
Self.ClientRect.Top - IMinOffset,
Self.ClientRect.Right - IMinOffset - IAdj,
Self.ClientRect.Bottom - IMinOffset);
{ Draw original text with alignment }
DrawText(CnvWork.Handle, StrText, StrLen(StrText), RctTemp,
DT_EXPANDTABS or DT_WORDBREAK or WAlignments[Alignment]);
end
else if KeepLettersVertical then
for IL := 1 to ILen do { For each character }
begin
IW := 0; IH := 0;
if IL > 1 then { Position based on substring length and height }
begin
IH := Round((CnvWork.TextHeight(Caption) * (IL - 1) * DSinSquared) +
(CnvWork.TextWidth(Copy(Caption, 1, IL - 1)) * DCosSquared));
IW := Round(IH * DCosAngle);
IH := Round(IH * DSinAngle);
end;
CnvWork.TextOut(IX - IMinOffset + IW, IY - IMinOffset - IH, Copy(Caption, IL, 1));
end
else
{ Draw angled original text without alignment }
CnvWork.TextOut(IX - IMinOffset, IY - IMinOffset, Caption);
if GraduateFace <> goNone then { Transfer graduations from temporary canvas }
begin { Calculate start point and extent }
if Angle = 0 then
begin
ILimit := BmpWork.Canvas.TextWidth(Caption);
IV := IY - IMinOffset;
case Alignment of
taLeftJustify: IU := IX - IMinOffset;
taCenter: IU := (Self.Width - ILimit) div 2 - IMinOffset - IAdj;
taRightJustify: IU := Self.Width - IMaxOffset - ILimit;
end;
if GraduateFace = goVertical then
ILimit := BmpWork.Canvas.TextHeight(Caption) - 1
else
ILimit := ILimit - 1;
end
else if KeepLettersVertical then
begin
IU := Min(RctFirst.Left, RctLast.Left);
IV := Min(RctFirst.Top, RctLast.Top);
if GraduateFace = goVertical then
ILimit := Max(RctFirst.Bottom, RctLast.Bottom) - IV
else
ILimit := Max(RctFirst.Right, RctLast.Right) - IU;
end
else
begin
IU := Min(Min(Min(P1.X, P2.X), P3.X), P4.X);
IV := Min(Min(Min(P1.Y, P2.Y), P3.Y), P4.Y);
if GraduateFace = goVertical then
ILimit := Max(Max(Max(P1.Y, P2.Y), P3.Y), P4.Y) - IV
else
ILimit := Max(Max(Max(P1.X, P2.X), P3.X), P4.X) - IU;
end;
{ Calculate change in colour at each step }
GetRGB(GraduateFrom, IFromR, IFromG, IFromB);
GetRGB(Font.Color, IToR, IToG, IToB);
RAdjustR := (IToR - IFromR) / ILimit;
RAdjustG := (IToG - IFromG) / ILimit;
RAdjustB := (IToB - IFromB) / ILimit;
{ And draw it onto the canvas }
BmpWork.Canvas.Brush.Style := bsSolid;
for I := 0 to ILimit do
begin
BmpWork.Canvas.Brush.Color := RGB(IFromR + Round(RAdjustR * I),
IFromG + Round(RAdjustG * I), IFromB + Round(RAdjustB * I));
if GraduateFace = goVertical then
RctTemp := Rect(0, IV + I, Width, IV + I + 1)
else
RctTemp := Rect(IU + I, 0, IU + I + 1, Height);
BmpWork.Canvas.BrushCopy(RctTemp, BmpTemp, RctTemp, BmpTemp.Canvas.Font.Color);
end;
end;
Self.Canvas.CopyRect(Self.ClientRect, BmpWork.Canvas, Self.ClientRect);
finally
BmpTemp.Free;
BmpWork.Free;
end;
end;
procedure TLabelEffect.MouseDown(MbBtn: TMouseButton; SsShift: TShiftState;
X, Y: Integer);
begin
if AsButton then
begin { If left button and label isn't sunken }
if (MbBtn = mbLeft) and (EffectStyle <> esSunken) and Enabled then
SetEffectStyle(esSunken);
end
else
inherited MouseDown(MbBtn, SsShift, X, Y);
end;
procedure TLabelEffect.MouseMove(SsShift: TShiftState; X, Y: Integer);
begin
if AsButton then
begin
if SsShift = [ssLeft] then { Left mouse button down }
begin { If within label's client area }
if (X >= 0) and (X <= ClientWidth) and (Y >= 0) and (Y <= ClientHeight) then
SetEffectStyle(esSunken)
else
SetEffectStyle(esRaised);
end;
end
else
inherited MouseMove(SsShift, X, Y);
end;
procedure TLabelEffect.MouseUp(MbBtn: TMouseButton; SsShift: TShiftState;
X, Y: Integer);
begin
if AsButton then
begin { If within label's client area }
if (X >= 0) and (X <= ClientWidth) and (Y >= 0) and (Y <= ClientHeight) then
SetEffectStyle(esRaised);
end
else
inherited MouseUp(MbBtn, SsShift, X, Y);
end;
end.
|
unit ufrmDialogAdjustmentCashback;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ufrmMasterDialog, ufraFooterDialog2Button, ExtCtrls, StdCtrls, ComCtrls,
System.Actions, Vcl.ActnList, ufraFooterDialog3Button, cxGraphics, cxControls,
cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit, dxCore, DB,
cxDateUtils, cxDropDownEdit, cxLookupEdit, cxDBLookupEdit,
cxDBExtLookupComboBox, cxCurrencyEdit, cxTextEdit, cxMaskEdit, cxCalendar;
type
TFormMode = (fmAdd, fmEdit);
TfrmDialogAdjustmentCashback = class(TfrmMasterDialog)
pnl2: TPanel;
lbl4: TLabel;
edtMemberCode: TEdit;
edtMemberName: TEdit;
edtCashierName: TEdit;
edtCashierId: TEdit;
lbl6: TLabel;
lbl5: TLabel;
edtPOSCode: TEdit;
edtShiftCode: TEdit;
lbl7: TLabel;
lbl9: TLabel;
edtCardCode: TEdit;
edtCardNo: TEdit;
edtCardName: TEdit;
lbl10: TLabel;
lbl11: TLabel;
edtCardAuthorize: TEdit;
lbl12: TLabel;
dtTransact: TcxDateEdit;
curredtTotalTransact: TcxCurrencyEdit;
lbl13: TLabel;
lbl14: TLabel;
curredtPaymentCard: TcxCurrencyEdit;
pnl3: TPanel;
curredtCashbackActually: TcxCurrencyEdit;
lbl16: TLabel;
lbl15: TLabel;
curredtCashbackBefore: TcxCurrencyEdit;
curredtAdjustCashback: TcxCurrencyEdit;
lbl17: TLabel;
lbl18: TLabel;
edtNote: TEdit;
pgcPage: TPageControl;
tsSameDay: TTabSheet;
tsOthersDay: TTabSheet;
Panel1: TPanel;
lbl19: TLabel;
lbl20: TLabel;
lbl21: TLabel;
dtAdjustCashback: TcxDateEdit;
cbpAdjustCode: TcxExtLookupComboBox;
edtNoTrans: TEdit;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure footerDialogMasterbtnSaveClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure tsOthersDayShow(Sender: TObject);
procedure dtAdjustCashbackKeyPress(Sender: TObject; var Key: Char);
procedure cbpAdjustCodeKeyPress(Sender: TObject; var Key: Char);
// procedure cbpTransNoKeyPress(Sender: TObject; var Key: Char);
// procedure cbpTransNoChange(Sender: TObject);
procedure curredtCashbackBeforeChange(Sender: TObject);
procedure curredtCashbackActuallyKeyPress(Sender: TObject;
var Key: Char);
// procedure cbpAdjustCodeChange(Sender: TObject);
procedure FormKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
FIsProcessSuccessfull: boolean;
FFormMode: TFormMode;
// procedure ClearData;
procedure LookUpData(Sender:TObject; Key: Word);
// procedure ParseDataComboBox();
procedure ParseDataComboBoxAdjustCode;
procedure ParseDetilTransactCardByTransNo;
procedure SetFormMode(const Value: TFormMode);
procedure SetIsProcessSuccessfull(const Value: boolean);
// function SaveAdjustmentCashback: boolean;
public
{ Public declarations }
published
property FormMode: TFormMode read FFormMode write SetFormMode;
property IsProcessSuccessfull: boolean read FIsProcessSuccessfull write SetIsProcessSuccessfull;
end;
var
frmDialogAdjustmentCashback: TfrmDialogAdjustmentCashback;
implementation
uses uTSCommonDlg;
{$R *.dfm}
procedure TfrmDialogAdjustmentCashback.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDialogAdjustmentCashback.FormDestroy(Sender: TObject);
begin
inherited;
frmDialogAdjustmentCashback := nil;
end;
//procedure TfrmDialogAdjustmentCashback.ParseDataComboBox;
//var
// sSQL: string;
// data: TDataSet;
//begin
// with cbpTransNo do
// begin
// ClearGridData;
// ColCount := 3;
// RowCount := 3;
// AddRow(['id', 'TRANSACTION NO.','DATE']);
//
// sSQL := 'SELECT TRANS_NO, TRANS_DATE '
// + 'FROM TRANSAKSI '
// + 'WHERE TRANS_NO LIKE ' + Quot(cbpTransNo.Text + '%')
// + 'AND TRANS_UNT_ID = ' + IntToStr(dialogunit);
// data := cOpenQuery(sSQL);
//
// if (not data.Eof) then
// begin
// data.Last;
// data.First;
// RowCount := data.RecordCount + 2;
// while not data.Eof do
// begin
// AddRow([data.FieldByName('TRANS_NO').AsString,data.FieldByName('TRANS_NO').AsString,
// FormatDateTime('dd-mm-yyyy',data.FieldByName('TRANS_DATE').AsDateTime)]);
// data.Next;
// end;
// end
// else
// begin
// AddRow(['0',' ',' ']);
// end;
//
// FixedRows := 1;
// SizeGridToData;
// ShowSpeedButton := false;
// end;
//end;
procedure TfrmDialogAdjustmentCashback.SetFormMode(const Value: TFormMode);
begin
FFormMode := Value;
end;
procedure TfrmDialogAdjustmentCashback.SetIsProcessSuccessfull(
const Value: boolean);
begin
FIsProcessSuccessfull := Value;
end;
procedure TfrmDialogAdjustmentCashback.footerDialogMasterbtnSaveClick(
Sender: TObject);
begin
// if (Trim(cbpTransNo.Text) = '') then
if (Trim(edtNoTrans.Text) = '') then
begin
CommonDlg.ShowErrorEmpty('Transaction No.');
edtNoTrans.SetFocus;
exit;
end;
// if (SaveAdjustmentCashback) then
// begin
// IsProcessSuccessfull := true;
// Close;
// end;
end;
procedure TfrmDialogAdjustmentCashback.FormShow(Sender: TObject);
begin
inherited;
pgcPage.ActivePageIndex := 1;
end;
procedure TfrmDialogAdjustmentCashback.tsOthersDayShow(Sender: TObject);
begin
dtAdjustCashback.Date := now;
dtAdjustCashback.SetFocus;
dtAdjustCashback.SelectAll;
ParseDataComboBoxAdjustCode;
// ParseDataComboBox;
end;
procedure TfrmDialogAdjustmentCashback.dtAdjustCashbackKeyPress(
Sender: TObject; var Key: Char);
begin
if (Key = Chr(VK_RETURN)) then
begin
cbpAdjustCode.SetFocus;
cbpAdjustCode.SelectAll;
end;
end;
procedure TfrmDialogAdjustmentCashback.ParseDataComboBoxAdjustCode;
begin
{with cbpAdjustCode do
begin
ClearGridData;
RowCount := 4;
ColCount := 3;
AddRow(['id','CODE','DESCRIPTION']);
AddRow(['1','1=Kekurangan input','Kekurangan input']);
AddRow(['2','2=Kelebihan input','Kelebihan input']);
AddRow(['3','3=Kelupaan input','Kelupaan input']);
FixedRows := 1;
AutoSize := true;
end;
}
end;
procedure TfrmDialogAdjustmentCashback.cbpAdjustCodeKeyPress(
Sender: TObject; var Key: Char);
begin
if (Key = Chr(VK_RETURN)) then
begin
edtNoTrans.SetFocus;
// edtNote.Text := cbpAdjustCode.Cells[2,cbpAdjustCode.Row] + ' ';
end;
end;
procedure TfrmDialogAdjustmentCashback.ParseDetilTransactCardByTransNo;
var
sSQL: string;
// data: TDataSet;
begin
sSQL := 'SELECT * '
+ 'FROM TRANSAKSI '
+ ' INNER JOIN MEMBER ON (MEMBER_ID=TRANS_MEMBER_ID) '
+ ' AND (MEMBER_UNT_ID=TRANS_MEMBER_UNT_ID) '
+ ' INNER JOIN BEGINNING_BALANCE ON (BALANCE_ID=TRANS_BALANCE_ID) '
+ ' AND (BALANCE_UNT_ID=TRANS_BALANCE_UNT_ID) '
+ ' INNER JOIN AUT$USER ON (USR_ID=BALANCE_USR_ID) '
+ ' AND (USR_UNT_ID=BALANCE_USR_UNT_ID) '
+ ' INNER JOIN SETUPPOS ON (SETUPPOS_ID=BALANCE_SETUPPOS_ID) '
+ ' AND (SETUPPOS_UNT_ID=BALANCE_SETUPPOS_UNT_ID) '
+ ' INNER JOIN SHIFT ON (SHIFT_ID=BALANCE_SHIFT_ID) '
+ ' AND (SHIFT_UNT_ID=BALANCE_SHIFT_UNT_ID) '
+ ' LEFT OUTER JOIN TRANSAKSI_CARD ON (TRANSC_TRANS_NO=TRANS_NO) '
+ ' AND (TRANSC_TRANS_UNT_ID=TRANS_UNT_ID) '
+ ' LEFT OUTER JOIN REF$CREDIT_CARD ON (CARD_ID=TRANSC_CARD_ID) '
+ ' AND (CARD_UNT_ID=TRANSC_CARD_UNT_ID) '
+ ' WHERE TRANS_NO = ' + QuotedStr(edtNoTrans.Text)
+ ' AND TRANS_UNT_ID = ' + IntToStr(dialogunit);
{
data := cOpenQuery(sSQL);
if not (data.IsEmpty) then
begin
with data do
begin
First;
edtMemberCode.Text := FieldByName('MEMBER_CARD_NO').AsString;
edtMemberName.Text := FieldByName('MEMBER_NAME').AsString;
edtCashierId.Text := FieldByName('USR_USERNAME').AsString;
edtCashierName.Text := FieldByName('USR_FULLNAME').AsString;
edtPOSCode.Text := FieldByName('SETUPPOS_TERMINAL_CODE').AsString;
edtShiftCode.Text := FieldByName('SHIFT_NAME').AsString;
edtCardCode.Text := FieldByName('CARD_CODE').AsString;
edtCardNo.Text := FieldByName('TRANSC_NOMOR').AsString;
edtCardName.Text := FieldByName('CARD_NAME').AsString;
edtCardAuthorize.Text := FieldByName('TRANSC_NO_OTORISASI').AsString;
dtTransact.Date := FieldByName('TRANS_DATE').AsDateTime;
curredtTotalTransact.Value := FieldByName('TRANS_TOTAL_BAYAR').AsCurrency;
curredtPaymentCard.Value := FieldByName('TRANS_BAYAR_CARD').AsCurrency;
curredtCashbackActually.Value := 0;
curredtCashbackBefore.Value := FieldByName('TRANSC_CASHBACK_NILAI').AsCurrency;
end;
end;
curredtCashbackActually.SetFocus;
curredtCashbackActually.SelectAll;
}
end;
procedure TfrmDialogAdjustmentCashback.curredtCashbackBeforeChange(
Sender: TObject);
begin
curredtAdjustCashback.Value := curredtCashbackActually.Value - curredtCashbackBefore.Value;
end;
procedure TfrmDialogAdjustmentCashback.curredtCashbackActuallyKeyPress(
Sender: TObject; var Key: Char);
begin
if (Key = Chr(VK_RETURN)) then
begin
edtNote.SetFocus;
edtNote.SelectAll;
end;
end;
//function TfrmDialogAdjustmentCashback.SaveAdjustmentCashback: boolean;
//begin
// Result := false;
{
with TAdjustmentCashback.CreateWithUser(Self,FLoginId,dialogunit) do
begin
try
UpdateData(curredtCashbackActually.Value,
curredtCashbackBefore.Value,
dtAdjustCashback.Date,
0,dialogunit,
edtNote.Text,
edtNoTrans.Text,
curredtAdjustCashback.Value);
Result := SaveToDB;
if Result then
begin
cCommitTrans;
end
else
begin
cRollbackTrans;
end;
finally
Free;
end;
end;
}
//end;
//procedure TfrmDialogAdjustmentCashback.ClearData;
//begin
// edtMemberCode.Clear;
// edtMemberName.Clear;
// edtCashierId.Clear;
// edtCashierName.Clear;
// edtPOSCode.Clear;
// edtShiftCode.Clear;
// edtCardCode.Clear;
// edtCardNo.Clear;
// edtCardName.Clear;
// edtCardAuthorize.Clear;
// dtTransact.Clear;
// curredtTotalTransact.Clear;
// curredtPaymentCard.Clear;
// curredtCashbackActually.Clear;
// curredtCashbackBefore.Clear;
//end;
procedure TfrmDialogAdjustmentCashback.FormKeyUp(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
inherited;
if ((Key = vk_F5) or (Key = vk_return)) and (not (ssCtrl in Shift)) then
LookUpData(ActiveControl, Key);
end;
procedure TfrmDialogAdjustmentCashback.LookUpData(Sender:TObject; Key: Word);
var
sSQL: string;
begin
if Sender = edtNoTrans then
begin
if Key = vk_F5 then
begin
sSQL := 'SELECT TRANS_NO as "NO TRANSAKSI", TRANS_DATE AS "TANGGAL" '
+ 'FROM TRANSAKSI '
+ 'WHERE TRANS_UNT_ID = ' + IntToStr(dialogunit);
{
with cLookUp('Data transaksi', sSQL, 200, 2,True) do
begin
if Strings[0] <> '' then
begin
edtNoTrans.Text := Strings[0];
LookUpData(Sender, VK_RETURN);
end
else
ClearData;
end;
}
end
else if Key = vk_Return then
begin
ParseDetilTransactCardByTransNo;
end;
end;
end;
end.
|
Unit ippsovr;
{ ippsovr devrait rendre plus facile l'utilisation de ipps.pas en utilisant les overload
Exemple: ippsAddC_16s_I, ippsAddC_32f_I, ippsAddC_64f_I, ... deviennent ippsAddC
Toutefois, toutes les déclarations de ce genre n'ont pas pu être mises en overload
(listes de paramètres identiques)
}
INTERFACE
uses ippdefs,ipps;
(* ////////////////////////////////// "ipps.h" /////////////////////////////////
//
// INTEL CORPORATION PROPRIETARY INFORMATION
// This software is supplied under the terms of a license agreement or
// nondisclosure agreement with Intel Corporation and may not be copied
// or disclosed except in accordance with the terms of that agreement.
// Copyright (c) 1999-2003 Intel Corporation. All Rights Reserved.
//
// Intel(R) Integrated Performance Primitives
// Signal Processing (ipps)
//
*)
(* #if !defined( __IPPS_H__ ) || defined( _OWN_BLDPCS )
#define __IPPS_H__
(* #ifndef __IPPDEFS_H__
#include "ippdefs.h"
#endif *)
(* #ifdef __cplusplus
extern "C" {
#endif *)
(* #if !defined( _OWN_BLDPCS )
typedef struct {
int left;
int right;
} IppsROI;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippGetStatusString
// Purpose: convert the library status code to a readable string
// Parameters:
// StsCode IPP status code
// Returns: pointer to string describing the library status code
//
// Notes: don't free the pointer
*)
{ function ippGetStatusString(StsCode:IppStatus):Pansichar; }
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippGetCpuType
// Purpose: detects CPU type
// Parameter: none
// Return: IppCpuType
//
*)
{ function ippGetCpuType:IppCpuType; }
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippGetCpuClocks
// Purpose: reading of time stamp counter (TSC) register value
// Returns: TSC value
//
// Note: An hardware exception is possible if TSC reading is not supported by
/ the current chipset
*)
{ function ippGetCpuClocks:Ipp64u; }
(* ///////////////////////////////////////////////////////////////////////////
// Names: ippSetFlushToZero,
// ippSetDenormAreZero.
//
// Purpose: ippSetFlushToZero enables or disables the flush-to-zero mode,
// ippSetDenormAreZero enables or disables the denormals-are-zeros
// mode.
//
// Arguments:
// value - !0 or 0 - set or clear the corresponding bit of MXCSR
// pUMask - pointer to user store current underflow exception mask
// ( may be NULL if don't want to store )
//
// Return:
// ippStsNoErr - Ok
// ippStsCpuNotSupportedErr - the mode is not suppoted
*)
{ function ippSetFlushToZero(value:longint;pUMask:PlongWord):IppStatus; }
{ function ippSetDenormAreZeros(value:longint):IppStatus; }
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsGetLibVersion
// Purpose: get the library version
// Parameters:
// Returns: pointer to structure describing version of the ipps library
//
// Notes: don't free the pointer
*)
{ function ippsGetLibVersion:PIppLibraryVersion; }
(* /////////////////////////////////////////////////////////////////////////////
// Functions to allocate and free memory
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsMalloc
// Purpose: 32-byte aligned memory allocation
// Parameter:
// len number of elements (according to their type)
// Returns: pointer to allocated memory
//
// Notes: the memory allocated by ippsMalloc has to be free by ippsFree
// function only.
*)
function ippsMalloc(len:int64):pointer;overload;
{ function ippsMalloc_16u(len:longint):PIpp16u; }
{ function ippsMalloc_32u(len:longint):PIpp32u; }
{ function ippsMalloc_8s(len:longint):PIpp8s; }
{ function ippsMalloc_16s(len:longint):PIpp16s; }
{ function ippsMalloc_32s(len:longint):PIpp32s; }
{ function ippsMalloc_64s(len:longint):PIpp64s; }
{ function ippsMalloc_32f(len:longint):PIpp32f; }
{ function ippsMalloc_64f(len:longint):PIpp64f; }
{ function ippsMalloc_8sc(len:longint):PIpp8sc; }
{ function ippsMalloc_16sc(len:longint):PIpp16sc; }
{ function ippsMalloc_32sc(len:longint):PIpp32sc; }
{ function ippsMalloc_64sc(len:longint):PIpp64sc; }
{ function ippsMalloc_32fc(len:longint):PIpp32fc; }
{ function ippsMalloc_64fc(len:longint):PIpp64fc; }
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFree
// Purpose: free memory allocated by the ippsMalloc functions
// Parameter:
// ptr pointer to the memory allocated by the ippsMalloc functions
//
// Notes: use the function to free memory allocated by ippsMalloc_*
*)
{ procedure ippsFree(ptr:pointer); }
(* /////////////////////////////////////////////////////////////////////////////
// Vector Initialization functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsCopy
// Purpose: copy data from source to destination vector
// Parameters:
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsCopy(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsCopy(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsCopy(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsCopy(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsCopy(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsCopy(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsCopy(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsMove
// Purpose: The ippsMove function copies "len" elements from src to dst.
// If some regions of the source area and the destination overlap,
// ippsMove ensures that the original source bytes in the overlapping
// region are copied before being overwritten.
//
// Parameters:
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsMove(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsMove(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsMove(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsMove(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMove(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsMove(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsMove(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsZero
// Purpose: set elements of the vector to zero of corresponding type
// Parameters:
// pDst pointer to the destination vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsZero(pDst: pointer;len: int64):IppStatus;overload;
function ippsZero(pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsZero(pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsZero(pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsZero(pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsZero(pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsZero(pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsZero(pDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsSet
// Purpose: set elements of the destination vector to the value
// Parameters:
// val value to set the elements of the vector
// pDst pointer to the destination vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsNoErr otherwise
*)
function ippsSet(val:Ipp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsSet(val:Ipp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsSet(val:Ipp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsSet(val:Ipp32s;pDst:PIpp32s;len:longint):IppStatus;overload;
function ippsSet(val:Ipp32sc;pDst:PIpp32sc;len:longint):IppStatus;overload;
function ippsSet(val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSet(val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSet(val:Ipp64s;pDst:PIpp64s;len:longint):IppStatus;overload;
function ippsSet(val:Ipp64sc;pDst:PIpp64sc;len:longint):IppStatus;overload;
function ippsSet(val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSet(val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Name: ippsRandUniform_Direct_16s, ippsRandUniform_Direct_32f, ippsRandUniform_Direct_64f
//
// Purpose: Makes pseudo-random samples with a uniform distribution and places them in
// the vector.
//
//
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr The pointer to vector is NULL
// ippStsBadSizeErr The length of the vector is less or equal zero
//
// Arguments:
// low The lower bounds of the uniform distributions range.
// high The upper bounds of the uniform distributions range.
// pSeed The pointer to the seed value used by the pseudo-random number
// generation algorithm.
// pSrcDst The pointer to vector
// len Vector's length
*)
function ippsRandUniform_Direct(pDst:PIpp16s;len:longint;low:Ipp16s;high:Ipp16s;pSeed:PlongWord):IppStatus;overload;
function ippsRandUniform_Direct(pDst:PIpp32f;len:longint;low:Ipp32f;high:Ipp32f;pSeed:PlongWord):IppStatus;overload;
function ippsRandUniform_Direct(pDst:PIpp64f;len:longint;low:Ipp64f;high:Ipp64f;pSeed:PlongWord):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Name: ippsRandGauss_Direct_16s, ippsRandGauss_Direct_32f, ippsRandGauss_Direct_64f
//
// Purpose: Makes pseudo-random samples with a Normal distribution distribution and places
// them in the vector.
//
//
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr The pointer to vector is NULL
// ippStsBadSizeErr The length of the vector is less or equal zero
//
// Arguments:
// mean The mean of the Normal distribution.
// stdev The standard deviation of the Normal distribution.
// pSeed The pointer to the seed value used by the pseudo-random number
// generation algorithm.
// pSrcDst The pointer to vector
// len Vector's length
*)
function ippsRandGauss_Direct(pDst:PIpp16s;len:longint;mean:Ipp16s;stdev:Ipp16s;pSeed:PlongWord):IppStatus;overload;
function ippsRandGauss_Direct(pDst:PIpp32f;len:longint;mean:Ipp32f;stdev:Ipp32f;pSeed:PlongWord):IppStatus;overload;
function ippsRandGauss_Direct(pDst:PIpp64f;len:longint;mean:Ipp64f;stdev:Ipp64f;pSeed:PlongWord):IppStatus;overload;
(* ///////////////////////////////////////////////////////////////////////// *)
(* #if !defined( _OWN_BLDPCS )
struct RandUniState_8u;
struct RandUniState_16s;
struct RandUniState_32f;
typedef struct RandUniState_8u IppsRandUniState_8u;
typedef struct RandUniState_16s IppsRandUniState_16s;
typedef struct RandUniState_32f IppsRandUniState_32f;
struct RandGaussState_8u;
struct RandGaussState_16s;
struct RandGaussState_32f;
typedef struct RandGaussState_8u IppsRandGaussState_8u;
typedef struct RandGaussState_16s IppsRandGaussState_16s;
typedef struct RandGaussState_32f IppsRandGaussState_32f;
#endif *)
(* /////////////////////////////////////////////////////////////////////////
// Name: ippsRandUniformInitAlloc_8u, ippsRandUniformInitAlloc_16s,
// ippsRandUniformInitAlloc_32f
// Purpose: Allocate and initializate parameters for the generator
// of noise with uniform distribution.
// Returns:
// Parameters:
// pRandUniState A pointer to the structure containing parameters for the
// generator of noise.
// low The lower bounds of the uniform distribution’s range.
// high The upper bounds of the uniform distribution’s range.
// seed The seed value used by the pseudo-random number generation
// algorithm.
//
// Returns:
// ippStsNullPtrErr pRandUniState==NULL
// ippMemAllocErr Can not allocate random uniform state
// ippStsNoErr No errors
//
*)
function ippsRandUniformInitAlloc(var pRandUniState:PIppsRandUniState_8u;low:Ipp8u;high:Ipp8u;seed:longWord):IppStatus;overload;
function ippsRandUniformInitAlloc(var pRandUniState:PIppsRandUniState_16s;low:Ipp16s;high:Ipp16s;seed:longWord):IppStatus;overload;
function ippsRandUniformInitAlloc(var pRandUniState:PIppsRandUniState_32f;low:Ipp32f;high:Ipp32f;seed:longWord):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////
// Name: ippsRandUniform_8u, ippsRandUniform_16s,
// ippsRandUniform_32f
// Purpose: Makes pseudo-random samples with a uniform distribution
// and places them in the vector.
// Parameters:
// pDst The pointer to vector
// len Vector's length
// pRandUniState A pointer to the structure containing parameters for the
// generator of noise
// Returns:
// ippStsNullPtrErr pRandUniState==NULL
// ippStsContextMatchErr pState->idCtx != idCtxRandUni
// ippStsNoErr No errors
*)
function ippsRandUniform(pDst:PIpp8u;len:longint;pRandUniState:PIppsRandUniState_8u):IppStatus;overload;
function ippsRandUniform(pDst:PIpp16s;len:longint;pRandUniState:PIppsRandUniState_16s):IppStatus;overload;
function ippsRandUniform(pDst:PIpp32f;len:longint;pRandUniState:PIppsRandUniState_32f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////
// Name: ippsRandUniformFree_8u, ippsRandUniformFree_16s
// ippsRandUniformFree_32f
// Purpose: Close random uniform state
//
// Parameters:
// pRandUniState Pointer to the random uniform state
//
// Returns:
// ippStsNullPtrErr pState==NULL
// ippStsContextMatchErr pState->idCtx != idCtxRandUni
// ippStsNoErr, No errors
*)
function ippsRandUniformFree(pRandUniState:PIppsRandUniState_8u):IppStatus;overload;
function ippsRandUniformFree(pRandUniState:PIppsRandUniState_16s):IppStatus;overload;
function ippsRandUniformFree(pRandUniState:PIppsRandUniState_32f):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// Name: ippsRandGaussInitAlloc_8u, ippsRandGaussInitAlloc_16s,
// ippsRandGaussInitAlloc_32f
// Purpose: Allocate and initializate parameters for the generator of noise.
// Returns:
// Parameters:
// pRandGaussState A pointer to the structure containing parameters for the
// generator of noise.
// mean The mean of the normal distribution.
// stdDev The standard deviation of the normal distribution.
// seed The seed value used by the pseudo-random number
//
// Returns:
// ippStsNullPtrErr pRandGaussState==NULL
// ippMemAllocErr Can not allocate normal random state
// ippStsNoErr No errors
//
*)
function ippsRandGaussInitAlloc(var pRandGaussState:PIppsRandGaussState_8u;mean:Ipp8u;stdDev:Ipp8u;seed:longWord):IppStatus;overload;
function ippsRandGaussInitAlloc(var pRandGaussState:PIppsRandGaussState_16s;mean:Ipp16s;stdDev:Ipp16s;seed:longWord):IppStatus;overload;
function ippsRandGaussInitAlloc(var pRandGaussState:PIppsRandGaussState_32f;mean:Ipp32f;stdDev:Ipp32f;seed:longWord):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////
// Name: ippsRandGauss_8u, ippsRandGauss_16s,
// ippsRandGauss_32f
// Purpose: Makes pseudo-random samples with a normal distribution
// and places them in the vector.
// Parameters:
// pDst The pointer to vector
// len Vector's length
// pRandUniState A pointer to the structure containing parameters
// for the generator of noise
// ippStsContextMatchErr pState->idCtx != idCtxRandGauss
// Returns:
// ippStsNullPtrErr pRandGaussState==NULL
// ippStsNoErr No errors
*)
function ippsRandGauss(pDst:PIpp8u;len:longint;pRandGaussState:PIppsRandGaussState_8u):IppStatus;overload;
function ippsRandGauss(pDst:PIpp16s;len:longint;pRandGaussState:PIppsRandGaussState_16s):IppStatus;overload;
function ippsRandGauss(pDst:PIpp32f;len:longint;pRandGaussState:PIppsRandGaussState_32f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////
// Name: ippsRandGaussFree_8u, ippsRandGaussFree_16s,
// ippsRandGaussFree_32f
// Purpose: Close random normal state
//
// Parameters:
// pRandUniState Pointer to the random normal state
//
// Returns:
// ippStsNullPtrErr pState==NULL
// ippStsContextMatchErr pState->idCtx != idCtxRandGauss
// ippStsNoErr, No errors
*)
function ippsRandGaussFree(pRandGaussState:PIppsRandGaussState_8u):IppStatus;overload;
function ippsRandGaussFree(pRandGaussState:PIppsRandGaussState_16s):IppStatus;overload;
function ippsRandGaussFree(pRandGaussState:PIppsRandGaussState_32f):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Name: ippsRandGaussGetSize_16s
//
// Purpose: Gaussian sequence generator state variable size -
// computes the size,in bytes,
// of the state variable structure ippsRandGaussState_16s.
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr pRandGaussStateSize==NULL
// Arguments:
// pRandGaussStateSize pointer to the computed values of the size
// of the structure ippsRandGaussState_16s.
*)
function ippsRandGaussGetSize(pRandGaussStateSize:Plongint):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////////////////
// Name: ippsRandGaussInit_16s
// Purpose: Initializes the Gaussian sequence generator state structure with
// given parameters (mean, variance, seed).
// Parameters:
// pRandGaussState A pointer to the structure containing parameters for the
// generator of noise.
// mean Mean of the normal distribution.
// stdDev Standard deviation of the normal distribution.
// seed Seed value used by the pseudo-random number generator
//
// Returns:
// ippStsNullPtrErr pRandGaussState==NULL
// ippMemAllocErr Can not allocate normal random state
// ippStsNoErr No errors
//
*)
function ippsRandGaussInit(pRandGaussState:PIppsRandGaussState_16s;mean:Ipp16s;stdDev:Ipp16s;seed:longWord):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Name: ippsRandUniformGetSize_16s
//
// Purpose: Uniform sequence generator state variable size -
// computes the size,in bytes,
// of the state variable structure ippsRandIniState_16s.
//
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr pRandUniformStateSize==NULL
// Arguments:
// pRandGaussStateSize pointer to the computed value of the size
// of the structure ippsRandUniState_16s.
*)
function ippsRandUniformGetSize(pRandUniformStateSize:Plongint):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////////////////
// Name: ippsRandUniformInit_16s
// Purpose: Initializes the uniform sequence generator state structure with
// given parameters (boundaries, seed)
// Parameters:
// pRandUniState Pointer to the structure containing parameters for the
// generator of noise.
// low Lower bound of the uniform distribution's range.
// high Upper bounds of the uniform distribution's range.
// seed Seed value used by the pseudo-random number generation
// algorithm.
//
*)
function ippsRandUniformInit(pRandUniState:PIppsRandUniState_16s;low:Ipp16s;high:Ipp16s;seed:longWord):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////
// Name: ippsVectorJaehne
// Purpose: creates Jaehne vector
//
// Parameters:
// pDst the pointer to the destination vector
// len length of the vector
// magn magnitude of the signal
//
// Return:
// ippStsNoErr indicates no error
// ippStsNullPtrErr indicates an error when the pDst pointer is NULL
// ippStsBadSizeErr indicates an error when len is less or equal zero
// ippStsJaehneErr indicates an error when magnitude value is negative
//
// Notes: pDst[n] = magn*sin(0.5*pi*n^2/len), n=0,1,2,..len-1.
//
*)
function ippsVectorJaehne(pDst:PIpp8u;len:longint;magn:Ipp8u):IppStatus;overload;
function ippsVectorJaehne(pDst:PIpp8s;len:longint;magn:Ipp8s):IppStatus;overload;
function ippsVectorJaehne(pDst:PIpp16u;len:longint;magn:Ipp16u):IppStatus;overload;
function ippsVectorJaehne(pDst:PIpp16s;len:longint;magn:Ipp16s):IppStatus;overload;
function ippsVectorJaehne(pDst:PIpp32u;len:longint;magn:Ipp32u):IppStatus;overload;
function ippsVectorJaehne(pDst:PIpp32s;len:longint;magn:Ipp32s):IppStatus;overload;
function ippsVectorJaehne(pDst:PIpp32f;len:longint;magn:Ipp32f):IppStatus;overload;
function ippsVectorJaehne(pDst:PIpp64f;len:longint;magn:Ipp64f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsTone_Direct
// Purpose: generates a tone
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of vector is less or equal zero
// ippStsToneMagnErr The magn value is less than or equal to zero
// ippStsToneFreqErr The rFreq value is less than 0 or greater than or equal to 0.5
// for real tone and 1.0 for complex tone
// ippStsTonePhaseErr The phase value is less 0 or greater or equal 2*PI
// Parameters:
// magn Magnitude of the tone; that is, the maximum value
// attained by the wave
// rFreq Frequency of the tone relative to the sampling
// frequency. It must be in range [0.0, 0.5) for real, and
// [0.0, 1.0) for complex tone
// pPhase Phase of the tone relative to a cosinewave. It must
// be in range [0.0, 2*PI).
// pDst Pointer to the destination vector.
// len Length of the vector
// hint Suggests using specific code
// Notes:
// for real: pDst[i] = magn * cos(IPP_2PI * rfreq * i + phase);
// for cplx: pDst[i].re = magn * cos(IPP_2PI * rfreq * i + phase);
// pDst[i].im = magn * sin(IPP_2PI * rfreq * i + phase);
*)
function ippsTone_Direct(pDst:PIpp32f;len:longint;magn:single;rFreq:single;pPhase:Psingle;hint:IppHintAlgorithm):IppStatus;overload;
function ippsTone_Direct(pDst:PIpp32fc;len:longint;magn:single;rFreq:single;pPhase:Psingle;hint:IppHintAlgorithm):IppStatus;overload;
function ippsTone_Direct(pDst:PIpp64f;len:longint;magn:double;rFreq:double;pPhase:Pdouble;hint:IppHintAlgorithm):IppStatus;overload;
function ippsTone_Direct(pDst:PIpp64fc;len:longint;magn:double;rFreq:double;pPhase:Pdouble;hint:IppHintAlgorithm):IppStatus;overload;
function ippsTone_Direct(pDst:PIpp16s;len:longint;magn:Ipp16s;rFreq:single;pPhase:Psingle;hint:IppHintAlgorithm):IppStatus;overload;
function ippsTone_Direct(pDst:PIpp16sc;len:longint;magn:Ipp16s;rFreq:single;pPhase:Psingle;hint:IppHintAlgorithm):IppStatus;overload;
(* #if !defined ( _OWN_BLDPCS )
struct ToneState_16s;
typedef struct ToneState_16s IppToneState_16s;
#endif *)
(*
// Name: ippsToneInitAllocQ15_16s
// Purpose: Allocates memory for the structure IppToneState_16s,
// initializes it with a set of cosinwave parameters (magnitude,
// frequency, phase).
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Double pointer to pToneState is NULL
// ippStsToneMagnErr The magn value is less than or equal to zero
// ippStsToneFreqErr The freqQ15 value is less than 0 or greater than 16383
// ippStsTonePhaseErr The phaseQ15 value is less than 0 or greater than 205886
// Parameters:
// **pToneState Double pointer to the structure IppToneState_16s.
// magn Magnitude of the tone; that is, the maximum value
// attained by the wave.
// rFreqQ15 Frequency of the tone relative to the sampling
// frequency. It must be between 0 and 16383
// phaseQ15 Phase of the tone relative to a cosinewave. It must
// be between 0 and 205886.
// Notes:
*)
function ippsToneInitAllocQ15(var pToneState:PIppToneState_16s;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s):IppStatus;overload;
(*
// Name: ippsToneFree_16s
// Purpose: Frees memory, which was allocated
// for the structure IppToneState_16s.
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Pointer to pToneState is NULL
// Parameters:
// *pToneState Pointer to the structure IppToneState_16s.
// Notes:
*)
{ function ippsToneFree(pToneState:PIppToneState_16s):IppStatus; }
(*
// Name: ippsToneGetStateSizeQ15_16s
// Purpose: Computes the size, in bytes, of the structure IppToneState_16s
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Pointer to pToneState size is NULL
// Parameters:
// *pToneStateSize Pointer to the computed value of the size
// of the structure IppToneState_16s.
// Notes:
*)
function ippsToneGetStateSizeQ15(pToneStateSize:Plongint):IppStatus;overload;
(*
// Name: ippsToneInitQ15_16s
// Purpose: initializes the structure IppToneState_16s with
// given set of cosinewave parameters (magnitude,
// frequency, phase)
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Pointer to pToneState is NULL
// ippStsToneMagnErr The magn value is less than or equal to zero
// ippStsToneFreqErr The rFreqQ15 value is less than 0 or greater 16383
// ippStsTonePhaseErr The phaseQ15 value is less than 0 or greater 205886
// Parameters:
// *pToneState Pointer to the structure IppToneState_16s.
// magn Magnitude of the tone; that is, the maximum value
// attained by the wave.
// rFreqQ15 Frequency of the tone relative to the sampling
// frequency. It must be between 0 and 16383
// phaseQ15 Phase of the tone relative to a cosinewave. It must
// be between 0 and 205886.
// Notes:
*)
function ippsToneInitQ15(pToneState:PIppToneState_16s;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s):IppStatus;overload;
(*
// Name: ippsToneQ15_16s
// Purpose: generates a tone
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr One of the specified pointers is NULL
// ippStsSizeErr len is less than or equal to 0
// Parameters:
// pDst Pointer to the destination vector.
// len Length of the vector
// *pToneState Pointer to the structure IppToneState_16s.
// Notes:
*)
function ippsToneQ15(pDst:PIpp16s;len:longint;pToneState:PIppToneState_16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsTriangle_Direct
// Purpose: generates a Triangle
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of vector is less or equal zero
// ippStsTrnglMagnErr The magn value is less or equal to zero
// ippStsTrnglFreqErr The rfreq value is less 0 or greater or equal 0.5
// ippStsTrnglPhaseErr The phase value is less 0 or greater or equal 2*PI
// ippStsTrnglAsymErr The asym value is less -PI or greater or equal PI
// Parameters:
// magn Magnitude of the Triangle; that is, the maximum value
// attained by the wave
// rFreq Frequency of the Triangle relative to the sampling
// frequency. It must be in range [0.0, 0.5)
// pPhase POinter to the phase of the Triangle relative to acosinewave. It must
// be in range [0.0, 2*PI)
// asym Asymmetry of a triangle. It must be in range [-PI,PI).
// pDst Pointer to destination vector.
// len Length of the vector
*)
function ippsTriangle_Direct(pDst:PIpp64f;len:longint;magn:double;rFreq:double;asym:double;pPhase:Pdouble):IppStatus;overload;
function ippsTriangle_Direct(pDst:PIpp64fc;len:longint;magn:double;rFreq:double;asym:double;pPhase:Pdouble):IppStatus;overload;
function ippsTriangle_Direct(pDst:PIpp32f;len:longint;magn:single;rFreq:single;asym:single;pPhase:Psingle):IppStatus;overload;
function ippsTriangle_Direct(pDst:PIpp32fc;len:longint;magn:single;rFreq:single;asym:single;pPhase:Psingle):IppStatus;overload;
function ippsTriangle_Direct(pDst:PIpp16s;len:longint;magn:Ipp16s;rFreq:single;asym:single;pPhase:Psingle):IppStatus;overload;
function ippsTriangle_Direct(pDst:PIpp16sc;len:longint;magn:Ipp16s;rFreq:single;asym:single;pPhase:Psingle):IppStatus;overload;
(* #if !defined ( _OWN_BLDPCS )
// IPP Context triangle identification
struct TriangleState_16s;
typedef struct TriangleState_16s IppTriangleState_16s;
#endif *)
(*
// Name: ippsTriangleInitAllocQ15_16s
// Purpose: Allocates memory for the structure IppTriangleState_16s,
// initializes it with a set of wave parameters (magnitude,
// frequency, phase, asymmetry).
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Double pointer to pTriangleState is NULL
// ippStsTriangleMagnErr The magn value is less than or equal to zero
// ippStsTriangleFreqErr The freqQ15 value is less than 0 or greater than 16383
// ippStsTriangleAsymErr The phaseQ15 value is less tahn 0 or greater than 205886
// ippStsTrianglePhaseErr The asymQ15 value is less than -102943 or greater than 102943
// Parameters:
// **pTriangleState Double pointer to the structure IppTriangleState_16s.
// magn Magnitude of the Triangle; that is, the maximum value
// attained by the wave.
// rFreqQ15 Frequency of the Triangle relative to the sampling
// frequency. It must be between 0 and 16383
// phaseQ15 Phase of the Triangle relative to a wave. It must
// be between 0 and 205886.
// asymQ15 Asymmetry of the Triangle relative to a wave. It must
// be between -102943 and 102943.
// Notes:
*)
function ippsTriangleInitAllocQ15(var pTriangleState:PIppTriangleState_16s;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s;asymQ15:Ipp32s):IppStatus;overload;
(*
// Name: ippsTriangleFree_16s
// Purpose: Frees memory, which was allocated
// for the structure IppTriangleState_16s.
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Pointer to pTriangleState is NULL
// Parameters:
// *pTriangleState Pointer to the structure IppTriangleState_16s.
// Notes:
*)
{ function ippsTriangleFree(pTriangleState:PIppTriangleState_16s):IppStatus; }
(*
// Name: ippsTriangleGetStateSizeQ15_16s
// Purpose: Computes the size, in bytes, of the structure IppTriangleState_16s
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Pointer to pTriangleState size is NULL
// Parameters:
// *pTriangleStateSize Pointer to the computed value of the size
// of the structure IppTriangleState_16s.
// Notes:
*)
function ippsTriangleGetStateSizeQ15(pTriangleStateSize:Plongint):IppStatus;overload;
(*
// Name: ippsTriangleInitQ15_16s
// Purpose: Initializes the structure IppTriangleState_16s
// with a given set of cosinewave parameters (magnitude,
// frequency, phase)
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr The pointer to pTriangleState is NULL
// ippStsTrngleMagnErr The magn value is less than or equal to zero
// ippStsTrngleFreqErr The freqQ15 value is less than 0 or greater than 16383
// ippStsTrnglePhaseErr The phaseQ15 value is less than 0 or greater than 205886
// ippStsTrngleAsymErr The asymQ15 value is less than -102943 or greater than 102943
// Parameters:
// *pTriangleState Pointer to the structure IppTriangleState_16s.
// magn Magnitude of the Triangle; that is, the maximum value
// attained by the wave.
// rFreqQ15 Frequency of the Triangle relative to the sampling
// frequency. It must be between 0 and 16383
// phaseQ15 Phase of the Triangle relative to a wave. It must
// be between 0 and 205886.
// asymQ15 Asymmetry of the Triangle relative to a wave. It must
// be between -102943 and 102943.
// Notes:
*)
function ippsTriangleInitQ15(pTriangleState:PIppTriangleState_16s;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s;asymQ15:Ipp32s):IppStatus;overload;
(*
// Name: ippsTriangleQ15_16s
// Purpose: generates a Triangle
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// Parameters:
// pDst The pointer to destination vector.
// len The length of vector
// *pTriangleState Pointer to the structure IppTriangleState_16s.
// Notes:
*)
function ippsTriangleQ15(pDst:PIpp16s;len:longint;pTriangleState:PIppTriangleState_16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsToneQ15_Direct_16s
// Purpose: generates a tone
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr The pointer to the destination vector is NULL
// ippStsSizeErr The length of the vector is less than or equal to zero
// ippStsToneMagnErr The magn value is less than or equal to zero
// ippStsToneFreqErr The rFreqQ15 value is less than 0 or greater than 16383
// ippStsTonePhaseErr The phaseQ15 value is less than 0 or greater than 205886
// Parameters:
// pDst Pointer to the destination vector.
// len Length of the vector
// magn Magnitude of the tone; that is, the maximum value
// attained by the wave.It must be between 0 and 32767
// rFreqQ15 Frequency of the tone relative to the sampling
// frequency. It must be between 0 and 16383
// phaseQ15 Phase of the tone relative to a cosinewave. It must
// be between 0 and 205886.
*)
function ippsToneQ15_Direct(pDst:PIpp16s;len:longint;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsTriangleQ15_Direct_16s
// Purpose: generates a Triangle
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr The pointer to the destination vectro is NULL
// ippStsSizeErr The length of the vector is less than or equal to zero
// ippStsTriangleMagnErr The magn value is less than or equal to zero
// ippStsTriangleFreqErr The rFfreqQ15 value is less than 0 or greater than 16383
// ippStsTriangleAsymErr The asymQ15 value is less than 0 or greater than 205886
// ippStsTrianglePhaseErr The phaseQ15 value is less than -102943 or greater tahn 102943
// Parameters:
// pDst Pointer to the destination vector.
// len Length of the vector
// mag Magnitude of the Triangle; that is, the maximum value
// attained by the wave. It must be between 0 and 32767.
// rFreqQ15 Frequency of the Triangle relative to the sampling
// frequency. It must be between 0 and 16383
// phaseQ15 The phase of the Triangle relative to a wave. It must
// be between 0 and 205886.
// asymQ15 The asymmmetry of the Triangle relative to a wave. It must
// be between -102943 and 102943.
// Notes:
*)
function ippsTriangleQ15_Direct(pDst:PIpp16s;len:longint;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s;asymQ15:Ipp32s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////
// Name: ippsVectorRamp_8u, ippsVectorRamp_8s,
// ippsVectorRamp_16u, ippsVectorRamp_16s,
// ippsVectorRamp_32u, ippsVectorRamp_32s,
// ippsVectorRamp_32f, ippsVectorRamp_64f
// Purpose: Creates ramp vector
//
// Parameters:
// pDst A pointer to the destination vector
// len Vector's length
// offset Offset value
// slope Slope coefficient
//
// Return:
// ippStsNoErr No error
// ippStsNullPtrErr pDst pointer is NULL
// ippStsBadSizeErr Vector's length is less or equal zero
// ippStsNoErr No error
//
// Notes: Dst[n] = offset + slope * n
//
*)
function ippsVectorRamp(pDst:PIpp8u;len:longint;offset:single;slope:single):IppStatus;overload;
function ippsVectorRamp(pDst:PIpp8s;len:longint;offset:single;slope:single):IppStatus;overload;
function ippsVectorRamp(pDst:PIpp16u;len:longint;offset:single;slope:single):IppStatus;overload;
function ippsVectorRamp(pDst:PIpp16s;len:longint;offset:single;slope:single):IppStatus;overload;
function ippsVectorRamp(pDst:PIpp32u;len:longint;offset:single;slope:single):IppStatus;overload;
function ippsVectorRamp(pDst:PIpp32s;len:longint;offset:single;slope:single):IppStatus;overload;
function ippsVectorRamp(pDst:PIpp32f;len:longint;offset:single;slope:single):IppStatus;overload;
function ippsVectorRamp(pDst:PIpp64f;len:longint;offset:single;slope:single):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Convert functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsReal
// Purpose: form vector with real part of the input complex vector
// Parameters:
// pSrc pointer to the input complex vector
// pDstRe pointer to the output vector to store the real part
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsReal(pSrc:PIpp64fc;pDstRe:PIpp64f;len:longint):IppStatus;overload;
function ippsReal(pSrc:PIpp32fc;pDstRe:PIpp32f;len:longint):IppStatus;overload;
function ippsReal(pSrc:PIpp16sc;pDstRe:PIpp16s;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsImag
// Purpose: form vector with imaginary part of the input complex vector
// Parameters:
// pSrc pointer to the input complex vector
// pDstRe pointer to the output vector to store the real part
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsImag(pSrc:PIpp64fc;pDstIm:PIpp64f;len:longint):IppStatus;overload;
function ippsImag(pSrc:PIpp32fc;pDstIm:PIpp32f;len:longint):IppStatus;overload;
function ippsImag(pSrc:PIpp16sc;pDstIm:PIpp16s;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsCplxToReal
// Purpose: form the real and imaginary parts of the input complex vector
// Parameters:
// pSrc pointer to the input complex vector
// pDstRe pointer to output vector to store the real part
// pDstIm pointer to output vector to store the imaginary part
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsCplxToReal(pSrc:PIpp64fc;pDstRe:PIpp64f;pDstIm:PIpp64f;len:longint):IppStatus;overload;
function ippsCplxToReal(pSrc:PIpp32fc;pDstRe:PIpp32f;pDstIm:PIpp32f;len:longint):IppStatus;overload;
function ippsCplxToReal(pSrc:PIpp16sc;pDstRe:PIpp16s;pDstIm:PIpp16s;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsRealToCplx
// Purpose: form complex vector from the real and imaginary components
// Parameters:
// pSrcRe pointer to the input vector with real part, may be NULL
// pSrcIm pointer to the input vector with imaginary part, may be NULL
// pDst pointer to the output complex vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer to the destination data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
//
// Notes: one of the two input pointers may be NULL. In this case
// the corresponding values of the output complex elements is 0
*)
function ippsRealToCplx(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsRealToCplx(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsRealToCplx(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp16sc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsConj, ippsConjFlip
// Purpose: complex conjugate data vector
// Parameters:
// pSrc pointer to the input vetor
// pDst pointer to the output vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
// Notes:
// the ConjFlip version conjugates and stores result in reverse order
*)
function ippsConj(pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsConj(pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsConj(pSrcDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsConj(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsConj(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsConj(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsConjFlip(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsConjFlip(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsConjFlip(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsConjCcs(pSrcDst:PIpp64fc;lenDst:longint):IppStatus;overload;
function ippsConjCcs(pSrcDst:PIpp32fc;lenDst:longint):IppStatus;overload;
function ippsConjCcs(pSrcDst:PIpp16sc;lenDst:longint):IppStatus;overload;
function ippsConjCcs(pSrc:PIpp64f;pDst:PIpp64fc;lenDst:longint):IppStatus;overload;
function ippsConjCcs(pSrc:PIpp32f;pDst:PIpp32fc;lenDst:longint):IppStatus;overload;
function ippsConjCcs(pSrc:PIpp16s;pDst:PIpp16sc;lenDst:longint):IppStatus;overload;
function ippsConjPack(pSrcDst:PIpp64fc;lenDst:longint):IppStatus;overload;
function ippsConjPack(pSrcDst:PIpp32fc;lenDst:longint):IppStatus;overload;
function ippsConjPack(pSrcDst:PIpp16sc;lenDst:longint):IppStatus;overload;
function ippsConjPack(pSrc:PIpp64f;pDst:PIpp64fc;lenDst:longint):IppStatus;overload;
function ippsConjPack(pSrc:PIpp32f;pDst:PIpp32fc;lenDst:longint):IppStatus;overload;
function ippsConjPack(pSrc:PIpp16s;pDst:PIpp16sc;lenDst:longint):IppStatus;overload;
function ippsConjPerm(pSrcDst:PIpp64fc;lenDst:longint):IppStatus;overload;
function ippsConjPerm(pSrcDst:PIpp32fc;lenDst:longint):IppStatus;overload;
function ippsConjPerm(pSrcDst:PIpp16sc;lenDst:longint):IppStatus;overload;
function ippsConjPerm(pSrc:PIpp64f;pDst:PIpp64fc;lenDst:longint):IppStatus;overload;
function ippsConjPerm(pSrc:PIpp32f;pDst:PIpp32fc;lenDst:longint):IppStatus;overload;
function ippsConjPerm(pSrc:PIpp16s;pDst:PIpp16sc;lenDst:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert
// Purpose: Converts integer data to floating point data
// Parameters:
// pSrc pointer to integer data to be converted
// pDst pointer to the destination vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsConvert(pSrc:PIpp8s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp16s;pDst:PIpp32s;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp8s;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp8u;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp16u;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp32f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert
// Purpose: convert floating point data to integer data
// Parameters:
// pSrc pointer to the input floating point data to be converted
// pDst pointer to destination vector
// len length of the vectors
// rndmode rounding mode, rndZero or rndNear
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
// Note:
// an out-of-range result will be saturated
*)
function ippsConvert(pSrc:PIpp32f;pDst:PIpp8s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp8u;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp16s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp16u;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp64f;pDst:PIpp32s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp32s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert_32f64f
// Purpose: Converts floating point data Ipp32f
// to floating point data Ipp64f
// Parameters:
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsConvert(pSrc:PIpp32f;pDst:PIpp64f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert_64f32f
// Purpose: Converts floating point data Ipp64f
// to floating point data Ipp32f
// Parameters:
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
// Note:
// an out-of-range result will be saturated
*)
function ippsConvert(pSrc:PIpp64f;pDst:PIpp32f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert
// Purpose: Converts integer data to floating point data
// Parameters:
// pSrc pointer to integer data to be converted
// pDst pointer to the destination vector
// len length of the vectors
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsConvert(pSrc:PIpp16s;pDst:PIpp32f;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp16s;pDst:PIpp64f;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp32f;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp64f;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert
// Purpose: Converts 24u data to 32u or 32f data.
// Converts 32u or 32f data to 24u data.
// Converts 24s data to 32s or 32f data.
// Converts 32s or 32f data to 24s data.
// Parameters:
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsConvert(pSrc:PIpp8u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
{ function ippsConvert_24u32f(pSrc:PIpp8u;pDst:PIpp32f;len:longint):IppStatus; }
function ippsConvert(pSrc:PIpp32f;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp8u;pDst:PIpp32s;len:longint):IppStatus;overload;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
{ function ippsConvert_24s32f(pSrc:PIpp8u;pDst:PIpp32f;len:longint):IppStatus; }
{ function ippsConvert_32f24s_Sfs(pSrc:PIpp32f;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus; }
(* #if !defined( _OWN_BLDPCS )
typedef Ipp16s Ipp16f;
#endif *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert_16s16f
// Purpose: Converts integer data to floating point data
// Parameters:
// pSrc pointer to integer data to be converted
// pDst pointer to the destination vector
// len length of the vectors
// rndmode rounding mode, rndZero or rndNear
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsConvert(pSrc:PIpp16s;pDst:PIpp16f;len:longint;rndmode:IppRoundMode):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert_16f16s_Sfs
// Purpose: convert floating point data to integer data
// Parameters:
// pSrc pointer to the input floating point data to be converted
// pDst pointer to destination vector
// len length of the vectors
// rndmode rounding mode, rndZero or rndNear
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
// Note:
// an out-of-range result will be saturated
*)
function ippsConvert(pSrc:PIpp16f;pDst:PIpp16s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert_32f16f
// Purpose: Converts floating point data Ipp32f
// to floating point data Ipp16f
// Parameters:
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
// rndmode rounding mode, rndZero or rndNear
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsConvert(pSrc:PIpp32f;pDst:PIpp16f;len:longint;rndmode:IppRoundMode):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConvert_16f32f
// Purpose: Converts floating point data Ipp16f
// to floating point data Ipp32f
// Parameters:
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsConvert(pSrc:PIpp16f;pDst:PIpp32f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsThreshold
// Purpose: execute threshold operation on every element of the vector
// Parameters:
// level level of the threshold operation
// pSrcDst pointer to the vector for in-place operation
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
// relOp comparison mode, cmpLess or cmpGreater
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsThreshNegLevelErr negative level value in complex operation
// ippStsNoErr otherwise
// Notes:
// real data
// cmpLess : pDst[n] = pSrc[n] < level ? level : pSrc[n];
// cmpGreater : pDst[n] = pSrc[n] > level ? level : pSrc[n];
// complex data
// cmpLess : pDst[n] = abs(pSrc[n]) < level ? pSrc[n]*k : pSrc[n];
// cmpGreater : pDst[n] = abs(pSrc[n]) > level ? pSrc[n]*k : pSrc[n];
// where k = level / abs(pSrc[n]);
*)
function ippsThreshold(pSrcDst:PIpp32f;len:longint;level:Ipp32f;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrcDst:PIpp32fc;len:longint;level:Ipp32f;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrcDst:PIpp64f;len:longint;level:Ipp64f;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrcDst:PIpp64fc;len:longint;level:Ipp64f;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrcDst:PIpp16s;len:longint;level:Ipp16s;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrcDst:PIpp16sc;len:longint;level:Ipp16s;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s;relOp:IppCmpOp):IppStatus;overload;
function ippsThreshold(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s;relOp:IppCmpOp):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsThresholdLT
// ippsThresholdGT
// Purpose: execute threshold operation on every element of the vector,
// "less than" for ippsThresoldLT
// "greater then for ippsThresholdGT
// Parameters:
// pSrcDst pointer to the vector for in-place operation
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
// level level of the threshold operation
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsThreshNegLevelErr negative level value in complex operation
// ippStsNoErr otherwise
*)
function ippsThreshold_LT(pSrcDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_LT(pSrcDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_LT(pSrcDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_LT(pSrcDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_LT(pSrcDst:PIpp16s;len:longint;level:Ipp16s):IppStatus;overload;
function ippsThreshold_LT(pSrcDst:PIpp16sc;len:longint;level:Ipp16s):IppStatus;overload;
function ippsThreshold_LT(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_LT(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_LT(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_LT(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_LT(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s):IppStatus;overload;
function ippsThreshold_LT(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s):IppStatus;overload;
function ippsThreshold_LT(pSrcDst:PIpp32s;len:longint;level:Ipp32s):IppStatus;overload;
function ippsThreshold_LT(pSrc:PIpp32s;pDst:PIpp32s;len:longint;level:Ipp32s):IppStatus;overload;
function ippsThreshold_GT(pSrcDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_GT(pSrcDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_GT(pSrcDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_GT(pSrcDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_GT(pSrcDst:PIpp16s;len:longint;level:Ipp16s):IppStatus;overload;
function ippsThreshold_GT(pSrcDst:PIpp16sc;len:longint;level:Ipp16s):IppStatus;overload;
function ippsThreshold_GT(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_GT(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_GT(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_GT(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_GT(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s):IppStatus;overload;
function ippsThreshold_GT(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsThresholdLTValue
// ippsThresholdGTValue
// Purpose: execute threshold operation on every element of the vector with
// replace on value,
// "less than" for ippsThresoldLTValue
// "greater then for ippsThresholdGTValue
// Parameters:
// pSrcDst pointer to the vector for in-place operation
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
// level level of the threshold operation
// value value of replace
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsThreshNegLevelErr negative level value in complex operation
// ippStsNoErr otherwise
*)
function ippsThreshold_LTVal(pSrcDst:PIpp32f;len:longint;level:Ipp32f;value:Ipp32f):IppStatus;overload;
function ippsThreshold_LTVal(pSrcDst:PIpp32fc;len:longint;level:Ipp32f;value:Ipp32fc):IppStatus;overload;
function ippsThreshold_LTVal(pSrcDst:PIpp64f;len:longint;level:Ipp64f;value:Ipp64f):IppStatus;overload;
function ippsThreshold_LTVal(pSrcDst:PIpp64fc;len:longint;level:Ipp64f;value:Ipp64fc):IppStatus;overload;
function ippsThreshold_LTVal(pSrcDst:PIpp16s;len:longint;level:Ipp16s;value:Ipp16s):IppStatus;overload;
function ippsThreshold_LTVal(pSrcDst:PIpp16sc;len:longint;level:Ipp16s;value:Ipp16sc):IppStatus;overload;
function ippsThreshold_LTVal(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f;value:Ipp32f):IppStatus;overload;
function ippsThreshold_LTVal(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f;value:Ipp32fc):IppStatus;overload;
function ippsThreshold_LTVal(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f;value:Ipp64f):IppStatus;overload;
function ippsThreshold_LTVal(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f;value:Ipp64fc):IppStatus;overload;
function ippsThreshold_LTVal(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s;value:Ipp16s):IppStatus;overload;
function ippsThreshold_LTVal(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s;value:Ipp16sc):IppStatus;overload;
function ippsThreshold_GTVal(pSrcDst:PIpp32f;len:longint;level:Ipp32f;value:Ipp32f):IppStatus;overload;
function ippsThreshold_GTVal(pSrcDst:PIpp32fc;len:longint;level:Ipp32f;value:Ipp32fc):IppStatus;overload;
function ippsThreshold_GTVal(pSrcDst:PIpp64f;len:longint;level:Ipp64f;value:Ipp64f):IppStatus;overload;
function ippsThreshold_GTVal(pSrcDst:PIpp64fc;len:longint;level:Ipp64f;value:Ipp64fc):IppStatus;overload;
function ippsThreshold_GTVal(pSrcDst:PIpp16s;len:longint;level:Ipp16s;value:Ipp16s):IppStatus;overload;
function ippsThreshold_GTVal(pSrcDst:PIpp16sc;len:longint;level:Ipp16s;value:Ipp16sc):IppStatus;overload;
function ippsThreshold_GTVal(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f;value:Ipp32f):IppStatus;overload;
function ippsThreshold_GTVal(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f;value:Ipp32fc):IppStatus;overload;
function ippsThreshold_GTVal(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f;value:Ipp64f):IppStatus;overload;
function ippsThreshold_GTVal(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f;value:Ipp64fc):IppStatus;overload;
function ippsThreshold_GTVal(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s;value:Ipp16s):IppStatus;overload;
function ippsThreshold_GTVal(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s;value:Ipp16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsThresholdLTInv
//
// Purpose: replace elements of vector values by their inversion after
// threshold operation
// Parameters:
// level level of threshold operation
// pSrcDst pointer to the vector in in-place operation
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsThreshNegLevelErr negative level value
// ippStsInvZero level value and source element value are zero
// ippStsNoErr otherwise
*)
function ippsThreshold_LTInv(pSrcDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_LTInv(pSrcDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_LTInv(pSrcDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_LTInv(pSrcDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_LTInv(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_LTInv(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;overload;
function ippsThreshold_LTInv(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;overload;
function ippsThreshold_LTInv(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;overload;
(* ///////////////////////////////////////////////////////////////////////////// *)
function ippsThreshold_LTValGTVal(pSrcDst:PIpp32f;len:longint;levelLT:Ipp32f;valueLT:Ipp32f;levelGT:Ipp32f;valueGT:Ipp32f):IppStatus;overload;
function ippsThreshold_LTValGTVal(pSrcDst:PIpp64f;len:longint;levelLT:Ipp64f;valueLT:Ipp64f;levelGT:Ipp64f;valueGT:Ipp64f):IppStatus;overload;
function ippsThreshold_LTValGTVal(pSrc:PIpp32f;pDst:PIpp32f;len:longint;levelLT:Ipp32f;valueLT:Ipp32f;levelGT:Ipp32f;valueGT:Ipp32f):IppStatus;overload;
function ippsThreshold_LTValGTVal(pSrc:PIpp64f;pDst:PIpp64f;len:longint;levelLT:Ipp64f;valueLT:Ipp64f;levelGT:Ipp64f;valueGT:Ipp64f):IppStatus;overload;
function ippsThreshold_LTValGTVal(pSrcDst:PIpp16s;len:longint;levelLT:Ipp16s;valueLT:Ipp16s;levelGT:Ipp16s;valueGT:Ipp16s):IppStatus;overload;
function ippsThreshold_LTValGTVal(pSrc:PIpp16s;pDst:PIpp16s;len:longint;levelLT:Ipp16s;valueLT:Ipp16s;levelGT:Ipp16s;valueGT:Ipp16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsCartToPolar
//
// Purpose: Convert cartesian coordinate to polar. Input data are formed as
// a complex vector.
//
// Parameters:
// pSrc an input complex vector
// pDstMagn an output vector to store the magnitude components
// pDstPhase an output vector to store the phase components (in radians)
// len a length of the array
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of the arrays is less or equal zero
//
*)
function ippsCartToPolar(pSrc:PIpp32fc;pDstMagn:PIpp32f;pDstPhase:PIpp32f;len:longint):IppStatus;overload;
function ippsCartToPolar(pSrc:PIpp64fc;pDstMagn:PIpp64f;pDstPhase:PIpp64f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsCartToPolar
//
// Purpose: Convert cartesian coordinate to polar. Input data are formed as
// two real vectors.
//
// Parameters:
// pSrcRe an input vector containing the coordinates X
// pSrcIm an input vector containing the coordinates Y
// pDstMagn an output vector to store the magnitude components
// pDstPhase an output vector to store the phase components (in radians)
// len a length of the array
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of the arrays is less or equal zero
//
*)
function ippsCartToPolar(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstMagn:PIpp32f;pDstPhase:PIpp32f;len:longint):IppStatus;overload;
function ippsCartToPolar(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstMagn:PIpp64f;pDstPhase:PIpp64f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsPolarToCart
//
// Purpose: Convert polar coordinate to cartesian. Output data are formed as
// a complex vector.
//
// Parameters:
// pDstMagn an input vector containing the magnitude components
// pDstPhase an input vector containing the phase components(in radians)
// pDst an output complex vector to store the cartesian coordinates
// len a length of the arrays
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of the arrays is less or equal zero
//
*)
function ippsPolarToCart(pSrcMagn:PIpp32f;pSrcPhase:PIpp32f;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsPolarToCart(pSrcMagn:PIpp64f;pSrcPhase:PIpp64f;pDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsPolarToCart
//
// Purpose: Convert polar coordinate to cartesian. Output data are formed as
// two real vectors.
//
// Parameters:
// pDstMagn an input vector containing the magnitude components
// pDstPhase an input vector containing the phase components(in radians)
// pSrcRe an output complex vector to store the coordinates X
// pSrcIm an output complex vector to store the coordinates Y
// len a length of the arrays
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of the arrays is less or equal zero
//
*)
function ippsPolarToCart(pSrcMagn:PIpp32f;pSrcPhase:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;len:longint):IppStatus;overload;
function ippsPolarToCart(pSrcMagn:PIpp64f;pSrcPhase:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Companding functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsALawToLin
// Purpose: convert from A-Law to linear PCM value
// Parameters:
// pSrc pointer to the input vector containing A-Law values
// pDst pointer to the output vector for store linear PCM values
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsALawToLin(pSrc:PIpp8u;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsALawToLin(pSrc:PIpp8u;pDst:PIpp16s;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsMuLawToLin
// Purpose: convert from Mu-Law to linear PCM value
// Parameters:
// pSrc pointer to the input vector containing Mu-Law values
// pDst pointer to the output vector for store linear PCM values
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsMuLawToLin(pSrc:PIpp8u;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMuLawToLin(pSrc:PIpp8u;pDst:PIpp16s;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsLinToALaw
// Purpose: convert from linear PCM to A-Law value
// Parameters:
// pSrc pointer to the input vector containing linear PCM values
// pDst pointer to the output vector for store A-Law values
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsLinToALaw(pSrc:PIpp32f;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsLinToALaw(pSrc:PIpp16s;pDst:PIpp8u;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsMuLawToLin
// Purpose: convert from linear PCM to Mu-Law value
// Parameters:
// pSrc pointer to the input vector containing linear PCM values
// pDst pointer to the output vector for store Mu-Law values
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsLinToMuLaw(pSrc:PIpp32f;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsLinToMuLaw(pSrc:PIpp16s;pDst:PIpp8u;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsALawToMuLaw, ippsMuLawToALaw
// Purpose: convert from A-Law to Mu-Law and vice-versa
// Parameters:
// pSrc pointer to the input vector containing A-Law or Mu-Law values
// pDst pointer to the output vector for store Mu-Law or A-Law values
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsALawToMuLaw(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsMuLawToALaw(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsPreemphasize_32f
// Purpose:
// Compute the preemphasizes a single precision real signal.
// Parameters:
// pSrcDst pointer to the vector for in-place operation.
// len length of the input vector.
// val The multiplier to be used in the preemphasis difference equation
// y(n) = x(n) - a * x(n-1) where y is the preemphasized output
// and x is the input. Usually a value of 0.95 is used for speech
// audio signals.
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of the arrays is less or equal zero
*)
function ippsPreemphasize(pSrcDst:PIpp32f;len:longint;val:Ipp32f):IppStatus;overload;
function ippsPreemphasize(pSrcDst:PIpp16s;len:longint;val:Ipp32f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFlip
// Purpose: dst[i] = src[len-i-1], i=0..len-1
// Parameters:
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors, number of items
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsFlip(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsFlip(pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsFlip(pSrc:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsFlip(pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsFlip(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsFlip(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsFlip(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsFlip(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsUpdateLinear_16s32s_I
// Purpose: Calc Update Linear value
// Return:
// IPP_NO_ERR Ok
// IPP_NULL_PTR_ERR Pointer to pSrc or pointer to pSrcDst is NULL
// IPP_BADSIZE_ERR The length of the array is less or equal zero
// Parameters:
// pSrc pointer to vector
// len a length of the array
// pSrcDst pointer to input and output
// srcShiftRight shiftright of src (0<=srcShiftRight<=15)
// alpha weight
// hint code specific use hints
//
*)
function ippsUpdateLinear(pSrc:PIpp16s;len:longint;pSrcDst:PIpp32s;srcShiftRight:longint;alpha:Ipp16s;hint:IppHintAlgorithm):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsUpdatePower_16s32s_I
// Purpose: Calc Update Power value
// Return:
// IPP_NO_ERR Ok
// IPP_NULL_PTR_ERR Pointer to pSrc or pointer to pSrcDst is NULL
// IPP_BADSIZE_ERR The length of the array is less or equal zero
// Parameters:
// pSrc pointer to vector
// len a length of the array
// pSrcDst pointer to input and output
// srcShiftRight shiftright of src (0<=srcShiftRight<=31)
// alpha weight
// hint code specific use hints
//
*)
function ippsUpdatePower(pSrc:PIpp16s;len:longint;pSrcDst:PIpp32s;srcShiftRight:longint;alpha:Ipp16s;hint:IppHintAlgorithm):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsJoin_32f16s_D2L
// Purpose: Join of vectors.
// Parameters:
// pSrc pointer to pointers to the input vectors
// pDst pointer to the output vector
// nChannels number of channels
// chanlen length of the channel
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr nChannels or chanlen are less or equal zero
// ippStsNoErr otherwise
//
*)
function ippsJoin(var pSrc:PIpp32f;nChannels:longint;chanLen:longint;pDst:PIpp16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsSwapBytes
// Purpose: switches from a "big endian" order to the "little endian" order and vice-versa
// Parameters:
// pSrc pointer to the source vector
// pSrcDst pointer to the source/destination vector
// pDst pointer to the destination vector
// len length of the vectors
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsSwapBytes(pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsSwapBytes(pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsSwapBytes(pSrcDst:PIpp32u;len:longint):IppStatus;overload;
function ippsSwapBytes(pSrc:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsSwapBytes(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsSwapBytes(pSrc:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Arithmetic functions
///////////////////////////////////////////////////////////////////////////// *)
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsAdd, ippsSub, ippsMul
//
// Purpose: add, subtract and multiply operations upon every element of
// the source vector
// Arguments:
// pSrc pointer to the source vector
// pSrcDst pointer to the source/destination vector
// pSrc1 pointer to the first source vector
// pSrc2 pointer to the second source vector
// pDst pointer to the destination vector
// len length of the vectors
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
// Note:
// AddC(X,v,Y) : Y[n] = X[n] + v
// MulC(X,v,Y) : Y[n] = X[n] * v
// SubC(X,v,Y) : Y[n] = X[n] - v
// SubCRev(X,v,Y) : Y[n] = v - X[n]
// Sub(X,Y) : Y[n] = Y[n] - X[n]
// Sub(X,Y,Z) : Z[n] = Y[n] - X[n]
*)
function ippsAddC(val:Ipp16s;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsSubC(val:Ipp16s;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsMulC(val:Ipp16s;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsAddC(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsAddC(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSubC(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSubC(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsMulC(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMulC(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsAddC(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsAddC(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSubC(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSubC(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsMulC(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsMulC(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC_Low(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsAddC(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(val:Ipp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(val:Ipp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(val:Ipp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(val:Ipp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(val:Ipp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(val:Ipp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(val:Ipp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp32s;val:Ipp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddC(pSrc:PIpp32sc;val:Ipp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp32s;val:Ipp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubC(pSrc:PIpp32sc;val:Ipp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp32s;val:Ipp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSubCRev(pSrc:PIpp32sc;val:Ipp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp32s;val:Ipp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulC(pSrc:PIpp32sc;val:Ipp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc:PIpp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc:PIpp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp16u;pSrc2:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp32u;pSrc2:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp16sc;pSrc2:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp16sc;pSrc2:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp32s;pSrc2:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAdd(pSrc1:PIpp32sc;pSrc2:PIpp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp32s;pSrc2:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSub(pSrc1:PIpp32sc;pSrc2:PIpp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp32s;pSrc2:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp32sc;pSrc2:PIpp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp16u;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc:PIpp32s;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMul(pSrc1:PIpp32s;pSrc2:PIpp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsAddProduct
// Purpose: multiplies elements of two source vectors and adds product to
// the accumulator vector
// Parameters:
// pSrc1 pointer to the first source vector
// pSrc2 pointer to the second source vector
// pSrcDst pointer to the source/destination (accumulator) vector
// len length of the vectors
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
//
// Notes: pSrcDst[n] = pSrcDst[n] + pSrc1[n] * pSrc2[n], n=0,1,2,..len-1.
*)
function ippsAddProduct(pSrc1:PIpp16s;pSrc2:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddProduct(pSrc1:PIpp16s;pSrc2:PIpp16s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddProduct(pSrc1:PIpp32s;pSrc2:PIpp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsAddProduct(pSrc1:PIpp32f;pSrc2:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsAddProduct(pSrc1:PIpp64f;pSrc2:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsAddProduct(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsAddProduct(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsSqr
// Purpose: compute square value for every element of the source vector
// Parameters:
// pSrcDst pointer to the source/destination vector
// pSrc pointer to the input vector
// pDst pointer to the output vector
// len length of the vectors
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) the source data NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsNoErr otherwise
*)
function ippsSqr(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSqr(pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSqr(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSqr(pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSqr(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSqr(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSqr(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSqr(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSqr(pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqr(pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqr(pSrc:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqr(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqr(pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqr(pSrc:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqr(pSrcDst:PIpp16u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqr(pSrc:PIpp16u;pDst:PIpp16u;len:longint;scaleFactor:longint):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Name: ippsDiv
//
// Purpose: divide every element of the source vector by the scalar value
// or by corresponding element of the second source vector
// Arguments:
// val the divisor value
// pSrc pointer to the divisor source vector
// pSrc1 pointer to the divisor source vector
// pSrc2 pointer to the dividend source vector
// pDst pointer to the destination vector
// pSrcDst pointer to the source/destination vector
// len vector's length, number of items
// scaleFactor scale factor parameter value
// Return:
// ippStsNullPtrErr pointer(s) to the data vector is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsDivByZeroErr the scalar divisor value is zero
// ippStsDivByZero Warning status if an element of divisor vector is
// zero. If the dividend is zero then result is
// NaN, if the dividend is not zero then result
// is Infinity with correspondent sign. The
// execution is not aborted. For the integer operation
// zero instead of NaN and the corresponding bound
// values instead of Infinity
// ippStsNoErr otherwise
// Note:
// DivC(v,X,Y) : Y[n] = X[n] / v
// DivC(v,X) : X[n] = X[n] / v
// Div(X,Y) : Y[n] = Y[n] / X[n]
// Div(X,Y,Z) : Z[n] = Y[n] / X[n]
*)
function ippsDiv(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsDiv(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsDiv(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsDiv(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsDiv(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDiv(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDiv(pSrc1:PIpp16sc;pSrc2:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDivC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsDivC(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsDivC(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsDivC(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsDivC(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDivC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDivC(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDiv(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsDiv(pSrc:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsDiv(pSrc:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsDiv(pSrc:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsDiv(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDiv(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDiv(pSrc:PIpp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDiv(pSrc1:PIpp32s;pSrc2:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDiv(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint;ScaleFactor:longint):IppStatus;overload;
function ippsDivC(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsDivC(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsDivC(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsDivC(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsDivC(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDivC(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDivC(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsDivCRev(pSrc:PIpp16u;val:Ipp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsDivCRev(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsDivCRev(val:Ipp16u;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsDivCRev(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsSqrt
// Purpose: compute square root value for every element of the source vector
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// pSrcDst pointer to the source/destination vector
// len length of the vector(s), number of items
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer to vector is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsSqrtNegArg negative value in real sequence
// ippStsNoErr otherwise
*)
function ippsSqrt(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSqrt(pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSqrt(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSqrt(pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsSqrt(pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrcDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp64s;pDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrcDst:PIpp16u;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsSqrt(pSrc:PIpp16u;pDst:PIpp16u;len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsCubrt
// Purpose: Compute cube root of every elements of the source vector
// Parameters:
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// len length of the vector(s)
// ScaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data vector is NULL
// ippStsSizeErr length of the vector(s) is less or equal 0
// ippStsNoErr otherwise
*)
function ippsCubrt(pSrc:PIpp32s;pDst:PIpp16s;Len:longint;sFactor:longint):IppStatus;overload;
function ippsCubrt(pSrc:PIpp32f;pDst:PIpp32f;Len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsAbs
// Purpose: compute absolute value of each element of the source vector
// Parameters:
// pSrcDst pointer to the source/destination vector
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// len length of the vector(s), number of items
// Return:
// ippStsNullPtrErr pointer(s) to data vector is NULL
// ippStsSizeErr length of a vector is less or equal 0
// ippStsNoErr otherwise
*)
function ippsAbs(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsAbs(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsAbs(pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsAbs(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsAbs(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsAbs(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsAbs(pSrcDst:PIpp32s;len:longint):IppStatus;overload;
function ippsAbs(pSrc:PIpp32s;pDst:PIpp32s;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsMagnitude
// Purpose: compute magnitude of every complex element of the source
// Parameters:
// pSrcDst pointer to the source/destination vector
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// len length of the vector(s), number of items
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to data vector is NULL
// ippStsSizeErr length of a vector is less or equal 0
// ippStsNoErr otherwise
// Notes:
// dst = sqrt( src.re^2 + src.im^2 )
*)
function ippsMagnitude(pSrc:PIpp32fc;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMagnitude(pSrc:PIpp64fc;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsMagnitude(pSrc:PIpp16sc;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMagnitude(pSrc:PIpp16sc;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMagnitude(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMagnitude(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsMagnitude(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMagnitude(pSrc:PIpp32sc;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsMagnitude(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMagSquared(pSrc:PIpp32sc;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsExp
// Purpose: compute exponent value for all elements of the source vector
// Parameters:
// pSrcDst pointer to the source/destination vector
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// len length of the vector(s)
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data vector is NULL
// ippStsSizeErr length of the vector(s) is less or equal 0
// ippStsNoErr otherwise
*)
function ippsExp(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsExp(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsExp(pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsExp(pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsExp(pSrcDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsExp(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsExp(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsExp(pSrc:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsExp(pSrc:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsExp(pSrc:PIpp64s;pDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsExp(pSrc:PIpp32f;pDst:PIpp64f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsLn
// Purpose: compute natural logarithm of every elements of the source vector
// Parameters:
// pSrcDst pointer to the source/destination vector
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// len length of the vector(s)
// ScaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data vector is NULL
// ippStsSizeErr length of the vector(s) is less or equal 0
// ippStsLnZeroArg zero value in the source vector
// ippStsLnNegArg negative value in the source vector
// ippStsNoErr otherwise
// Notes:
// Ln( x<0 ) = NaN
// Ln( 0 ) = -Inf
*)
function ippsLn(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsLn(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsLn(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsLn(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsLn(pSrc:PIpp64f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsLn(pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsLn(pSrc:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsLn(pSrc:PIpp32s;pDst:PIpp16s;Len:longint;scaleFactor:longint):IppStatus;overload;
function ippsLn(pSrcDst:PIpp32s;Len:longint;scaleFactor:longint):IppStatus;overload;
function ippsLn(pSrc:PIpp32s;pDst:PIpp32s;Len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ipps10Log10_32s_ISfs
// ipps10Log10_32s_Sfs
//
// Purpose: compute decimal logarithm multiplied by 10 of every elements
// of the source vector (for integer only).
//
// Parameters:
// pSrcDst pointer to the source/destination vector
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// Len length of the vector(s)
// ScaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data vector is NULL
// ippStsSizeErr length of the vector(s) is less or equal 0
// ippStsLnZeroArg zero value in the source vector
// ippStsLnNegArg negative value in the source vector
// ippStsNoErr otherwise
//
*)
function ipps10Log10(pSrcDst:PIpp32s;Len:longint;scaleFactor:longint):IppStatus;overload;
function ipps10Log10(pSrc:PIpp32s;pDst:PIpp32s;Len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsSumLn
// Purpose: computes sum of natural logarithm every elements of the source vector
// Parameters:
// pSrc pointer to the source vector
// pSum pointer to the result
// len length of the vector
// Return:
// ippStsNullPtrErr pointer(s) to the data vector is NULL
// ippStsSizeErr length of the vector(s) is less or equal 0
// ippStsLnZeroArg zero value in the source vector
// ippStsLnNegArg negative value in the source vector
// ippStsNoErr otherwise
*)
function ippsSumLn(pSrc:PIpp32f;len:longint;pSum:PIpp32f):IppStatus;overload;
function ippsSumLn(pSrc:PIpp64f;len:longint;pSum:PIpp64f):IppStatus;overload;
function ippsSumLn(pSrc:PIpp32f;len:longint;pSum:PIpp64f):IppStatus;overload;
function ippsSumLn(pSrc:PIpp16s;len:longint;pSum:PIpp32f):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsSortAscend, ippsSortDescend
//
// Purpose: Execute sorting of all elemens of the vector.
// ippsSortAscend is sorted in increasing order.
// ippsSortDescend is sorted in decreasing order.
// Arguments:
// pSrcDst pointer to the source/destination vector
// len length of the vector
// Return:
// ippStsNullPtrErr pointer to the data is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsNoErr otherwise
*)
function ippsSortAscend(pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsSortAscend(pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsSortAscend(pSrcDst:PIpp32s;len:longint):IppStatus;overload;
function ippsSortAscend(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSortAscend(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsSortDescend(pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsSortDescend(pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsSortDescend(pSrcDst:PIpp32s;len:longint):IppStatus;overload;
function ippsSortDescend(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsSortDescend(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Vector Measures Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsSum
// Purpose: sum all elements of the source vector
// Parameters:
// pSrc pointer to the source vector
// pSum pointer to the result
// len length of the vector
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer to the vector or result is NULL
// ippStsSizeErr length of the vector is less or equal 0
// ippStsNoErr otherwise
*)
function ippsSum(pSrc:PIpp32f;len:longint;pSum:PIpp32f; Const hint:IppHintAlgorithm=ippAlgHintNone):IppStatus;overload;
function ippsSum(pSrc:PIpp64f;len:longint;pSum:PIpp64f):IppStatus;overload;
function ippsSum(pSrc:PIpp32fc;len:longint;pSum:PIpp32fc; Const hint:IppHintAlgorithm=ippAlgHintNone):IppStatus;overload;
function ippsSum(pSrc:PIpp16s;len:longint;pSum:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsSum(pSrc:PIpp16sc;len:longint;pSum:PIpp32sc;scaleFactor:longint):IppStatus;overload;
function ippsSum(pSrc:PIpp16s;len:longint;pSum:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsSum(pSrc:PIpp16sc;len:longint;pSum:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsSum(pSrc:PIpp32s;len:longint;pSum:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsSum(pSrc:PIpp64fc;len:longint;pSum:PIpp64fc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsMean
// Purpose: compute average value of all elements of the source vector
// Parameters:
// pSrc pointer to the source vector
// pMean pointer to the result
// len length of the source vector
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the vector or the result is NULL
// ippStsSizeErr length of the vector is less or equal 0
// ippStsNoErr otherwise
*)
function ippsMean(pSrc:PIpp32f;len:longint;pMean:PIpp32f;hint:IppHintAlgorithm):IppStatus;overload;
function ippsMean(pSrc:PIpp32fc;len:longint;pMean:PIpp32fc;hint:IppHintAlgorithm):IppStatus;overload;
function ippsMean(pSrc:PIpp64f;len:longint;pMean:PIpp64f):IppStatus;overload;
function ippsMean(pSrc:PIpp16s;len:longint;pMean:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsMean(pSrc:PIpp16sc;len:longint;pMean:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsMean(pSrc:PIpp64fc;len:longint;pMean:PIpp64fc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsStdDev
// Purpose: compute standard deviation value of all elements of the vector
// Parameters:
// pSrc pointer to the vector
// len length of the vector
// pStdDev pointer to the result
// scaleFactor scale factor value
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr pointer to the vector or the result is NULL
// ippStsSizeErr length of the vector is less than 2
// Functionality:
// std = sqrt( sum( (x[n] - mean(x))^2, n=0..len-1 ) / (len-1) )
*)
function ippsStdDev(pSrc:PIpp32f;len:longint;pStdDev:PIpp32f;hint:IppHintAlgorithm):IppStatus;overload;
function ippsStdDev(pSrc:PIpp64f;len:longint;pStdDev:PIpp64f):IppStatus;overload;
function ippsStdDev(pSrc:PIpp16s;len:longint;pStdDev:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsStdDev(pSrc:PIpp16s;len:longint;pStdDev:PIpp16s;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsMax
// Purpose: find maximum value among all elements of the source vector
// Parameters:
// pSrc pointer to the source vector
// pMax pointer to the result
// len length of the vector
// Return:
// ippStsNullPtrErr pointer(s) to the vector or the result is NULL
// ippStsSizeErr length of the vector is less or equal 0
// ippStsNoErr otherwise
*)
function ippsMax(pSrc:PIpp32f;len:longint;pMax:PIpp32f):IppStatus;overload;
function ippsMax(pSrc:PIpp64f;len:longint;pMax:PIpp64f):IppStatus;overload;
function ippsMax(pSrc:PIpp16s;len:longint;pMax:PIpp16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsMaxIndx
//
// Purpose: find element with max value and return the value and the index
// Parameters:
// pSrc pointer to the input vector
// len length of the vector
// pMax address to place max value found
// pIndx address to place index found, may be NULL
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsNoErr otherwise
*)
function ippsMaxIndx(pSrc:PIpp16s;len:longint;pMax:PIpp16s;pIndx:Plongint):IppStatus;overload;
function ippsMaxIndx(pSrc:PIpp32f;len:longint;pMax:PIpp32f;pIndx:Plongint):IppStatus;overload;
function ippsMaxIndx(pSrc:PIpp64f;len:longint;pMax:PIpp64f;pIndx:Plongint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsMin
// Purpose: find minimum value among all elements of the source vector
// Parameters:
// pSrc pointer to the source vector
// pMin pointer to the result
// len length of the vector
// Return:
// ippStsNullPtrErr pointer(s) to the vector or the result is NULL
// ippStsSizeErr length of the vector is less or equal 0
// ippStsNoErr otherwise
*)
function ippsMin(pSrc:PIpp32f;len:longint;pMin:PIpp32f):IppStatus;overload;
function ippsMin(pSrc:PIpp64f;len:longint;pMin:PIpp64f):IppStatus;overload;
function ippsMin(pSrc:PIpp16s;len:longint;pMin:PIpp16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsMinIndx
//
// Purpose: find element with min value and return the value and the index
// Parameters:
// pSrc pointer to the input vector
// len length of the vector
// pMin address to place min value found
// pIndx address to place index found, may be NULL
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsNoErr otherwise
*)
function ippsMinIndx(pSrc:PIpp16s;len:longint;pMin:PIpp16s;pIndx:Plongint):IppStatus;overload;
function ippsMinIndx(pSrc:PIpp32f;len:longint;pMin:PIpp32f;pIndx:Plongint):IppStatus;overload;
function ippsMinIndx(pSrc:PIpp64f;len:longint;pMin:PIpp64f;pIndx:Plongint):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsMinEvery, ippsMaxEvery
// Purpose: calculation min/max value for every element of two vectors
// Parameters:
// pSrc pointer to input vector
// pSrcDst pointer to input/output vector
// len vector's length
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr vector`s length is less or equal zero
// ippStsNoErr otherwise
*)
function ippsMinEvery(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsMinEvery(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint):IppStatus;overload;
function ippsMinEvery(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMaxEvery(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsMaxEvery(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint):IppStatus;overload;
function ippsMaxEvery(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsMinMax(pSrc:PIpp64f;len:longint;pMin:PIpp64f;pMax:PIpp64f):IppStatus;overload;
function ippsMinMax(pSrc:PIpp32f;len:longint;pMin:PIpp32f;pMax:PIpp32f):IppStatus;overload;
function ippsMinMax(pSrc:PIpp32s;len:longint;pMin:PIpp32s;pMax:PIpp32s):IppStatus;overload;
function ippsMinMax(pSrc:PIpp32u;len:longint;pMin:PIpp32u;pMax:PIpp32u):IppStatus;overload;
function ippsMinMax(pSrc:PIpp16s;len:longint;pMin:PIpp16s;pMax:PIpp16s):IppStatus;overload;
function ippsMinMax(pSrc:PIpp16u;len:longint;pMin:PIpp16u;pMax:PIpp16u):IppStatus;overload;
function ippsMinMax(pSrc:PIpp8u;len:longint;pMin:PIpp8u;pMax:PIpp8u):IppStatus;overload;
function ippsMinMaxIndx(pSrc:PIpp64f;len:longint;pMin:PIpp64f;pMinIndx:Plongint;pMax:PIpp64f;pMaxIndx:Plongint):IppStatus;overload;
function ippsMinMaxIndx(pSrc:PIpp32f;len:longint;pMin:PIpp32f;pMinIndx:Plongint;pMax:PIpp32f;pMaxIndx:Plongint):IppStatus;overload;
function ippsMinMaxIndx(pSrc:PIpp32s;len:longint;pMin:PIpp32s;pMinIndx:Plongint;pMax:PIpp32s;pMaxIndx:Plongint):IppStatus;overload;
function ippsMinMaxIndx(pSrc:PIpp32u;len:longint;pMin:PIpp32u;pMinIndx:Plongint;pMax:PIpp32u;pMaxIndx:Plongint):IppStatus;overload;
function ippsMinMaxIndx(pSrc:PIpp16s;len:longint;pMin:PIpp16s;pMinIndx:Plongint;pMax:PIpp16s;pMaxIndx:Plongint):IppStatus;overload;
function ippsMinMaxIndx(pSrc:PIpp16u;len:longint;pMin:PIpp16u;pMinIndx:Plongint;pMax:PIpp16u;pMaxIndx:Plongint):IppStatus;overload;
function ippsMinMaxIndx(pSrc:PIpp8u;len:longint;pMin:PIpp8u;pMinIndx:Plongint;pMax:PIpp8u;pMaxIndx:Plongint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsPhase_64fc
// ippsPhase_32fc
// ippsPhase_16sc_Sfs
// ippsPhase_16sc32f
// Purpose:
// Compute the phase (in radians) of complex vector elements.
// Parameters:
// pSrcRe - an input complex vector
// pDst - an output vector to store the phase components;
// len - a length of the arrays.
// scaleFactor - a scale factor of output rezults (only for integer data)
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsBadSizeErr The length of the arrays is less or equal zero
*)
function ippsPhase(pSrc:PIpp64fc;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsPhase(pSrc:PIpp32fc;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsPhase(pSrc:PIpp16sc;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsPhase(pSrc:PIpp16sc;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsPhase_64f
// ippsPhase_32f
// ippsPhase_16s_Sfs
// ippsPhase_16s32f
// Purpose:
// Compute the phase of complex data formed as two real vectors.
// Parameters:
// pSrcRe - an input vector containing a real part of complex data
// pSrcIm - an input vector containing an imaginary part of complex data
// pDst - an output vector to store the phase components
// len - a length of the arrays.
// scaleFactor - a scale factor of output rezults (only for integer data)
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsBadSizeErr The length of the arrays is less or equal zero
*)
function ippsPhase(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsPhase(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsPhase(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsPhase(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsPhase_32sc_Sfs
// Purpose:
// Compute the phase (in radians) of complex vector elements.
// Parameters:
// pSrcRe - an input complex vector
// pDst - an output vector to store the phase components;
// len - a length of the arrays.
// scaleFactor - a scale factor of output rezults (only for integer data)
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsBadSizeErr The length of the arrays is less or equal zero
*)
function ippsPhase(pSrc:PIpp32sc;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsMaxOrder_64f
// ippsMaxOrder_32f
// ippsMaxOrder_32s
// ippsMaxOrder_16s
// Purpose:
// Determines the maximal number of binary digits for data representation.
// Parameters:
// pSrc The pointer on input signal vector.
// pOrder Pointer to result value.
// len The length of the input vector.
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of the arrays is less or equal zero
// ippStsNanArg If not a number is met in a input value
*)
function ippsMaxOrder(pSrc:PIpp64f;len:longint;pOrder:Plongint):IppStatus;overload;
function ippsMaxOrder(pSrc:PIpp32f;len:longint;pOrder:Plongint):IppStatus;overload;
function ippsMaxOrder(pSrc:PIpp32s;len:longint;pOrder:Plongint):IppStatus;overload;
function ippsMaxOrder(pSrc:PIpp16s;len:longint;pOrder:Plongint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsArctan
//
// Purpose: compute arctangent value for all elements of the source vector
//
// Return:
// stsNoErr Ok
// stsNullPtrErr Some of pointers to input or output data are NULL
// stsBadSizeErr The length of the arrays is less or equal zero
//
// Parameters:
// pSrcDst pointer to the source/destination vector
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// len a length of the array
//
*)
function ippsArctan(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsArctan(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsArctan(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsArctan(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFindNearestOne
// Purpose: Searches the table for an element closest to the reference value
// and returns its value and index
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr At least one of the specified pointers is NULL
// ippStsSizeErr The length of the table is less than or equal to zero
// Parameters:
// inpVal reference Value
// pOutVal pointer to the found value
// pOutIndx pointer to the found index
// pTable table for search
// tblLen length of the table
// Notes:
// The table should contain monotonically increasing values
*)
function ippsFindNearestOne(inpVal:Ipp16u;pOutVal:PIpp16u;pOutIndex:Plongint;pTable:PIpp16u;tblLen:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFindNearest
// Purpose: Searches the table for elements closest to the reference values
// and the their indexes
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr At least one of the specified pointers is NULL
// ippStsSizeErr The length of table or pVals is less than or equal to zero
// Parameters:
// pVals pointer to the reference values vector
// pOutVals pointer to the vector with the found values
// pOutIndexes pointer to the array with indexes of the found elements
// len length of the input vector
// pTable table for search
// tblLen length of the table
// Notes:
// The table should contain monotonically increasing values
*)
function ippsFindNearest(pVals:PIpp16u;pOutVals:PIpp16u;pOutIndexes:Plongint;len:longint;pTable:PIpp16u;tblLen:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Vector logical functions
///////////////////////////////////////////////////////////////////////////// *)
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsAnd, ippsOr, ippsXor, ippsNot, ippsLShiftC, ippsRShiftC
// Purpose: logical operations and vector shifts
// Parameters:
// val 1) value to be ANDed/ORed/XORed with each element of the vector (And, Or, Xor);
// 2) position`s number which vector elements to be SHIFTed on (ShiftC)
// pSrc pointer to input vector
// pSrcDst pointer to input/output vector
// pSrc1 pointer to first input vector
// pSrc2 pointer to second input vector
// pDst pointer to output vector
// length vector's length
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr vector`s length is less or equal zero
// ippStsShiftErr shift`s value is less zero
// ippStsNoErr otherwise
*)
function ippsAndC(val:Ipp8u;pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsAndC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsAndC(val:Ipp16u;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsAndC(pSrc:PIpp16u;val:Ipp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsAndC(val:Ipp32u;pSrcDst:PIpp32u;len:longint):IppStatus;overload;
function ippsAndC(pSrc:PIpp32u;val:Ipp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsAnd(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsAnd(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsAnd(pSrc:PIpp16u;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsAnd(pSrc1:PIpp16u;pSrc2:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsAnd(pSrc:PIpp32u;pSrcDst:PIpp32u;len:longint):IppStatus;overload;
function ippsAnd(pSrc1:PIpp32u;pSrc2:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsOrC(val:Ipp8u;pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsOrC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsOrC(val:Ipp16u;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsOrC(pSrc:PIpp16u;val:Ipp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsOrC(val:Ipp32u;pSrcDst:PIpp32u;len:longint):IppStatus;overload;
function ippsOrC(pSrc:PIpp32u;val:Ipp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsOr(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsOr(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsOr(pSrc:PIpp16u;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsOr(pSrc1:PIpp16u;pSrc2:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsOr(pSrc:PIpp32u;pSrcDst:PIpp32u;len:longint):IppStatus;overload;
function ippsOr(pSrc1:PIpp32u;pSrc2:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsXorC(val:Ipp8u;pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsXorC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsXorC(val:Ipp16u;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsXorC(pSrc:PIpp16u;val:Ipp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsXorC(val:Ipp32u;pSrcDst:PIpp32u;len:longint):IppStatus;overload;
function ippsXorC(pSrc:PIpp32u;val:Ipp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsXor(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsXor(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsXor(pSrc:PIpp16u;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsXor(pSrc1:PIpp16u;pSrc2:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsXor(pSrc:PIpp32u;pSrcDst:PIpp32u;len:longint):IppStatus;overload;
function ippsXor(pSrc1:PIpp32u;pSrc2:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsNot(pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsNot(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsNot(pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsNot(pSrc:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsNot(pSrcDst:PIpp32u;len:longint):IppStatus;overload;
function ippsNot(pSrc:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;overload;
function ippsLShiftC(val:longint;pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsLShiftC(pSrc:PIpp8u;val:longint;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsLShiftC(val:longint;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsLShiftC(pSrc:PIpp16u;val:longint;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsLShiftC(val:longint;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsLShiftC(pSrc:PIpp16s;val:longint;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsLShiftC(val:longint;pSrcDst:PIpp32s;len:longint):IppStatus;overload;
function ippsLShiftC(pSrc:PIpp32s;val:longint;pDst:PIpp32s;len:longint):IppStatus;overload;
function ippsRShiftC(val:longint;pSrcDst:PIpp8u;len:longint):IppStatus;overload;
function ippsRShiftC(pSrc:PIpp8u;val:longint;pDst:PIpp8u;len:longint):IppStatus;overload;
function ippsRShiftC(val:longint;pSrcDst:PIpp16u;len:longint):IppStatus;overload;
function ippsRShiftC(pSrc:PIpp16u;val:longint;pDst:PIpp16u;len:longint):IppStatus;overload;
function ippsRShiftC(val:longint;pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsRShiftC(pSrc:PIpp16s;val:longint;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsRShiftC(val:longint;pSrcDst:PIpp32s;len:longint):IppStatus;overload;
function ippsRShiftC(pSrc:PIpp32s;val:longint;pDst:PIpp32s;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Dot Product Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDotProd
// Purpose: compute Dot Product value
// Arguments:
// pSrc1 pointer to the source vector
// pSrc2 pointer to the another source vector
// len vector's length, number of items
// pDp pointer to the result
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer(s) pSrc pDst is NULL
// ippStsSizeErr length of the vectors is less or equal 0
// ippStsNoErr otherwise
// Notes:
// the functions don't conjugate one of the source vectors
*)
function ippsDotProd(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pDp:PIpp32f):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pDp:PIpp32fc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp32f;pSrc2:PIpp32fc;len:longint;pDp:PIpp32fc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp64f;pSrc2:PIpp64f;len:longint;pDp:PIpp64f):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp64fc;pSrc2:PIpp64fc;len:longint;pDp:PIpp64fc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp64f;pSrc2:PIpp64fc;len:longint;pDp:PIpp64fc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pDp:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;len:longint;pDp:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16sc;len:longint;pDp:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pDp:PIpp64s):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;len:longint;pDp:PIpp64sc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16sc;len:longint;pDp:PIpp64sc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pDp:PIpp32f):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;len:longint;pDp:PIpp32fc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16sc;len:longint;pDp:PIpp32fc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pDp:PIpp64f):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pDp:PIpp64fc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp32f;pSrc2:PIpp32fc;len:longint;pDp:PIpp64fc):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pDp:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;len:longint;pDp:PIpp32sc;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16sc;len:longint;pDp:PIpp32sc;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp32s;pSrc2:PIpp32s;len:longint;pDp:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp32sc;pSrc2:PIpp32sc;len:longint;pDp:PIpp32sc;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp32s;pSrc2:PIpp32sc;len:longint;pDp:PIpp32sc;scaleFactor:longint):IppStatus;overload;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp32s;len:longint;pDp:PIpp32s;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsPowerSpectr_64fc
// ippsPowerSpectr_32fc
// ippsPowerSpectr_16sc_Sfs
// ippsPowerSpectr_16sc32f
// Purpose:
// Compute the power spectrum of complex vector
// Parameters:
// pSrcRe - pointer to the real part of input vector.
// pSrcIm - pointer to the image part of input vector.
// pDst - pointer to the result.
// len - vector length.
// scaleFactor - scale factor for rezult (only for integer data).
// Return:
// ippStsNullPtrErr indicates that one or more pointers to the data is NULL.
// ippStsSizeErr indicates that vector length is less or equal zero.
// ippStsNoErr otherwise.
*)
function ippsPowerSpectr(pSrc:PIpp64fc;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsPowerSpectr(pSrc:PIpp32fc;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsPowerSpectr(pSrc:PIpp16sc;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsPowerSpectr(pSrc:PIpp16sc;pDst:PIpp32f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsPowerSpectr_64f
// ippsPowerSpectr_32f
// ippsPowerSpectr_16s_Sfs
// ippsPowerSpectr_16s32f
// Purpose:
// Compute the power spectrum of complex data formed as two real vectors
// Parameters:
// pSrcRe - pointer to the real part of input vector.
// pSrcIm - pointer to the image part of input vector.
// pDst - pointer to the result.
// len - vector length.
// scaleFactor - scale factor for rezult (only for integer data).
// Return:
// ippStsNullPtrErr indicates that one or more pointers to the data is NULL.
// ippStsSizeErr indicates that vector length is less or equal zero.
// ippStsNoErr otherwise.
*)
function ippsPowerSpectr(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsPowerSpectr(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsPowerSpectr(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsPowerSpectr(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Linear Transform
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsNormalize_64fc
// ippsNormalize_32fc
// ippsNormalize_16sc_Sfs
// Purpose:
// Complex vector normalization using offset and division method.
// Parameters:
// pSrc - an input complex vector
// pDst - an output complex vector
// len - a length of the arrays.
// vsub - complex a subtrahend
// vdiv - denominator
// scaleFactor - a scale factor of output rezults (only for integer data)
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of the arrays is less or equal zero
// ippStsDivByZeroErr denominator equal zero or less than float
// format minimum
*)
function ippsNormalize(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;vsub:Ipp64fc;vdiv:Ipp64f):IppStatus;overload;
function ippsNormalize(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;vsub:Ipp32fc;vdiv:Ipp32f):IppStatus;overload;
function ippsNormalize(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;vsub:Ipp16sc;vdiv:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names:
// ippsNormalize_64f
// ippsNormalize_32f
// ippsNormalize_16s_Sfs
// Purpose:
// Normalize elements of real vector with the help of offset and division.
// Parameters:
// pSrc - an input vector of real data
// pDst - an output vector of real data
// len - a length of the arrays.
// vsub - subtrahend
// vdiv - denominator
// scaleFactor - a scale factor of output rezults (only for integer data)
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of the arrays is less or equal zero
// ippStsDivByZeroErr denominator equal zero or less than float
// format minimum
*)
function ippsNormalize(pSrc:PIpp64f;pDst:PIpp64f;len:longint;vsub:Ipp64f;vdiv:Ipp64f):IppStatus;overload;
function ippsNormalize(pSrc:PIpp32f;pDst:PIpp32f;len:longint;vsub:Ipp32f;vdiv:Ipp32f):IppStatus;overload;
function ippsNormalize(pSrc:PIpp16s;pDst:PIpp16s;len:longint;vsub:Ipp16s;vdiv:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Definitions for FFT Functions
///////////////////////////////////////////////////////////////////////////// *)
(* #if !defined( _OWN_BLDPCS )
struct FFTSpec_C_16sc;
typedef struct FFTSpec_C_16sc IppsFFTSpec_C_16sc;
struct FFTSpec_C_16s;
typedef struct FFTSpec_C_16s IppsFFTSpec_C_16s;
struct FFTSpec_R_16s;
typedef struct FFTSpec_R_16s IppsFFTSpec_R_16s;
struct FFTSpec_C_32fc;
typedef struct FFTSpec_C_32fc IppsFFTSpec_C_32fc;
struct FFTSpec_C_32f;
typedef struct FFTSpec_C_32f IppsFFTSpec_C_32f;
struct FFTSpec_R_32f;
typedef struct FFTSpec_R_32f IppsFFTSpec_R_32f;
struct FFTSpec_C_64fc;
typedef struct FFTSpec_C_64fc IppsFFTSpec_C_64fc;
struct FFTSpec_C_64f;
typedef struct FFTSpec_C_64f IppsFFTSpec_C_64f;
struct FFTSpec_R_64f;
typedef struct FFTSpec_R_64f IppsFFTSpec_R_64f;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// FFT Context Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFFTInitAlloc_C, ippsFFTInitAlloc_R
// Purpose: create and initialize of FFT context
// Arguments:
// order - base-2 logarithm of the number of samples in FFT
// flag - normalization flag
// hint - code specific use hints
// pFFTSpec - where write pointer to new context
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pFFTSpec == NULL
// ippStsFftOrderErr bad the order value
// ippStsFftFlagErr bad the normalization flag value
// ippStsMemAllocErr memory allocation error
*)
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_16sc;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_16s;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsFFTInitAlloc_R(var pFFTSpec:PIppsFFTSpec_R_16s;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_32fc;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_32f;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsFFTInitAlloc_R(var pFFTSpec:PIppsFFTSpec_R_32f;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_64fc;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_64f;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsFFTInitAlloc_R(var pFFTSpec:PIppsFFTSpec_R_64f;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFFTFree_C, ippsFFTFree_R
// Purpose: delete FFT context
// Arguments:
// pFFTSpec - pointer to FFT context to be deleted
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pFFTSpec == NULL
// ippStsContextMatchErr bad context identifier
*)
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_16sc):IppStatus;overload;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_16s):IppStatus;overload;
function ippsFFTFree_R(pFFTSpec:PIppsFFTSpec_R_16s):IppStatus;overload;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_32fc):IppStatus;overload;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_32f):IppStatus;overload;
function ippsFFTFree_R(pFFTSpec:PIppsFFTSpec_R_32f):IppStatus;overload;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_64fc):IppStatus;overload;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_64f):IppStatus;overload;
function ippsFFTFree_R(pFFTSpec:PIppsFFTSpec_R_64f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// FFT Buffer Size
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFFTGetBufSize_C, ippsFFTGetBufSize_R
// Purpose: get size of the FFT work buffer (on bytes)
// Arguments:
// pFFTSpec - pointer to the FFT structure
// pSize - Pointer to the FFT work buffer size value
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pFFTSpec == NULL or pSize == NULL
// ippStsContextMatchErr bad context identifier
*)
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_16sc;pSize:Plongint):IppStatus;overload;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_16s;pSize:Plongint):IppStatus;overload;
function ippsFFTGetBufSize_R(pFFTSpec:PIppsFFTSpec_R_16s;pSize:Plongint):IppStatus;overload;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_32fc;pSize:Plongint):IppStatus;overload;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_32f;pSize:Plongint):IppStatus;overload;
function ippsFFTGetBufSize_R(pFFTSpec:PIppsFFTSpec_R_32f;pSize:Plongint):IppStatus;overload;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_64fc;pSize:Plongint):IppStatus;overload;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_64f;pSize:Plongint):IppStatus;overload;
function ippsFFTGetBufSize_R(pFFTSpec:PIppsFFTSpec_R_64f;pSize:Plongint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// FFT Complex Transforms
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFFTFwd_CToC, ippsFFTInv_CToC
// Purpose: compute forward and inverse FFT of the complex signal
// Arguments:
// pFFTSpec - pointer to FFT context
// pSrc - pointer to source complex signal
// pDst - pointer to destination complex signal
// pSrcRe - pointer to real part of source signal
// pSrcIm - pointer to imaginary part of source signal
// pDstRe - pointer to real part of destination signal
// pDstIm - pointer to imaginary part of destination signal
// pBuffer - pointer to work buffer
// scaleFactor
// - scale factor for output result
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pFFTSpec == NULL or
// pSrc == NULL or pDst == NULL or
// pSrcRe == NULL or pSrcIm == NULL or
// pDstRe == NULL or pDstIm == NULL or
// ippStsContextMatchErr bad context identifier
// ippStsMemAllocErr memory allocation error
*)
function ippsFFTFwd_CToC(pSrc:PIpp16sc;pDst:PIpp16sc;pFFTSpec:PIppsFFTSpec_C_16sc;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CToC(pSrc:PIpp16sc;pDst:PIpp16sc;pFFTSpec:PIppsFFTSpec_C_16sc;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_CToC(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDstRe:PIpp16s;pDstIm:PIpp16s;pFFTSpec:PIppsFFTSpec_C_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CToC(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDstRe:PIpp16s;pDstIm:PIpp16s;pFFTSpec:PIppsFFTSpec_C_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pFFTSpec:PIppsFFTSpec_C_32fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pFFTSpec:PIppsFFTSpec_C_32fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_CToC(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;pFFTSpec:PIppsFFTSpec_C_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CToC(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;pFFTSpec:PIppsFFTSpec_C_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pFFTSpec:PIppsFFTSpec_C_64fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pFFTSpec:PIppsFFTSpec_C_64fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_CToC(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;pFFTSpec:PIppsFFTSpec_C_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CToC(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;pFFTSpec:PIppsFFTSpec_C_64f;pBuffer:PIpp8u):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// FFT Real Packed Transforms
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFFTFwd_RToPerm, ippsFFTFwd_RToPack, ippsFFTFwd_RToCCS
// ippsFFTInv_PermToR, ippsFFTInv_PackToR, ippsFFTInv_CCSToR
// Purpose: compute forward and inverse FFT of real signal
// using Perm, Pack or Ccs packed format
// Arguments:
// pFFTSpec - pointer to FFT context
// pSrc - pointer to source signal
// pDst - pointer to destination signal
// pBuffer - pointer to work buffer
// scaleFactor
// - scale factor for output result
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pFFTSpec == NULL or
// pSrc == NULL or pDst == NULL
// ippStsContextMatchErr bad context identifier
// ippStsMemAllocErr memory allocation error
*)
function ippsFFTFwd_RToPerm(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_RToPack(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_RToCCS(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_PermToR(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_PackToR(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CCSToR(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_RToPerm(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_RToPack(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_RToCCS(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_PermToR(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_PackToR(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CCSToR(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_RToPerm(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_RToPack(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTFwd_RToCCS(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_PermToR(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_PackToR(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFFTInv_CCSToR(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Definitions for DFT Functions
///////////////////////////////////////////////////////////////////////////// *)
(* #if !defined( _OWN_BLDPCS )
struct DFTSpec_C_16sc;
typedef struct DFTSpec_C_16sc IppsDFTSpec_C_16sc;
struct DFTSpec_C_16s;
typedef struct DFTSpec_C_16s IppsDFTSpec_C_16s;
struct DFTSpec_R_16s;
typedef struct DFTSpec_R_16s IppsDFTSpec_R_16s;
struct DFTSpec_C_32fc;
typedef struct DFTSpec_C_32fc IppsDFTSpec_C_32fc;
struct DFTSpec_C_32f;
typedef struct DFTSpec_C_32f IppsDFTSpec_C_32f;
struct DFTSpec_R_32f;
typedef struct DFTSpec_R_32f IppsDFTSpec_R_32f;
struct DFTSpec_C_64fc;
typedef struct DFTSpec_C_64fc IppsDFTSpec_C_64fc;
struct DFTSpec_C_64f;
typedef struct DFTSpec_C_64f IppsDFTSpec_C_64f;
struct DFTSpec_R_64f;
typedef struct DFTSpec_R_64f IppsDFTSpec_R_64f;
struct DFTOutOrdSpec_C_32fc;
typedef struct DFTOutOrdSpec_C_32fc IppsDFTOutOrdSpec_C_32fc;
struct DFTOutOrdSpec_C_64fc;
typedef struct DFTOutOrdSpec_C_64fc IppsDFTOutOrdSpec_C_64fc;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// DFT Context Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDFTInitAlloc_C, ippsDFTInitAlloc_R
// Purpose: create and initialize of DFT context
// Arguments:
// length - number of samples in DFT
// flag - normalization flag
// hint - code specific use hints
// pDFTSpec - where write pointer to new context
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDFTSpec == NULL
// ippStsSizeErr bad the length value
// ippStsFFTFlagErr bad the normalization flag value
// ippStsMemAllocErr memory allocation error
*)
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_16sc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_16s;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTInitAlloc_R(var pDFTSpec:PIppsDFTSpec_R_16s;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_32fc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_32f;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTInitAlloc_R(var pDFTSpec:PIppsDFTSpec_R_32f;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_64fc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_64f;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTInitAlloc_R(var pDFTSpec:PIppsDFTSpec_R_64f;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTOutOrdInitAlloc_C(var pDFTSpec:PIppsDFTOutOrdSpec_C_32fc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDFTOutOrdInitAlloc_C(var pDFTSpec:PIppsDFTOutOrdSpec_C_64fc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDFTFree_C, ippsDFTFree_R
// Purpose: delete DFT context
// Arguments:
// pDFTSpec - pointer to DFT context to be deleted
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDFTSpec == NULL
// ippStsContextMatchErr bad context identifier
*)
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_16sc):IppStatus;overload;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_16s):IppStatus;overload;
function ippsDFTFree_R(pDFTSpec:PIppsDFTSpec_R_16s):IppStatus;overload;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_32fc):IppStatus;overload;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_32f):IppStatus;overload;
function ippsDFTFree_R(pDFTSpec:PIppsDFTSpec_R_32f):IppStatus;overload;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_64fc):IppStatus;overload;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_64f):IppStatus;overload;
function ippsDFTFree_R(pDFTSpec:PIppsDFTSpec_R_64f):IppStatus;overload;
function ippsDFTOutOrdFree_C(pDFTSpec:PIppsDFTOutOrdSpec_C_32fc):IppStatus;overload;
function ippsDFTOutOrdFree_C(pDFTSpec:PIppsDFTOutOrdSpec_C_64fc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// DFT Buffer Size
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDFTGetBufSize_C, ippsDFTGetBufSize_R
// Purpose: get size of the DFT work buffer (on bytes)
// Arguments:
// pDFTSpec - pointer to DFT context
// pSize - where write size of buffer
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDFTSpec == NULL or pSize == NULL
// ippStsContextMatchErr bad context identifier
*)
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_16sc;pSize:Plongint):IppStatus;overload;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_16s;pSize:Plongint):IppStatus;overload;
function ippsDFTGetBufSize_R(pDFTSpec:PIppsDFTSpec_R_16s;pSize:Plongint):IppStatus;overload;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_32fc;pSize:Plongint):IppStatus;overload;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_32f;pSize:Plongint):IppStatus;overload;
function ippsDFTGetBufSize_R(pDFTSpec:PIppsDFTSpec_R_32f;pSize:Plongint):IppStatus;overload;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_64fc;pSize:Plongint):IppStatus;overload;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_64f;pSize:Plongint):IppStatus;overload;
function ippsDFTGetBufSize_R(pDFTSpec:PIppsDFTSpec_R_64f;pSize:Plongint):IppStatus;overload;
function ippsDFTOutOrdGetBufSize_C(pDFTSpec:PIppsDFTOutOrdSpec_C_32fc;size:Plongint):IppStatus;overload;
function ippsDFTOutOrdGetBufSize_C(pDFTSpec:PIppsDFTOutOrdSpec_C_64fc;size:Plongint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// DFT Complex Transforms
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDFTFwd_CToC, ippsDFTInv_CToC
// Purpose: compute forward and inverse DFT of the complex signal
// Arguments:
// pDFTSpec - pointer to DFT context
// pSrc - pointer to source complex signal
// pDst - pointer to destination complex signal
// pSrcRe - pointer to real part of source signal
// pSrcIm - pointer to imaginary part of source signal
// pDstRe - pointer to real part of destination signal
// pDstIm - pointer to imaginary part of destination signal
// pBuffer - pointer to work buffer
// scaleFactor
// - scale factor for output result
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDFTSpec == NULL or
// pSrc == NULL or pDst == NULL or
// pSrcRe == NULL or pSrcIm == NULL or
// pDstRe == NULL or pDstIm == NULL or
// ippStsContextMatchErr bad context identifier
// ippStsMemAllocErr memory allocation error
*)
function ippsDFTFwd_CToC(pSrc:PIpp16sc;pDst:PIpp16sc;pDFTSpec:PIppsDFTSpec_C_16sc;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CToC(pSrc:PIpp16sc;pDst:PIpp16sc;pDFTSpec:PIppsDFTSpec_C_16sc;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_CToC(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDstRe:PIpp16s;pDstIm:PIpp16s;pDFTSpec:PIppsDFTSpec_C_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CToC(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDstRe:PIpp16s;pDstIm:PIpp16s;pDFTSpec:PIppsDFTSpec_C_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pDFTSpec:PIppsDFTSpec_C_32fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pDFTSpec:PIppsDFTSpec_C_32fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_CToC(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;pDFTSpec:PIppsDFTSpec_C_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CToC(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;pDFTSpec:PIppsDFTSpec_C_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pDFTSpec:PIppsDFTSpec_C_64fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pDFTSpec:PIppsDFTSpec_C_64fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_CToC(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;pDFTSpec:PIppsDFTSpec_C_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CToC(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;pDFTSpec:PIppsDFTSpec_C_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTOutOrdFwd_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pDFTSpec:PIppsDFTOutOrdSpec_C_32fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTOutOrdInv_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pDFTSpec:PIppsDFTOutOrdSpec_C_32fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTOutOrdFwd_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pDFTSpec:PIppsDFTOutOrdSpec_C_64fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTOutOrdInv_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pDFTSpec:PIppsDFTOutOrdSpec_C_64fc;pBuffer:PIpp8u):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// DFT Real Packed Transforms
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDFTFwd_RToPerm, ippsDFTFwd_RToPack, ippsDFTFwd_RToCCS
// ippsDFTInv_PermToR, ippsDFTInv_PackToR, ippsDFTInv_CCSToR
// Purpose: compute forward and inverse DFT of real signal
// using Perm, Pack or Ccs packed format
// Arguments:
// pDFTSpec - pointer to DFT context
// pSrc - pointer to source signal
// pDst - pointer to destination signal
// pBuffer - pointer to work buffer
// scaleFactor
// - scale factor for output result
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDFTSpec == NULL or
// pSrc == NULL or pDst == NULL
// ippStsContextMatchErr bad context identifier
// ippStsMemAllocErr memory allocation error
*)
function ippsDFTFwd_RToPerm(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_RToPack(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_RToCCS(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_PermToR(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_PackToR(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CCSToR(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_RToPerm(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_RToPack(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_RToCCS(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_PermToR(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_PackToR(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CCSToR(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_RToPerm(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_RToPack(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTFwd_RToCCS(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_PermToR(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_PackToR(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDFTInv_CCSToR(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Vector multiplication in RCPack and in RCPerm formats
///////////////////////////////////////////////////////////////////////////// *)
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsMulPack, ippsMulPerm
// Purpose: multiply two vectors stored in RCPack and RCPerm formats
// Parameters:
// pSrc pointer to input vector (in-place case)
// pSrcDst pointer to output vector (in-place case)
// pSrc1 pointer to first input vector
// pSrc2 pointer to second input vector
// pDst pointer to output vector
// length vector's length
// scaleFactor scale factor
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr vector`s length is less or equal zero
// ippStsNoErr otherwise
*)
function ippsMulPack(pSrc:PIpp16s;pSrcDst:PIpp16s;length:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulPerm(pSrc:PIpp16s;pSrcDst:PIpp16s;length:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulPack(pSrc:PIpp32f;pSrcDst:PIpp32f;length:longint):IppStatus;overload;
function ippsMulPerm(pSrc:PIpp32f;pSrcDst:PIpp32f;length:longint):IppStatus;overload;
function ippsMulPack(pSrc:PIpp64f;pSrcDst:PIpp64f;length:longint):IppStatus;overload;
function ippsMulPerm(pSrc:PIpp64f;pSrcDst:PIpp64f;length:longint):IppStatus;overload;
function ippsMulPack(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;length:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulPerm(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;length:longint;scaleFactor:longint):IppStatus;overload;
function ippsMulPack(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;length:longint):IppStatus;overload;
function ippsMulPerm(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;length:longint):IppStatus;overload;
function ippsMulPack(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;length:longint):IppStatus;overload;
function ippsMulPerm(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;length:longint):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsMulPackConj
// Purpose: multiply on a complex conjugate vector and store in RCPack format
// Parameters:
// pSrc pointer to input vector (in-place case)
// pSrcDst pointer to output vector (in-place case)
// length vector's length
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr vector`s length is less or equal zero
// ippStsNoErr otherwise
*)
function ippsMulPackConj(pSrc:PIpp32f;pSrcDst:PIpp32f;length:longint):IppStatus;overload;
function ippsMulPackConj(pSrc:PIpp64f;pSrcDst:PIpp64f;length:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsGoertz
// Purpose: compute DFT for single frequency (Goertzel algorithm)
// Parameters:
// freq single relative frequency value [0, 1.0)
// pSrc pointer to the input vector
// len length of the vector
// pVal pointer to the DFT result value computed
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer to the data is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsRelFreqErr frequency value out of range
// ippStsNoErr otherwise
*)
function ippsGoertz(pSrc:PIpp32fc;len:longint;pVal:PIpp32fc;freq:Ipp32f):IppStatus;overload;
function ippsGoertz(pSrc:PIpp64fc;len:longint;pVal:PIpp64fc;freq:Ipp64f):IppStatus;overload;
function ippsGoertz(pSrc:PIpp16sc;len:longint;pVal:PIpp16sc;freq:Ipp32f;scaleFactor:longint):IppStatus;overload;
function ippsGoertz(pSrc:PIpp32f;len:longint;pVal:PIpp32fc;freq:Ipp32f):IppStatus;overload;
function ippsGoertz(pSrc:PIpp16s;len:longint;pVal:PIpp16sc;freq:Ipp32f;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsGoertzTwo
// Purpose: compute DFT for dual frequency (Goertzel algorithm)
// Parameters:
// freq pointer to two relative frequency values [0, 1.0)
// pSrc pointer to the input vector
// len length of the vector
// pVal pointer to the DFT result value computed
// scaleFactor scale factor value
// Return:
// ippStsNullPtrErr pointer to the data is NULL
// ippStsSizeErr length of the vector is less or equal zero
// ippStsRelFreqErr frequency values out of range
// ippStsNoErr otherwise
*)
function ippsGoertzTwo(pSrc:PIpp32fc;len:longint;var pVal:Ipp32fc;var freq:Ipp32f):IppStatus;overload;
function ippsGoertzTwo(pSrc:PIpp64fc;len:longint;var pVal:Ipp64fc;var freq:Ipp64f):IppStatus;overload;
function ippsGoertzTwo(pSrc:PIpp16sc;len:longint;var pVal:Ipp16sc;var freq:Ipp32f;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Definitions for DCT Functions
///////////////////////////////////////////////////////////////////////////// *)
(* #if !defined( _OWN_BLDPCS )
struct DCTFwdSpec_16s;
typedef struct DCTFwdSpec_16s IppsDCTFwdSpec_16s;
struct DCTInvSpec_16s;
typedef struct DCTInvSpec_16s IppsDCTInvSpec_16s;
struct DCTFwdSpec_32f;
typedef struct DCTFwdSpec_32f IppsDCTFwdSpec_32f;
struct DCTInvSpec_32f;
typedef struct DCTInvSpec_32f IppsDCTInvSpec_32f;
struct DCTFwdSpec_64f;
typedef struct DCTFwdSpec_64f IppsDCTFwdSpec_64f;
struct DCTInvSpec_64f;
typedef struct DCTInvSpec_64f IppsDCTInvSpec_64f;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// DCT Context Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDCTFwdInitAlloc, ippsDCTInvInitAlloc
// Purpose: create and initialize of DCT context
// Arguments:
// length - number of samples in DCT
// flag - normalization flag
// hint - code specific use hints
// pDCTSpec - where write pointer to new context
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDCTSpec == NULL
// ippStsSizeErr bad the length value
// ippStsMemAllocErr memory allocation error
*)
function ippsDCTFwdInitAlloc(var pDCTSpec:PIppsDCTFwdSpec_16s;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDCTInvInitAlloc(var pDCTSpec:PIppsDCTInvSpec_16s;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDCTFwdInitAlloc(var pDCTSpec:PIppsDCTFwdSpec_32f;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDCTInvInitAlloc(var pDCTSpec:PIppsDCTInvSpec_32f;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDCTFwdInitAlloc(var pDCTSpec:PIppsDCTFwdSpec_64f;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsDCTInvInitAlloc(var pDCTSpec:PIppsDCTInvSpec_64f;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDCTFwdFree, ippsDCTInvFree
// Purpose: delete DCT context
// Arguments:
// pDCTSpec - pointer to DCT context to be deleted
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDCTSpec == NULL
// ippStsContextMatchErr bad context identifier
*)
function ippsDCTFwdFree(pDCTSpec:PIppsDCTFwdSpec_16s):IppStatus;overload;
function ippsDCTInvFree(pDCTSpec:PIppsDCTInvSpec_16s):IppStatus;overload;
function ippsDCTFwdFree(pDCTSpec:PIppsDCTFwdSpec_32f):IppStatus;overload;
function ippsDCTInvFree(pDCTSpec:PIppsDCTInvSpec_32f):IppStatus;overload;
function ippsDCTFwdFree(pDCTSpec:PIppsDCTFwdSpec_64f):IppStatus;overload;
function ippsDCTInvFree(pDCTSpec:PIppsDCTInvSpec_64f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// DCT Buffer Size
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDCTFwdGetBufSize, ippsDCTInvGetBufSize
// Purpose: get size of the DCT work buffer (on bytes)
// Arguments:
// pDCTSpec - pointer to the DCT structure
// pSize - pointer to the DCT work buffer size value
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDCTSpec == NULL or pSize == NULL
// ippStsContextMatchErr bad context identifier
*)
function ippsDCTFwdGetBufSize(pDCTSpec:PIppsDCTFwdSpec_16s;pSize:Plongint):IppStatus;overload;
function ippsDCTInvGetBufSize(pDCTSpec:PIppsDCTInvSpec_16s;pSize:Plongint):IppStatus;overload;
function ippsDCTFwdGetBufSize(pDCTSpec:PIppsDCTFwdSpec_32f;pSize:Plongint):IppStatus;overload;
function ippsDCTInvGetBufSize(pDCTSpec:PIppsDCTInvSpec_32f;pSize:Plongint):IppStatus;overload;
function ippsDCTFwdGetBufSize(pDCTSpec:PIppsDCTFwdSpec_64f;pSize:Plongint):IppStatus;overload;
function ippsDCTInvGetBufSize(pDCTSpec:PIppsDCTInvSpec_64f;pSize:Plongint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// DCT Transforms
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsDCTFwd, ippsDCTInv
// Purpose: compute forward and inverse DCT of signal
// Arguments:
// pDCTSpec - pointer to DCT context
// pSrc - pointer to source signal
// pDst - pointer to destination signal
// pBuffer - pointer to work buffer
// scaleFactor
// - scale factor for output result
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pDCTSpec == NULL or
// pSrc == NULL or pDst == NULL
// ippStsContextMatchErr bad context identifier
// ippStsMemAllocErr memory allocation error
*)
function ippsDCTFwd(pSrc:PIpp16s;pDst:PIpp16s;pDCTSpec:PIppsDCTFwdSpec_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDCTInv(pSrc:PIpp16s;pDst:PIpp16s;pDCTSpec:PIppsDCTInvSpec_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;overload;
function ippsDCTFwd(pSrc:PIpp32f;pDst:PIpp32f;pDCTSpec:PIppsDCTFwdSpec_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDCTInv(pSrc:PIpp32f;pDst:PIpp32f;pDCTSpec:PIppsDCTInvSpec_32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDCTFwd(pSrc:PIpp64f;pDst:PIpp64f;pDCTSpec:PIppsDCTFwdSpec_64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsDCTInv(pSrc:PIpp64f;pDst:PIpp64f;pDCTSpec:PIppsDCTInvSpec_64f;pBuffer:PIpp8u):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Wavelet Transform Functions for Fixed Filter Banks
///////////////////////////////////////////////////////////////////////////// *)
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTHaar
// Purpose: one level Haar Wavelet Transform
// Arguments:
// pSrc - source vector;
// len - length of source vector;
// pDstLow - coarse "low frequency" component destination;
// pDstHigh - detail "high frequency" component destination;
// pSrcLow - coarse "low frequency" component source;
// pSrcHigh - detail "high frequency" component source;
// pDst - destination vector;
// scaleFactor - scale factor value
// Return:
// ippStsNullPtrErr pointer(s) to the data vector is NULL
// ippStsSizeErr the length is less or equal zero
// ippStsNoErr otherwise
*)
function ippsWTHaarFwd(pSrc:PIpp8s;len:longint;pDstLow:PIpp8s;pDstHigh:PIpp8s):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp16s;len:longint;pDstLow:PIpp16s;pDstHigh:PIpp16s):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp32s;len:longint;pDstLow:PIpp32s;pDstHigh:PIpp32s):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp64s;len:longint;pDstLow:PIpp64s;pDstHigh:PIpp64s):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp32f;len:longint;pDstLow:PIpp32f;pDstHigh:PIpp32f):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp64f;len:longint;pDstLow:PIpp64f;pDstHigh:PIpp64f):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp8s;len:longint;pDstLow:PIpp8s;pDstHigh:PIpp8s;scaleFactor:longint):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp16s;len:longint;pDstLow:PIpp16s;pDstHigh:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp32s;len:longint;pDstLow:PIpp32s;pDstHigh:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsWTHaarFwd(pSrc:PIpp64s;len:longint;pDstLow:PIpp64s;pDstHigh:PIpp64s;scaleFactor:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp8s;pSrcHigh:PIpp8s;pDst:PIpp8s;len:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp16s;pSrcHigh:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp32s;pSrcHigh:PIpp32s;pDst:PIpp32s;len:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp64s;pSrcHigh:PIpp64s;pDst:PIpp64s;len:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp64f;pSrcHigh:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp8s;pSrcHigh:PIpp8s;pDst:PIpp8s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp16s;pSrcHigh:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp32s;pSrcHigh:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;overload;
function ippsWTHaarInv(pSrcLow:PIpp64s;pSrcHigh:PIpp64s;pDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Wavelet Transform Fucntions for User Filter Banks
///////////////////////////////////////////////////////////////////////////// *)
(* #if !defined( _OWN_BLDPCS )
struct sWTFwdState_32f;
typedef struct sWTFwdState_32f IppsWTFwdState_32f;
struct sWTFwdState_8s32f;
typedef struct sWTFwdState_8s32f IppsWTFwdState_8s32f;
struct sWTFwdState_8u32f;
typedef struct sWTFwdState_8u32f IppsWTFwdState_8u32f;
struct sWTFwdState_16s32f;
typedef struct sWTFwdState_16s32f IppsWTFwdState_16s32f;
struct sWTFwdState_16u32f;
typedef struct sWTFwdState_16u32f IppsWTFwdState_16u32f;
struct sWTInvState_32f;
typedef struct sWTInvState_32f IppsWTInvState_32f;
struct sWTInvState_32f8s;
typedef struct sWTInvState_32f8s IppsWTInvState_32f8s;
struct sWTInvState_32f8u;
typedef struct sWTInvState_32f8u IppsWTInvState_32f8u;
struct sWTInvState_32f16s;
typedef struct sWTInvState_32f16s IppsWTInvState_32f16s;
struct sWTInvState_32f16u;
typedef struct sWTInvState_32f16u IppsWTInvState_32f16u;
#endif /* _OWN_BLDPCS */ *)
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTFwdInitAlloc_32f, ippsWTFwdInitAlloc_8s32f,
// ippsWTFwdInitAlloc_8u32f, ippsWTFwdInitAlloc_16s32f,
// ippsWTFwdInitAlloc_16u32f
//
// Purpose: Allocate and initialize
// forward wavelet transform pState structure.
// Parameters:
// pState - pointer to pointer to allocated and initialized
// pState structure.
// pTapsLow - pointer to lowpass filter taps;
// lenLow - length of lowpass filter;
// offsLow - input delay of lowpass filter;
// pTapsHigh - pointer to highpass filter taps;
// lenHigh - length of highpass filter;
// offsHigh - input delay of highpass filter;
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - pointer to filter taps are NULL
// or pointer to pState structure is NULL;
// ippStsSizeErr - filter length is less or equal zero;
// ippStsWtOffsetErr - filter delay is less than (-1).
//
// Notes: filter input delay minimum value is (-1) that corresponds to
// downsampling phase equal 1 (first sample excluded,
// second included and so on);
*)
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_8s32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_8u32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_16s32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_16u32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTFwdSetDlyLine_32f, ippsWTFwdSetDlyLine_8s32f,
// ippsWTFwdSetDlyLine_8u32f, ippsWTFwdSetDlyLine_16s32f,
// ippsWTFwdSetDlyLine_16u32f
//
// Purpose: The function copies the pointed vectors to internal delay lines.
//
// Parameters:
// pState - pointer to pState structure;
// pDlyLow - pointer to delay line for lowpass filtering;
// pDlyHigh - pointer to delay line for highpass filtering.
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - some of pointers pDlyLow
// or pDlyHigh vectors are NULL;
// ippStspStateMatchErr - mismatch pState structure.
//
// Notes: lengths of delay lines:
// len(pDlyLow) = lenLow + offsLow - 1;
// len(pDlyHigh) = lenHigh + offsHigh - 1;
// lenLow, offsLow, lenHigh, offsHigh - parameters
// for ippsWTFwdInitAlloc function.
*)
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_8s32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_8u32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_16s32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_16u32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTFwdGetDlyLine_32f, ippsWTFwdGetDlyLine_8s32f,
// ippsWTFwdGetDlyLine_8u32f, ippsWTFwdGetDlyLine_16s32f,
// ippsWTFwdGetDlyLine_16u32f
//
// Purpose: The function copies data from interanl delay lines
// to the pointed vectors.
// Parameters:
// pState - pointer to pState structure;
// pDlyLow - pointer to delay line for lowpass filtering;
// pDlyHigh - pointer to delay line for highpass filtering.
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - some of pointers pDlyLow
// or pDlyHigh vectors are NULL;
// ippStspStateMatchErr - mismatch pState structure.
//
// Notes: lengths of delay lines:
// len(pDlyLow) = lenLow + offsLow - 1;
// len(pDlyHigh) = lenHigh + offsHigh - 1;
// lenLow, offsLow, lenHigh, offsHigh - parameters
// for ippsWTFwdInitAlloc function.
*)
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_8s32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_8u32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_16s32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_16u32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTFwd_32f, ippsWTFwd_16s32f, ippsWTFwd_16u32f,
// ippsWTFwd_8s32f, ippsWTFwd_8u32f
//
// Purpose: Forward wavelet transform.
//
// Parameters:
// pSrc - pointer to source block of data;
// pDstLow - pointer to destination block of
// "low-frequency" component;
// pDstHigh - pointer to destination block of
// "high-frequency" component;
// dstLen - length of destination;
// pState - pointer to pState structure.
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - some of pointers to pSrc, pDstLow
// or pDstHigh vectors are NULL;
// ippStsSizeErr - the length is less or equal zero;
// ippStspStateMatchErr - mismatch pState structure.
//
// Notes: source block length must be 2 * dstLen.
*)
function ippsWTFwd(pSrc:PIpp32f;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_32f):IppStatus;overload;
function ippsWTFwd(pSrc:PIpp8s;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_8s32f):IppStatus;overload;
function ippsWTFwd(pSrc:PIpp8u;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_8u32f):IppStatus;overload;
function ippsWTFwd(pSrc:PIpp16s;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_16s32f):IppStatus;overload;
function ippsWTFwd(pSrc:PIpp16u;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_16u32f):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTFwdFree_32f, ippsWTFwdFree_8s32f, ippsWTFwdFree_8u32f,
// ippsWTFwdFree_16s32f, ippsWTFwdFree_16u32f
//
// Purpose: Free and Deallocate forward wavelet transofrm pState structure.
//
// Parameters:
// IppsWTFwdState_32f *pState - pointer to pState structure.
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - Pointer to pState structure is NULL;
// ippStspStateMatchErr - Mismatch pState structure.
//
// Notes: if pointer to pState is NULL, ippStsNoErr will be returned.
*)
function ippsWTFwdFree(pState:PIppsWTFwdState_32f):IppStatus;overload;
function ippsWTFwdFree(pState:PIppsWTFwdState_8s32f):IppStatus;overload;
function ippsWTFwdFree(pState:PIppsWTFwdState_8u32f):IppStatus;overload;
function ippsWTFwdFree(pState:PIppsWTFwdState_16s32f):IppStatus;overload;
function ippsWTFwdFree(pState:PIppsWTFwdState_16u32f):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTInvInitAlloc_32f, ippsWTInvInitAlloc_32f8s,
// ippsWTInvInitAlloc_32f8u, ippsWTInvInitAlloc_32f16s,
// ippsWTInvInitAlloc_32f16u
//
// Purpose: Allocate and initialize
// inverse wavelet transform pState structure.
// Parameters:
// pState - pointer to pointer to allocated and initialized
// pState structure.
// pTapsLow - pointer to lowpass filter taps;
// lenLow - length of lowpass filter;
// offsLow - input delay of lowpass filter;
// pTapsHigh - pointer to highpass filter taps;
// lenHigh - length of highpass filter;
// offsHigh - input delay of highpass filter;
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - pointer to filter taps are NULL
// or pointer to pState structure is NULL;
// ippStsSizeErr - filter length is less or equal zero;
// ippStsWtOffsetErr - filter delay is less than (-1).
//
// Notes: filter output delay minimum value is 0 that corresponds to
// upsampling phase equal 0 (first sample included,
// second sample is zero and so on);
// pointer to returned error status may be NULL if no error
// diagnostic required.
*)
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f8s;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f8u;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f16s;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f16u;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTInvSetDlyLine_32f, ippsWTInvSetDlyLine_32f8s,
// ippsWTInvSetDlyLine_32f8u, ippsWTInvSetDlyLine_32f16s,
// ippsWTInvSetDlyLine_32f16u
//
// Purpose: The function copies the pointed vectors to internal delay lines.
//
// Parameters:
// pState - pointer to pState structure;
// pDlyLow - pointer to delay line for lowpass filtering;
// pDlyHigh - pointer to delay line for highpass filtering.
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - some of pointers pDlyLow
// or pDlyHigh vectors are NULL;
// ippStspStateMatchErr - mismatch pState structure.
//
// Notes: lengths of delay lines (as "C" expression):
// len(pDlyLow) = (lenLow + offsLow - 1) / 2;
// len(pDlyHigh) = (lenHigh + offsHigh - 1) / 2;
// lenLow, offsLow, lenHigh, offsHigh - parameters
// for ippsWTInvInitAlloc function.
*)
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f8s;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f8u;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f16s;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f16u;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTInvGetDlyLine_32f, ippsWTInvGetDlyLine_32f8s,
// ippsWTInvGetDlyLine_32f8u, ippsWTInvGetDlyLine_32f16s,
// ippsWTInvGetDlyLine_32f16u
//
// Purpose: The function copies data from interanl delay lines
// to the pointed vectors.
// Parameters:
// pState - pointer to pState structure;
// pDlyLow - pointer to delay line for lowpass filtering;
// pDlyHigh - pointer to delay line for highpass filtering.
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - some of pointers pDlyLow
// or pDlyHigh vectors are NULL;
// ippStspStateMatchErr - mismatch pState structure.
//
// Notes: lengths of delay lines (as "C" expression):
// len(pDlyLow) = (lenLow + offsLow - 1) / 2;
// len(pDlyHigh) = (lenHigh + offsHigh - 1) / 2;
// lenLow, offsLow, lenHigh, offsHigh - parameters
// for ippsWTInvInitAlloc function.
*)
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f8s;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f8u;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f16s;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f16u;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTInv_32f, ippsWTInv_32f16s, ippsWTInv_32f16u,
// ippsWTInv_32f8s, ippsWTInv_32f8u
//
// Purpose: Inverse wavelet transform.
//
// Parameters:
// srcLow - pointer to source block of
// "low-frequency" component;
// srcHigh - pointer to source block of
// "high-frequency" component;
// dstLen - length of components.
// dst - pointer to destination block of
// reconstructed data;
// pState - pointer to pState structure;
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - some of pointers to pDst pSrcLow
// or pSrcHigh vectors are NULL;
// ippStsSizeErr - the length is less or equal zero;
// ippStspStateMatchErr - mismatch pState structure.
//
// Notes: destination block length must be 2 * srcLen.
*)
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp32f;pState:PIppsWTInvState_32f):IppStatus;overload;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp8s;pState:PIppsWTInvState_32f8s):IppStatus;overload;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp8u;pState:PIppsWTInvState_32f8u):IppStatus;overload;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp16s;pState:PIppsWTInvState_32f16s):IppStatus;overload;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp16u;pState:PIppsWTInvState_32f16u):IppStatus;overload;
(* //////////////////////////////////////////////////////////////////////
// Name: ippsWTInvFree_32f, ippsWTInvFree_32f8s, ippsWTInvFree_32f8u,
// ippsWTInvFree_32f16s, ippsWTInvFree_32f16u
//
// Purpose: Free and Deallocate inverse wavelet transofrm pState structure.
//
// Parameters:
// IppsWTInvState_32f *pState - pointer to pState structure.
//
// Returns:
// ippStsNoErr - Ok;
// ippStsNullPtrErr - Pointer to pState structure is NULL;
// ippStspStateMatchErr - Mismatch pState structure.
//
// Notes: if pointer to pState is NULL, ippStsNoErr will be returned.
*)
function ippsWTInvFree(pState:PIppsWTInvState_32f):IppStatus;overload;
function ippsWTInvFree(pState:PIppsWTInvState_32f8s):IppStatus;overload;
function ippsWTInvFree(pState:PIppsWTInvState_32f8u):IppStatus;overload;
function ippsWTInvFree(pState:PIppsWTInvState_32f16s):IppStatus;overload;
function ippsWTInvFree(pState:PIppsWTInvState_32f16u):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Filtering
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Convolution functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsConv
// Purpose: Linear Convolution of 1D signals
// Parameters:
// pSrc1 pointer to the first source vector
// pSrc2 pointer to the second source vector
// lenSrc1 length of the first source vector
// lenSrc2 length of the second source vector
// pDst pointer to the destination vector
// Returns: IppStatus
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vectors is less or equal zero
// ippStsMemAllocErr no memory for internal buffers
// ippStsNoErr otherwise
// Notes:
// Length of the destination data vector is lenSrc1+lenSrc2-1.
// The input signal are exchangeable because of
// commutative convolution property.
// Some other values may be returned by FFT transform functions
*)
function ippsConv(pSrc1:PIpp32f;lenSrc1:longint;pSrc2:PIpp32f;lenSrc2:longint;pDst:PIpp32f):IppStatus;overload;
function ippsConv(pSrc1:PIpp16s;lenSrc1:longint;pSrc2:PIpp16s;lenSrc2:longint;pDst:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsConv(pSrc1:PIpp64f;lenSrc1:longint;pSrc2:PIpp64f;lenSrc2:longint;pDst:PIpp64f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsConvCyclic
// Purpose: Cyclic Convolution of 1D signals of fixed size
// Parameters: the pointers to data of fixed size
// Returns: IppStatus
// ippStsNoErr parameters are not checked
// Notes:
// The length of the convolution is given in the function name.
*)
function ippsConvCyclic8x8(x:PIpp32f;h:PIpp32f;y:PIpp32f):IppStatus;overload;
function ippsConvCyclic8x8(x:PIpp16s;h:PIpp16s;y:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsConvCyclic4x4(x:PIpp32f;h:PIpp32fc;y:PIpp32fc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// IIR filters (float and double taps versions)
///////////////////////////////////////////////////////////////////////////// *)
(* #if !defined( _OWN_BLDPCS )
struct IIRState_32f;
typedef struct IIRState_32f IppsIIRState_32f;
struct IIRState_32fc;
typedef struct IIRState_32fc IppsIIRState_32fc;
struct IIRState32f_16s;
typedef struct IIRState32f_16s IppsIIRState32f_16s;
struct IIRState32fc_16sc;
typedef struct IIRState32fc_16sc IppsIIRState32fc_16sc;
struct IIRState_64f;
typedef struct IIRState_64f IppsIIRState_64f;
struct IIRState_64fc;
typedef struct IIRState_64fc IppsIIRState_64fc;
struct IIRState64f_32f;
typedef struct IIRState64f_32f IppsIIRState64f_32f;
struct IIRState64fc_32fc;
typedef struct IIRState64fc_32fc IppsIIRState64fc_32fc;
struct IIRState64f_32s;
typedef struct IIRState64f_32s IppsIIRState64f_32s;
struct IIRState64fc_32sc;
typedef struct IIRState64fc_32sc IppsIIRState64fc_32sc;
struct IIRState64f_16s;
typedef struct IIRState64f_16s IppsIIRState64f_16s;
struct IIRState64fc_16sc;
typedef struct IIRState64fc_16sc IppsIIRState64fc_16sc;
struct IIRState32s_16s;
typedef struct IIRState32s_16s IppsIIRState32s_16s;
struct IIRState32sc_16sc;
typedef struct IIRState32sc_16sc IppsIIRState32sc_16sc;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// Initialize context
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIRInitAlloc, ippsIIRFree
// Purpose: initialize context arbitrary order IIR filter
// Parameters:
// pState - pointer to filter context
// pTaps - pointer to filter coefficients
// order - arbitrary filter order
// pDelay - pointer to delay line data, can be NULL
// Return: IppStatus
// ippStsMemAllocErr - memory allocation error
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsIIROrderErr - filter order < 0
// ippStsDivByZeroErr - A(0) is zero
// ippStsContextMatchErr - wrong context identifier
// ippStsNoErr - otherwise
// Order of the coefficients in the input taps buffer:
// B(0),B(1),B(2)..,B(order);
// A(0),A(1),A(2)..,A(order);
// . . .
// Note:
// A(0) != 0
// ippsIIRClose function works for both AR and BQ contexts
*)
function ippsIIRInitAlloc(var pState:PIppsIIRState_32f;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsIIRInitAlloc(var pState:PIppsIIRState_32fc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsIIRInitAlloc32f(var pState:PIppsIIRState32f_16s;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsIIRInitAlloc32fc(var pState:PIppsIIRState32fc_16sc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsIIRInitAlloc(var pState:PIppsIIRState_64f;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRInitAlloc(var pState:PIppsIIRState_64fc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRInitAlloc64f(var pState:PIppsIIRState64f_32f;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRInitAlloc64fc(var pState:PIppsIIRState64fc_32fc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRInitAlloc64f(var pState:PIppsIIRState64f_32s;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRInitAlloc64fc(var pState:PIppsIIRState64fc_32sc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRInitAlloc64f(var pState:PIppsIIRState64f_16s;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRInitAlloc64fc(var pState:PIppsIIRState64fc_16sc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRFree(pState:PIppsIIRState_32f):IppStatus;overload;
function ippsIIRFree(pState:PIppsIIRState_32fc):IppStatus;overload;
function ippsIIRFree32f(pState:PIppsIIRState32f_16s):IppStatus;overload;
function ippsIIRFree32fc(pState:PIppsIIRState32fc_16sc):IppStatus;overload;
function ippsIIRFree(pState:PIppsIIRState_64f):IppStatus;overload;
function ippsIIRFree(pState:PIppsIIRState_64fc):IppStatus;overload;
function ippsIIRFree64f(pState:PIppsIIRState64f_32f):IppStatus;overload;
function ippsIIRFree64fc(pState:PIppsIIRState64fc_32fc):IppStatus;overload;
function ippsIIRFree64f(pState:PIppsIIRState64f_32s):IppStatus;overload;
function ippsIIRFree64fc(pState:PIppsIIRState64fc_32sc):IppStatus;overload;
function ippsIIRFree64f(pState:PIppsIIRState64f_16s):IppStatus;overload;
function ippsIIRFree64fc(pState:PIppsIIRState64fc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIRInitAlloc_BiQuad
// Purpose: initialize biquad numBq-section filter
// Parameters:
// pState - pointer to filter context
// pTaps - pointer to filter coefficients
// numBq - number biquads of BQ filter
// pDelay - pointer to delay line data, can be NULL
// Return: IppStatus
// ippStsMemAllocErr - memory allocation error
// ippStsNullPtrErr - pointer(s) pState or pTaps is NULL
// ippStsIIROrderErr - numBq <= 0
// ippStsDivByZeroErr - A(n,0) or B(n,0) is zero
// ippStsNoErr - otherwise
//
// Order of the coefficients in the input taps buffer:
// B(0,0),B(0,1),B(0,2),A(0,0),A(0,1),A(0,2);
// B(1,0),B(1,1),B(1,2),A(1,0),A(1,1),A(1,2);
// . . .
// Notice:
// A(n,0) != 0 and B(n,0) != 0
*)
function ippsIIRInitAlloc_BiQuad(var pState:PIppsIIRState_32f;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsIIRInitAlloc_BiQuad(var pState:PIppsIIRState_32fc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsIIRInitAlloc32f_BiQuad(var pState:PIppsIIRState32f_16s;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsIIRInitAlloc32fc_BiQuad(var pState:PIppsIIRState32fc_16sc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsIIRInitAlloc_BiQuad(var pState:PIppsIIRState_64f;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRInitAlloc_BiQuad(var pState:PIppsIIRState_64fc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRInitAlloc64f_BiQuad(var pState:PIppsIIRState64f_32f;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRInitAlloc64fc_BiQuad(var pState:PIppsIIRState64fc_32fc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRInitAlloc64f_BiQuad(var pState:PIppsIIRState64f_32s;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRInitAlloc64fc_BiQuad(var pState:PIppsIIRState64fc_32sc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRInitAlloc64f_BiQuad(var pState:PIppsIIRState64f_16s;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRInitAlloc64fc_BiQuad(var pState:PIppsIIRState64fc_16sc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Work with Delay Line
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIRGetDlyLine, ippsIIRSetDlyLine
// Purpose: set and get delay line
// Parameters:
// pState - pointer to IIR filter context
// pDelay - pointer to delay line to be set
// Return:
// ippStsContextMatchErr - wrong context identifier
// ippStsNullPtrErr - pointer(s) pState or pDelay is NULL
// ippStsNoErr - otherwise
*)
function ippsIIRGetDlyLine(pState:PIppsIIRState_32f;pDlyLine:PIpp32f):IppStatus;overload;
function ippsIIRSetDlyLine(pState:PIppsIIRState_32f;pDlyLine:PIpp32f):IppStatus;overload;
function ippsIIRGetDlyLine(pState:PIppsIIRState_32fc;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsIIRSetDlyLine(pState:PIppsIIRState_32fc;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsIIRGetDlyLine32f(pState:PIppsIIRState32f_16s;pDlyLine:PIpp32f):IppStatus;overload;
function ippsIIRSetDlyLine32f(pState:PIppsIIRState32f_16s;pDlyLine:PIpp32f):IppStatus;overload;
function ippsIIRGetDlyLine32fc(pState:PIppsIIRState32fc_16sc;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsIIRSetDlyLine32fc(pState:PIppsIIRState32fc_16sc;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsIIRGetDlyLine(pState:PIppsIIRState_64f;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRSetDlyLine(pState:PIppsIIRState_64f;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRGetDlyLine(pState:PIppsIIRState_64fc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRSetDlyLine(pState:PIppsIIRState_64fc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRGetDlyLine64f(pState:PIppsIIRState64f_32f;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRSetDlyLine64f(pState:PIppsIIRState64f_32f;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRGetDlyLine64fc(pState:PIppsIIRState64fc_32fc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRSetDlyLine64fc(pState:PIppsIIRState64fc_32fc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRGetDlyLine64f(pState:PIppsIIRState64f_32s;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRSetDlyLine64f(pState:PIppsIIRState64f_32s;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRGetDlyLine64fc(pState:PIppsIIRState64fc_32sc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRSetDlyLine64fc(pState:PIppsIIRState64fc_32sc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRGetDlyLine64f(pState:PIppsIIRState64f_16s;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRSetDlyLine64f(pState:PIppsIIRState64f_16s;pDlyLine:PIpp64f):IppStatus;overload;
function ippsIIRGetDlyLine64fc(pState:PIppsIIRState64fc_16sc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsIIRSetDlyLine64fc(pState:PIppsIIRState64fc_16sc;pDlyLine:PIpp64fc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Filtering
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIROne
// Purpose: IIR filter with float or double taps. One sample operation
// Parameters:
// pState - pointer to IIR filter context
// src - input sample
// pDstVal - output sample
// scaleFactor - scale factor value
// Return:
// ippStsContextMatchErr - wrong context identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
//
// Note: Don't modify scaleFactor value unless context is changed
*)
function ippsIIROne(src:Ipp32f;pDstVal:PIpp32f;pState:PIppsIIRState_32f):IppStatus;overload;
function ippsIIROne(src:Ipp32fc;pDstVal:PIpp32fc;pState:PIppsIIRState_32fc):IppStatus;overload;
function ippsIIROne32f(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsIIRState32f_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIROne32fc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsIIRState32fc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsIIROne(src:Ipp64f;pDstVal:PIpp64f;pState:PIppsIIRState_64f):IppStatus;overload;
function ippsIIROne(src:Ipp64fc;pDstVal:PIpp64fc;pState:PIppsIIRState_64fc):IppStatus;overload;
function ippsIIROne64f(src:Ipp32f;pDstVal:PIpp32f;pState:PIppsIIRState64f_32f):IppStatus;overload;
function ippsIIROne64fc(src:Ipp32fc;pDstVal:PIpp32fc;pState:PIppsIIRState64fc_32fc):IppStatus;overload;
function ippsIIROne64f(src:Ipp32s;pDstVal:PIpp32s;pState:PIppsIIRState64f_32s;scaleFactor:longint):IppStatus;overload;
function ippsIIROne64fc(src:Ipp32sc;pDstVal:PIpp32sc;pState:PIppsIIRState64fc_32sc;scaleFactor:longint):IppStatus;overload;
function ippsIIROne64f(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsIIRState64f_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIROne64fc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsIIRState64fc_16sc;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIR
// Purpose: IIR filter with float or double taps. Vector filtering
// Parameters:
// pState - pointer to filter context
// pSrcDst - pointer to input/output vector in in-place ops
// pSrc - pointer to input vector
// pDst - pointer to output vector
// len - length of the vectors
// scaleFactor - scale factor value
// Return:
// ippStsContextMatchErr - wrong context identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsSizeErr - length of the vectors <= 0
// ippStsNoErr - otherwise
//
// Note: Don't modify scaleFactor value unless context is changed
*)
function ippsIIR(pSrc:PIpp32f;pDst:PIpp32f;len:longint;pState:PIppsIIRState_32f):IppStatus;overload;
function ippsIIR(pSrcDst:PIpp32f;len:longint;pState:PIppsIIRState_32f):IppStatus;overload;
function ippsIIR(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;pState:PIppsIIRState_32fc):IppStatus;overload;
function ippsIIR(pSrcDst:PIpp32fc;len:longint;pState:PIppsIIRState_32fc):IppStatus;overload;
function ippsIIR32f(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pState:PIppsIIRState32f_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIR32f(pSrcDst:PIpp16s;len:longint;pState:PIppsIIRState32f_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIR32fc(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;pState:PIppsIIRState32fc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsIIR32fc(pSrcDst:PIpp16sc;len:longint;pState:PIppsIIRState32fc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsIIR(pSrc:PIpp64f;pDst:PIpp64f;len:longint;pState:PIppsIIRState_64f):IppStatus;overload;
function ippsIIR(pSrcDst:PIpp64f;len:longint;pState:PIppsIIRState_64f):IppStatus;overload;
function ippsIIR(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;pState:PIppsIIRState_64fc):IppStatus;overload;
function ippsIIR(pSrcDst:PIpp64fc;len:longint;pState:PIppsIIRState_64fc):IppStatus;overload;
function ippsIIR64f(pSrc:PIpp32f;pDst:PIpp32f;len:longint;pState:PIppsIIRState64f_32f):IppStatus;overload;
function ippsIIR64f(pSrcDst:PIpp32f;len:longint;pState:PIppsIIRState64f_32f):IppStatus;overload;
function ippsIIR64fc(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;pState:PIppsIIRState64fc_32fc):IppStatus;overload;
function ippsIIR64fc(pSrcDst:PIpp32fc;len:longint;pState:PIppsIIRState64fc_32fc):IppStatus;overload;
function ippsIIR64f(pSrc:PIpp32s;pDst:PIpp32s;len:longint;pState:PIppsIIRState64f_32s;scaleFactor:longint):IppStatus;overload;
function ippsIIR64f(pSrcDst:PIpp32s;len:longint;pState:PIppsIIRState64f_32s;scaleFactor:longint):IppStatus;overload;
function ippsIIR64fc(pSrc:PIpp32sc;pDst:PIpp32sc;len:longint;pState:PIppsIIRState64fc_32sc;scaleFactor:longint):IppStatus;overload;
function ippsIIR64fc(pSrcDst:PIpp32sc;len:longint;pState:PIppsIIRState64fc_32sc;scaleFactor:longint):IppStatus;overload;
function ippsIIR64f(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pState:PIppsIIRState64f_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIR64f(pSrcDst:PIpp16s;len:longint;pState:PIppsIIRState64f_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIR64fc(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;pState:PIppsIIRState64fc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsIIR64fc(pSrcDst:PIpp16sc;len:longint;pState:PIppsIIRState64fc_16sc;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// IIR filters (integer taps version)
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Initialize context
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIRInitAlloc, ippsIIRInitAlloc_BiQuad, ippsIIRFree
// Purpose: create and initialize IIR context for AR filter
// Parameters:
// pState - pointer to filter context
// pTaps - pointer to filter coefficients
// order - arbitrary filter order
// tapsFactor - scale factor for Ipp32s context taps
// numBq - number of biquads in BQ filter
// pDelay - pointer to delay line, may be NULL
// Return:
// ippStsNoErr - Ok
// ippStsMemAllocErr - memory allocate error
// ippStsNullPtrErr - pointer(s) to pState or pTaps is NULL
// ippStsIIROrderErr - filter order < 0 or numBq <= 0
// ippStsDivByZeroErr - A(0) or A(n,0) or B(n,0) is zero
//
// the Ipp32s taps from the source Ipp32f taps and taps factor
// may be prepared by this way, for example
//
// ippsAbs_64f( taps, tmp, 6 );
// ippsMax_64f( tmp, 6, &tmax );
//
// tapsfactor = 0;
// if( tmax > IPP_MAX_32S )
// while( (tmax/=2) > IPP_MAX_32S ) ++tapsfactor;
// else
// while( (tmax*=2) < IPP_MAX_32S ) --tapsfactor;
//
// if( tapsfactor > 0 )
// ippsDivC_64f_I( (float)(1<<(++tapsfactor)), taps, 6 );
// else if( tapsfactor < 0 )
// ippsMulC_64f_I( (float)(1<<(-(tapsfactor))), taps, 6 );
//
// ippsCnvrt_64f32s_Sfs( taps, taps32s, 6, rndNear, 0 );
//
// Order of coefficients at the enter is:
// B(0),B(1),...,B(order),A(0),A(1),...,A(order)
// A(0) != 0
*)
function ippsIIRInitAlloc32s(var pState:PIppsIIRState32s_16s;pTaps:PIpp32s;order:longint;tapsFactor:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIRInitAlloc32s(var pState:PIppsIIRState32s_16s;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIRInitAlloc32sc(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32sc;order:longint;tapsFactor:longint;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsIIRInitAlloc32sc(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsIIRInitAlloc32s_BiQuad(var pState:PIppsIIRState32s_16s;pTaps:PIpp32s;numBq:longint;tapsFactor:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIRInitAlloc32s_BiQuad(var pState:PIppsIIRState32s_16s;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIRInitAlloc32sc_BiQuad(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32sc;numBq:longint;tapsFactor:longint;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsIIRInitAlloc32sc_BiQuad(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsIIRFree32s(pState:PIppsIIRState32s_16s):IppStatus;overload;
function ippsIIRFree32sc(pState:PIppsIIRState32sc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Work with Delay Line
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIRGetDlyLine, ippsIIRSetDlyLine
// Purpose: set and get delay line
// Parameters:
// pState - pointer to IIR filter context
// pDelay - pointer to delay line to be set
// Return:
// ippStsContextMatchErr - wrong context identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
*)
function ippsIIRGetDlyLine32s(pState:PIppsIIRState32s_16s;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIRSetDlyLine32s(pState:PIppsIIRState32s_16s;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIRGetDlyLine32sc(pState:PIppsIIRState32sc_16sc;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsIIRSetDlyLine32sc(pState:PIppsIIRState32sc_16sc;pDlyLine:PIpp32sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Filtering
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIROne
// Purpose: IIR filter. One sample operation
// Parameters:
// pState - pointer to the filter context
// src - the input sample
// pDstVal - pointer to the output sample
// scaleFactor - scale factor value
// Return:
// ippStsContextMatchErr - wrong context
// ippStsNullPtrErr - pointer(s) to pState or pDstVal is NULL
// ippStsNoErr - otherwise
//
// Note: Don't modify scaleFactor value unless context is changed
*)
function ippsIIROne32s(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsIIRState32s_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIROne32sc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsIIRState32sc_16sc;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIR
// Purpose: IIR filter. Vector filtering
// Parameters:
// pState - pointer to the filter context
// pSrc - pointer to input data
// pSrcDst - pointer to input/ouput data
// pDst - pointer to output data
// len - length of the vectors
// scaleFactor - scale factor value
// Return:
// ippStsContextMatchErr - wrong context
// ippStsNullPtrErr - pointer(s) pState or pSrc or pDst is NULL
// ippStsSizeErr - length of the vectors <= 0
// ippStsNoErr - otherwise
//
// Note: Don't modify scaleFactor value unless context is changed
*)
function ippsIIR32s(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pState:PIppsIIRState32s_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIR32sc(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;pState:PIppsIIRState32sc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsIIR32s(pSrcDst:PIpp16s;len:longint;pState:PIppsIIRState32s_16s;scaleFactor:longint):IppStatus;overload;
function ippsIIR32sc(pSrcDst:PIpp16sc;len:longint;pState:PIppsIIRState32sc_16sc;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIR_Direct_16s, ippsIIR_Direct_16s_I,
// ippsIIROne_Direct_16s, ippsIIROne_Direct_16s_I,
// ippsIIR_BiQuadDirect_16s, ippsIIR_BiQuadDirect_16s_I,
// ippsIIROne_BiQuadDirect_16s, ippsIIROne_BiQuadDirect_16s_I.
// Purpose: IIR filter with 16s taps. One sample (with suffix One), or vector
// operation, direct (without State structure) form. Suffix "BiQuad"
// means numBq-section filter, else the arbitrary coefficients IIR
// filter.
// Parameters:
// pSrc - pointer to the input array.
// src - input sample in 'One' case.
// pDst - pointer to the output array.
// pDstVal - pointer to the output sample in 'One' case.
// pSrcDst - pointer to the input and output array for the in-place
// operation.
// pSrcDstVal - pointer to the input and output sample for in-place
// operation in 'One' case.
// pTaps - pointer to filter coefficients
// order - arbitrary filter order
// numBq - number biquads of BQ filter
// pDlyLine - pointer to delay line data
// Return: IppStatus
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsIIROrderErr - filter order < 0
// ippStsScaleRangeErr - if A(0) < 0, see "Note..."
// ippStsMemAllocErr - memory allocation error
// ippStsSizeErr - length of the vectors <= 0
// ippStsNoErr - otherwise
//
// Order of the coefficients in the input taps buffer for the arbitrary
// filter:
// B(0),B(1),B(2)..,B(order);
// A(0),A(1),A(2)..,A(order);
// . . .
// Note:
// A(0) >= 0, and means the scale factor (not divisor !) for all the
// other taps.
// Order of the coefficients in the input taps buffer for BiQuad-section
// filter:
// B(0,0),B(0,1),B(0,2),A(0,0),A(0,1),A(0,2);
// B(1,0),B(1,1),B(1,2),A(1,0),A(1,1),A(1,2);
// ........
// Note:
// A(0,0) >= 0, A(1,0) >= 0..., and means the scale factor (not divisor !)
// for all the other taps of each section.
*)
function ippsIIR_Direct(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pTaps:PIpp16s;order:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIR_Direct(pSrcDst:PIpp16s;len:longint;pTaps:PIpp16s;order:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIROne_Direct(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp16s;order:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIROne_Direct(pSrcDst:PIpp16s;pTaps:PIpp16s;order:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIR_BiQuadDirect(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pTaps:PIpp16s;numBq:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIR_BiQuadDirect(pSrcDst:PIpp16s;len:longint;pTaps:PIpp16s;numBq:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIROne_BiQuadDirect(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp16s;numBq:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsIIROne_BiQuadDirect(pSrcDstVal:PIpp16s;pTaps:PIpp16s;numBq:longint;pDlyLine:PIpp32s):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Initialize IIR state with external memory buffer
//////////////////////////////////////////////////////////////////////////// *)
(* ////////////////////////////////////////////////////////////////////////////
// Name: ippsIIRGetStateSize, ippsIIRGetStateSize_BiQuad,
// ippsIIRInit, ippsIIRInit_BiQuad
// Purpose: ippsIIRGetStateSize - calculates the size of the IIR State
// structure;
// ippsIIRInit - initialize IIR state - set taps and delay line
// using external memory buffer;
// Parameters:
// pTaps - pointer to the filter coefficients;
// order - order of the filter;
// numBq - order of the filter;
// pDlyLine - pointer to the delay line values, can be NULL;
// pState - pointer to the IIR state created or NULL;
// tapsFactor - scaleFactor for taps (integer version);
// pStateSize - pointer where to store the calculated IIR State structure
// size (in bytes);
// Return:
// status - status value returned, its value are
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsIIROrderErr - order <= 0 or numBq < 1
// ippStsNoErr - otherwise
*)
(* ******************************** 32s_16s ******************************** *)
function ippsIIRGetStateSize32s(order:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize32sc(order:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize32s_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize32sc_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRInit32s(var pState:PIppsIIRState32s_16s;pTaps:PIpp32s;order:longint;tapsFactor:longint;pDlyLine:PIpp32s;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32sc(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32sc;order:longint;tapsFactor:longint;pDlyLine:PIpp32sc;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32s_BiQuad(var pState:PIppsIIRState32s_16s;pTaps:PIpp32s;numBq:longint;tapsFactor:longint;pDlyLine:PIpp32s;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32sc_BiQuad(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32sc;numBq:longint;tapsFactor:longint;pDlyLine:PIpp32sc;pBuf:PIpp8u):IppStatus;overload;
(* ****************************** 32s_16s32f ******************************* *)
{ function ippsIIRGetStateSize32s_16s32f(order:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize32sc_16sc32fc(order:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize32s_BiQuad_16s32f(numBq:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize32sc_BiQuad_16sc32fc(numBq:longint;pBufferSize:Plongint):IppStatus; }
function ippsIIRInit32s(var pState:PIppsIIRState32s_16s;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32s;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32sc(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32sc;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32s_BiQuad(var pState:PIppsIIRState32s_16s;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32s;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32sc_BiQuad(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32sc;pBuf:PIpp8u):IppStatus;overload;
(* ********************************** 32f ********************************** *)
function ippsIIRGetStateSize(order:longint;pBufferSize:Plongint):IppStatus;overload;
{ function ippsIIRGetStateSize_32fc(order:longint;pBufferSize:Plongint):IppStatus; }
function ippsIIRGetStateSize_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;overload;
{ function ippsIIRGetStateSize_BiQuad_32fc(numBq:longint;pBufferSize:Plongint):IppStatus; }
function ippsIIRInit(var pState:PIppsIIRState_32f;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit(var pState:PIppsIIRState_32fc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32fc;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit_BiQuad(var pState:PIppsIIRState_32f;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit_BiQuad(var pState:PIppsIIRState_32fc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32fc;pBuf:PIpp8u):IppStatus;overload;
(* ******************************** 32f_16s ******************************** *)
function ippsIIRGetStateSize32f(order:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize32fc(order:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize32f_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize32fc_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRInit32f(var pState:PIppsIIRState32f_16s;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32fc(var pState:PIppsIIRState32fc_16sc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32fc;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32f_BiQuad(var pState:PIppsIIRState32f_16s;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit32fc_BiQuad(var pState:PIppsIIRState32fc_16sc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32fc;pBuf:PIpp8u):IppStatus;overload;
(* ********************************** 64f ********************************** *)
{ function ippsIIRGetStateSize_64f(order:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize_64fc(order:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize_BiQuad_64f(numBq:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize_BiQuad_64fc(numBq:longint;pBufferSize:Plongint):IppStatus; }
function ippsIIRInit(var pState:PIppsIIRState_64f;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit(var pState:PIppsIIRState_64fc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit_BiQuad(var pState:PIppsIIRState_64f;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit_BiQuad(var pState:PIppsIIRState_64fc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;overload;
(* ******************************** 64f_16s ******************************** *)
function ippsIIRGetStateSize64f(order:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize64fc(order:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize64f_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRGetStateSize64fc_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsIIRInit64f(var pState:PIppsIIRState64f_16s;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64fc(var pState:PIppsIIRState64fc_16sc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64f_BiQuad(var pState:PIppsIIRState64f_16s;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64fc_BiQuad(var pState:PIppsIIRState64fc_16sc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;overload;
(* ******************************** 64f_32s ******************************** *)
{ function ippsIIRGetStateSize64f_32s(order:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize64fc_32sc(order:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize64f_BiQuad_32s(numBq:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize64fc_BiQuad_32sc(numBq:longint;pBufferSize:Plongint):IppStatus; }
function ippsIIRInit64f(var pState:PIppsIIRState64f_32s;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64fc(var pState:PIppsIIRState64fc_32sc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64f_BiQuad(var pState:PIppsIIRState64f_32s;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64fc_BiQuad(var pState:PIppsIIRState64fc_32sc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;overload;
(* ******************************** 64f_32f ******************************** *)
{ function ippsIIRGetStateSize64f_32f(order:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize64fc_32fc(order:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize64f_BiQuad_32f(numBq:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsIIRGetStateSize64fc_BiQuad_32fc(numBq:longint;pBufferSize:Plongint):IppStatus; }
function ippsIIRInit64f(var pState:PIppsIIRState64f_32f;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64fc(var pState:PIppsIIRState64fc_32fc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64f_BiQuad(var pState:PIppsIIRState64f_32f;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;overload;
function ippsIIRInit64fc_BiQuad(var pState:PIppsIIRState64fc_32fc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsIIRSetTaps
// Purpose: set new IIR taps values to state
// Parameters:
// pTaps - pointer to new IIR taps
// pState - pointer to the IIR filter state
// tapsFactor - scaleFactor for taps (integer version only)
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
*)
function ippsIIRSetTaps(pTaps:PIpp32f;pState:PIppsIIRState_32f):IppStatus;overload;
function ippsIIRSetTaps(pTaps:PIpp32fc;pState:PIppsIIRState_32fc):IppStatus;overload;
function ippsIIRSetTaps32f(pTaps:PIpp32f;pState:PIppsIIRState32f_16s):IppStatus;overload;
function ippsIIRSetTaps32fc(pTaps:PIpp32fc;pState:PIppsIIRState32fc_16sc):IppStatus;overload;
function ippsIIRSetTaps32s(pTaps:PIpp32s;pState:PIppsIIRState32s_16s;tapsFactor:longint):IppStatus;overload;
function ippsIIRSetTaps32sc(pTaps:PIpp32sc;pState:PIppsIIRState32sc_16sc;tapsFactor:longint):IppStatus;overload;
function ippsIIRSetTaps32s(pTaps:PIpp32f;pState:PIppsIIRState32s_16s):IppStatus;overload;
function ippsIIRSetTaps32sc(pTaps:PIpp32fc;pState:PIppsIIRState32sc_16sc):IppStatus;overload;
function ippsIIRSetTaps(pTaps:PIpp64f;pState:PIppsIIRState_64f):IppStatus;overload;
function ippsIIRSetTaps(pTaps:PIpp64fc;pState:PIppsIIRState_64fc):IppStatus;overload;
function ippsIIRSetTaps64f(pTaps:PIpp64f;pState:PIppsIIRState64f_32f):IppStatus;overload;
function ippsIIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsIIRState64fc_32fc):IppStatus;overload;
function ippsIIRSetTaps64f(pTaps:PIpp64f;pState:PIppsIIRState64f_32s):IppStatus;overload;
function ippsIIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsIIRState64fc_32sc):IppStatus;overload;
function ippsIIRSetTaps64f(pTaps:PIpp64f;pState:PIppsIIRState64f_16s):IppStatus;overload;
function ippsIIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsIIRState64fc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// FIR filters (float and double taps versions)
///////////////////////////////////////////////////////////////////////////// *)
(* #if !defined( _OWN_BLDPCS )
struct FIRState_32f;
typedef struct FIRState_32f IppsFIRState_32f;
struct FIRState_32fc;
typedef struct FIRState_32fc IppsFIRState_32fc;
struct FIRState32f_16s;
typedef struct FIRState32f_16s IppsFIRState32f_16s;
struct FIRState32fc_16sc;
typedef struct FIRState32fc_16sc IppsFIRState32fc_16sc;
struct FIRState_64f;
typedef struct FIRState_64f IppsFIRState_64f;
struct FIRState_64fc;
typedef struct FIRState_64fc IppsFIRState_64fc;
struct FIRState64f_32f;
typedef struct FIRState64f_32f IppsFIRState64f_32f;
struct FIRState64fc_32fc;
typedef struct FIRState64fc_32fc IppsFIRState64fc_32fc;
struct FIRState64f_32s;
typedef struct FIRState64f_32s IppsFIRState64f_32s;
struct FIRState64fc_32sc;
typedef struct FIRState64fc_32sc IppsFIRState64fc_32sc;
struct FIRState64f_16s;
typedef struct FIRState64f_16s IppsFIRState64f_16s;
struct FIRState64fc_16sc;
typedef struct FIRState64fc_16sc IppsFIRState64fc_16sc;
struct FIRState32s_16s;
typedef struct FIRState32s_16s IppsFIRState32s_16s;
struct FIRState32sc_16sc;
typedef struct FIRState32sc_16sc IppsFIRState32sc_16sc;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// Initialize FIR state
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsFIRInitAlloc, ippsFIRMRInitAlloc, ippsFIRFree
// Purpose: create and initialize FIR state - set taps and delay line
// and close it
// Parameters:
// pTaps - pointer to the filter coefficients
// tapsLen - number of coefficients
// pDlyLine - pointer to the delay line values, can be NULL
// state - pointer to the FIR state created or NULL;
// Return:
// status - status value returned, its value are
// ippStsMemAllocErr - memory allocation error
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsFIRLenErr - tapsLen <= 0
// ippStsFIRMRFactorErr - factor <= 0
// ippStsFIRMRPhaseErr - phase < 0 || factor <= phase
// ippStsContextMatchErr - wrong state identifier
// ippStsNoErr - otherwise
*)
function ippsFIRInitAlloc(var pState:PIppsFIRState_32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRMRInitAlloc(var pState:PIppsFIRState_32f;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRInitAlloc(var pState:PIppsFIRState_32fc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRMRInitAlloc(var pState:PIppsFIRState_32fc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRInitAlloc32f(var pState:PIppsFIRState32f_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRMRInitAlloc32f(var pState:PIppsFIRState32f_16s;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRInitAlloc32fc(var pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRMRInitAlloc32fc(var pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRInitAlloc(var pState:PIppsFIRState_64f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsFIRMRInitAlloc(var pState:PIppsFIRState_64f;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsFIRInitAlloc(var pState:PIppsFIRState_64fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsFIRMRInitAlloc(var pState:PIppsFIRState_64fc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsFIRInitAlloc64f(var pState:PIppsFIRState64f_32f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRMRInitAlloc64f(var pState:PIppsFIRState64f_32f;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRInitAlloc64fc(var pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRMRInitAlloc64fc(var pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRInitAlloc64f(var pState:PIppsFIRState64f_32s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsFIRMRInitAlloc64f(var pState:PIppsFIRState64f_32s;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32s):IppStatus;overload;
function ippsFIRInitAlloc64fc(var pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsFIRMRInitAlloc64fc(var pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsFIRInitAlloc64f(var pState:PIppsFIRState64f_16s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRMRInitAlloc64f(var pState:PIppsFIRState64f_16s;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRInitAlloc64fc(var pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRMRInitAlloc64fc(var pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRFree(pState:PIppsFIRState_32f):IppStatus;overload;
function ippsFIRFree(pState:PIppsFIRState_32fc):IppStatus;overload;
function ippsFIRFree32f(pState:PIppsFIRState32f_16s):IppStatus;overload;
function ippsFIRFree32fc(pState:PIppsFIRState32fc_16sc):IppStatus;overload;
function ippsFIRFree(pState:PIppsFIRState_64f):IppStatus;overload;
function ippsFIRFree(pState:PIppsFIRState_64fc):IppStatus;overload;
function ippsFIRFree64f(pState:PIppsFIRState64f_32f):IppStatus;overload;
function ippsFIRFree64fc(pState:PIppsFIRState64fc_32fc):IppStatus;overload;
function ippsFIRFree64f(pState:PIppsFIRState64f_32s):IppStatus;overload;
function ippsFIRFree64fc(pState:PIppsFIRState64fc_32sc):IppStatus;overload;
function ippsFIRFree64f(pState:PIppsFIRState64f_16s):IppStatus;overload;
function ippsFIRFree64fc(pState:PIppsFIRState64fc_16sc):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Initialize FIR state with external memory buffer
//////////////////////////////////////////////////////////////////////////// *)
(* ////////////////////////////////////////////////////////////////////////////
// Name: ippsFIRGetStateSize, ippsFIRMRGetStateSize,
// ippsFIRInit, ippsFIRMRInit
// Purpose: ippsFIRGetStateSize - calculates the size of the FIR State
// structure;
// ippsFIRInit - initialize FIR state - set taps and delay line
// using external memory buffer;
// Parameters:
// pTaps - pointer to the filter coefficients;
// tapsLen - number of coefficients;
// pDlyLine - pointer to the delay line values, can be NULL;
// pState - pointer to the FIR state created or NULL;
// upFactor - multi-rate up factor;
// upPhase - multi-rate up phase;
// downFactor - multi-rate down factor;
// downPhase - multi-rate down phase;
// pStateSize - pointer where to store the calculated FIR State structure
// size (in bytes);
// Return:
// status - status value returned, its value are
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsFIRLenErr - tapsLen <= 0
// ippStsFIRMRFactorErr - factor <= 0
// ippStsFIRMRPhaseErr - phase < 0 || factor <= phase
// ippStsNoErr - otherwise
*)
(* ******************************** 32s_16s ******************************** *)
function ippsFIRGetStateSize32s(tapsLen:longint;pStateSize:Plongint):IppStatus;overload;
function ippsFIRInit32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRMRGetStateSize32s(tapsLen:longint;upFactor:longint;downFactor:longint;pStateSize:Plongint):IppStatus;overload;
function ippsFIRMRInit32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRInit32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRMRGetStateSize32sc(tapsLen:longint;upFactor:longint;downFactor:longint;pStateSize:Plongint):IppStatus;overload;
function ippsFIRMRInit32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRGetStateSize32sc(tapsLen:longint;pStateSize:Plongint):IppStatus;overload;
(* ****************************** 32s_16s32f ******************************* *)
{ function ippsFIRGetStateSize32s_16s32f(tapsLen:longint;pStateSize:Plongint):IppStatus; }
function ippsFIRInit32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRMRGetStateSize32s_16s32f(tapsLen:longint;upFactor:longint;downFactor:longint;pStateSize:Plongint):IppStatus; }
function ippsFIRMRInit32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRGetStateSize32sc_16sc(tapsLen:longint;pStateSize:Plongint):IppStatus; }
function ippsFIRInit32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRMRGetStateSize32sc_16sc32fc(tapsLen:longint;upFactor:longint;downFactor:longint;pStateSize:Plongint):IppStatus; }
function ippsFIRMRInit32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;overload;
(* ********************************** 32f ********************************** *)
function ippsFIRInit(var pState:PIppsFIRState_32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRInit(var pState:PIppsFIRState_32fc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRGetStateSize(tapsLen:longint;pBufferSize:Plongint):IppStatus;overload;
{ function ippsFIRGetStateSize_32fc(tapsLen:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRMRInit(var pState:PIppsFIRState_32f;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRMRGetStateSize(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;overload;
{ function ippsFIRMRGetStateSize_32fc(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRMRInit(var pState:PIppsFIRState_32fc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc;pBuffer:PIpp8u):IppStatus;overload;
(* ******************************** 32f_16s ******************************** *)
function ippsFIRGetStateSize32f(tapsLen:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsFIRInit32f(var pState:PIppsFIRState32f_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRGetStateSize32fc(tapsLen:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsFIRInit32fc(var pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRMRGetStateSize32f(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsFIRMRInit32f(var pState:PIppsFIRState32f_16s;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRMRGetStateSize32fc(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsFIRMRInit32fc(var pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;overload;
(* ********************************** 64f ********************************** *)
function ippsFIRInit(var pState:PIppsFIRState_64f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRInit(var pState:PIppsFIRState_64fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRGetStateSize_64f(tapsLen:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsFIRGetStateSize_64fc(tapsLen:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRMRInit(var pState:PIppsFIRState_64f;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64f;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRMRGetStateSize_64f(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus; }
{ function ippsFIRMRGetStateSize_64fc(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRMRInit(var pState:PIppsFIRState_64fc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64fc;pBuffer:PIpp8u):IppStatus;overload;
(* ******************************** 64f_16s ******************************** *)
function ippsFIRGetStateSize64f(tapsLen:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsFIRInit64f(var pState:PIppsFIRState64f_16s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRGetStateSize64fc(tapsLen:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsFIRInit64fc(var pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRMRGetStateSize64f(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsFIRMRInit64f(var pState:PIppsFIRState64f_16s;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;overload;
function ippsFIRMRGetStateSize64fc(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;overload;
function ippsFIRMRInit64fc(var pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;overload;
(* ******************************** 64f_32s ******************************** *)
{ function ippsFIRGetStateSize64f_32s(tapsLen:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRInit64f(var pState:PIppsFIRState64f_32s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRGetStateSize64fc_32sc(tapsLen:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRInit64fc(var pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRMRGetStateSize64f_32s(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRMRInit64f(var pState:PIppsFIRState64f_32s;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32s;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRMRGetStateSize64fc_32sc(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRMRInit64fc(var pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32sc;pBuffer:PIpp8u):IppStatus;overload;
(* ******************************** 64f_32f ******************************** *)
{ function ippsFIRGetStateSize64f_32f(tapsLen:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRInit64f(var pState:PIppsFIRState64f_32f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRGetStateSize64fc_32fc(tapsLen:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRInit64fc(var pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRMRGetStateSize64f_32f(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRMRInit64f(var pState:PIppsFIRState64f_32f;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f;pBuffer:PIpp8u):IppStatus;overload;
{ function ippsFIRMRGetStateSize64fc_32fc(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus; }
function ippsFIRMRInit64fc(var pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc;pBuffer:PIpp8u):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRGetTaps
// Purpose: get FIR taps value from state
// Parameters:
// pTaps - pointer to buffer to get FIR taps
// pState - pointer to the FIR filter state
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
*)
function ippsFIRGetTaps(pState:PIppsFIRState_32f;pTaps:PIpp32f):IppStatus;overload;
function ippsFIRGetTaps(pState:PIppsFIRState_32fc;pTaps:PIpp32fc):IppStatus;overload;
function ippsFIRGetTaps32f(pState:PIppsFIRState32f_16s;pTaps:PIpp32f):IppStatus;overload;
function ippsFIRGetTaps32fc(pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc):IppStatus;overload;
function ippsFIRGetTaps(pState:PIppsFIRState_64f;pTaps:PIpp64f):IppStatus;overload;
function ippsFIRGetTaps(pState:PIppsFIRState_64fc;pTaps:PIpp64fc):IppStatus;overload;
function ippsFIRGetTaps64f(pState:PIppsFIRState64f_32f;pTaps:PIpp64f):IppStatus;overload;
function ippsFIRGetTaps64fc(pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc):IppStatus;overload;
function ippsFIRGetTaps64f(pState:PIppsFIRState64f_32s;pTaps:PIpp64f):IppStatus;overload;
function ippsFIRGetTaps64fc(pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc):IppStatus;overload;
function ippsFIRGetTaps64f(pState:PIppsFIRState64f_16s;pTaps:PIpp64f):IppStatus;overload;
function ippsFIRGetTaps64fc(pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRGSetTaps
// Purpose: set FIR taps value to state
// Parameters:
// pTaps - pointer to buffer to set FIR taps
// pState - pointer to the FIR filter state
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
*)
function ippsFIRSetTaps(pTaps:PIpp32f;pState:PIppsFIRState_32f):IppStatus;overload;
function ippsFIRSetTaps(pTaps:PIpp32fc;pState:PIppsFIRState_32fc):IppStatus;overload;
function ippsFIRSetTaps32f(pTaps:PIpp32f;pState:PIppsFIRState32f_16s):IppStatus;overload;
function ippsFIRSetTaps32fc(pTaps:PIpp32fc;pState:PIppsFIRState32fc_16sc):IppStatus;overload;
function ippsFIRSetTaps32s(pTaps:PIpp32s;pState:PIppsFIRState32s_16s;tapsFactor:longint):IppStatus;overload;
function ippsFIRSetTaps32sc(pTaps:PIpp32sc;pState:PIppsFIRState32sc_16sc;tapsFactor:longint):IppStatus;overload;
function ippsFIRSetTaps32s(pTaps:PIpp32f;pState:PIppsFIRState32s_16s):IppStatus;overload;
function ippsFIRSetTaps32sc(pTaps:PIpp32fc;pState:PIppsFIRState32sc_16sc):IppStatus;overload;
function ippsFIRSetTaps(pTaps:PIpp64f;pState:PIppsFIRState_64f):IppStatus;overload;
function ippsFIRSetTaps(pTaps:PIpp64fc;pState:PIppsFIRState_64fc):IppStatus;overload;
function ippsFIRSetTaps64f(pTaps:PIpp64f;pState:PIppsFIRState64f_32f):IppStatus;overload;
function ippsFIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsFIRState64fc_32fc):IppStatus;overload;
function ippsFIRSetTaps64f(pTaps:PIpp64f;pState:PIppsFIRState64f_32s):IppStatus;overload;
function ippsFIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsFIRState64fc_32sc):IppStatus;overload;
function ippsFIRSetTaps64f(pTaps:PIpp64f;pState:PIppsFIRState64f_16s):IppStatus;overload;
function ippsFIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsFIRState64fc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Work with Delay Line
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRGetDlyLine, ippsFIRSetDlyLine
// Purpose: set and get delay line
// Parameters:
// pDlyLine - pointer to delay line
// pState - pointer to the filter state
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
// Note: pDlyLine may be NULL
*)
function ippsFIRGetDlyLine(pState:PIppsFIRState_32f;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRSetDlyLine(pState:PIppsFIRState_32f;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRGetDlyLine(pState:PIppsFIRState_32fc;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRSetDlyLine(pState:PIppsFIRState_32fc;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRGetDlyLine32f(pState:PIppsFIRState32f_16s;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRSetDlyLine32f(pState:PIppsFIRState32f_16s;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRGetDlyLine32fc(pState:PIppsFIRState32fc_16sc;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRSetDlyLine32fc(pState:PIppsFIRState32fc_16sc;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRGetDlyLine(pState:PIppsFIRState_64f;pDlyLine:PIpp64f):IppStatus;overload;
function ippsFIRSetDlyLine(pState:PIppsFIRState_64f;pDlyLine:PIpp64f):IppStatus;overload;
function ippsFIRGetDlyLine(pState:PIppsFIRState_64fc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsFIRSetDlyLine(pState:PIppsFIRState_64fc;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsFIRGetDlyLine64f(pState:PIppsFIRState64f_32f;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRSetDlyLine64f(pState:PIppsFIRState64f_32f;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRGetDlyLine64fc(pState:PIppsFIRState64fc_32fc;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRSetDlyLine64fc(pState:PIppsFIRState64fc_32fc;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRGetDlyLine64f(pState:PIppsFIRState64f_32s;pDlyLine:PIpp32s):IppStatus;overload;
function ippsFIRSetDlyLine64f(pState:PIppsFIRState64f_32s;pDlyLine:PIpp32s):IppStatus;overload;
function ippsFIRGetDlyLine64fc(pState:PIppsFIRState64fc_32sc;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsFIRSetDlyLine64fc(pState:PIppsFIRState64fc_32sc;pDlyLine:PIpp32sc):IppStatus;overload;
function ippsFIRGetDlyLine64f(pState:PIppsFIRState64f_16s;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRSetDlyLine64f(pState:PIppsFIRState64f_16s;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRGetDlyLine64fc(pState:PIppsFIRState64fc_16sc;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRSetDlyLine64fc(pState:PIppsFIRState64fc_16sc;pDlyLine:PIpp16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Filtering
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIROne
// Purpose: FIR filter. One point filtering
// Parameters:
// src - input sample
// pDstVal - output sample
// pState - pointer to the filter state
// scaleFactor - scale factor value
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
*)
function ippsFIROne(src:Ipp32f;pDstVal:PIpp32f;pState:PIppsFIRState_32f):IppStatus;overload;
function ippsFIROne(src:Ipp32fc;pDstVal:PIpp32fc;pState:PIppsFIRState_32fc):IppStatus;overload;
function ippsFIROne32f(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsFIRState32f_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32fc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsFIRState32fc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIROne(src:Ipp64f;pDstVal:PIpp64f;pState:PIppsFIRState_64f):IppStatus;overload;
function ippsFIROne(src:Ipp64fc;pDstVal:PIpp64fc;pState:PIppsFIRState_64fc):IppStatus;overload;
function ippsFIROne64f(src:Ipp32f;pDstVal:PIpp32f;pState:PIppsFIRState64f_32f):IppStatus;overload;
function ippsFIROne64fc(src:Ipp32fc;pDstVal:PIpp32fc;pState:PIppsFIRState64fc_32fc):IppStatus;overload;
function ippsFIROne64f(src:Ipp32s;pDstVal:PIpp32s;pState:PIppsFIRState64f_32s;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64fc(src:Ipp32sc;pDstVal:PIpp32sc;pState:PIppsFIRState64fc_32sc;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64f(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsFIRState64f_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64fc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsFIRState64fc_16sc;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIR
// Purpose: FIR filter. Vector filtering
// Parameters:
// pSrcDst - pointer to the input/output vector in in-place operation
// pSrc - pointer to the input vector
// pDst - pointer to the output vector
// numIters - number iterations (for single-rate equal length data vector)
// pState - pointer to the filter state
// scaleFactor - scale factor value
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsSizeErr - numIters is less or equal zero
// ippStsNoErr - otherwise
// Note: for Multi-Rate filtering
// length pSrc = numIters*downFactor
// length pDst = numIters*upFactor
// for inplace functions max this values
*)
function ippsFIR(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pState:PIppsFIRState_32f):IppStatus;overload;
function ippsFIR(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pState:PIppsFIRState_32fc):IppStatus;overload;
function ippsFIR32f(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pState:PIppsFIRState32f_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIR32fc(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pState:PIppsFIRState32fc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIR(pSrcDst:PIpp32f;numIters:longint;pState:PIppsFIRState_32f):IppStatus;overload;
function ippsFIR(pSrcDst:PIpp32fc;numIters:longint;pState:PIppsFIRState_32fc):IppStatus;overload;
function ippsFIR32f(pSrcDst:PIpp16s;numIters:longint;pState:PIppsFIRState32f_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIR32fc(pSrcDst:PIpp16sc;numIters:longint;pState:PIppsFIRState32fc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIR(pSrc:PIpp64f;pDst:PIpp64f;numIters:longint;pState:PIppsFIRState_64f):IppStatus;overload;
function ippsFIR(pSrc:PIpp64fc;pDst:PIpp64fc;numIters:longint;pState:PIppsFIRState_64fc):IppStatus;overload;
function ippsFIR(pSrcDst:PIpp64f;numIters:longint;pState:PIppsFIRState_64f):IppStatus;overload;
function ippsFIR(pSrcDst:PIpp64fc;numIters:longint;pState:PIppsFIRState_64fc):IppStatus;overload;
function ippsFIR64f(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pState:PIppsFIRState64f_32f):IppStatus;overload;
function ippsFIR64fc(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pState:PIppsFIRState64fc_32fc):IppStatus;overload;
function ippsFIR64f(pSrcDst:PIpp32f;numIters:longint;pState:PIppsFIRState64f_32f):IppStatus;overload;
function ippsFIR64fc(pSrcDst:PIpp32fc;numIters:longint;pState:PIppsFIRState64fc_32fc):IppStatus;overload;
function ippsFIR64f(pSrc:PIpp32s;pDst:PIpp32s;numIters:longint;pState:PIppsFIRState64f_32s;scaleFactor:longint):IppStatus;overload;
function ippsFIR64fc(pSrc:PIpp32sc;pDst:PIpp32sc;numIters:longint;pState:PIppsFIRState64fc_32sc;scaleFactor:longint):IppStatus;overload;
function ippsFIR64f(pSrcDst:PIpp32s;numIters:longint;pState:PIppsFIRState64f_32s;scaleFactor:longint):IppStatus;overload;
function ippsFIR64fc(pSrcDst:PIpp32sc;numIters:longint;pState:PIppsFIRState64fc_32sc;scaleFactor:longint):IppStatus;overload;
function ippsFIR64f(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pState:PIppsFIRState64f_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIR64fc(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pState:PIppsFIRState64fc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIR64f(pSrcDst:PIpp16s;numIters:longint;pState:PIppsFIRState64f_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIR64fc(pSrcDst:PIpp16sc;numIters:longint;pState:PIppsFIRState64fc_16sc;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// FIR filters (integer taps version)
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Initialize State
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRInitAlloc, ippsFIRMRInitAlloc, ippsFIRFree
// Purpose: create and initialize FIR state, set taps and delay line
// Parameters:
// pTaps - pointer to the filter coefficients
// tapsLen - number of coefficients
// tapsFactor - scale factor of Ipp32s taps
// pDlyLine - pointer delay line, may be NULL
// state - pointer to the state created or NULL
// Return:
// status - status returned, its values are
// ippStsMemAllocErr - memory allocation error
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsFIRLenErr - tapsLen <= 0
// ippStsFIRMRFactorErr - factor <= 0
// ippStsFIRMRPhaseErr - phase < 0 || factor <= phase
// ippStsNoErr - otherwise
// Notes: pTaps and tapsFactor for Ipp32s calculate as follows
//
// Ipp64f mpy = 1.0;
// Ipp32f pFTaps[tapsLen]; // true values of the coefficients
// Ipp32s pTaps[tapsLen]; // values to be pass to integer FIR
//
// ... calculate coefficients, filling pFTaps ...
//
// max = MAX(abs(pFTaps[i])); for i = 0..tapsLen-1
//
// tapsFactor = 0;
// if (max > IPP_MAX_32S) {
// while (max > IPP_MAX_32S) {
// tapsFactor++;
// max *= 0.5;
// mpy *= 0.5;
// }
// } else {
// while (max < IPP_MAX_32S && tapsFactor > -17) {
// tapsFactor--;
// max += max;
// mpy += mpy;
// }
// tapsFactor++;
// mpy *= 0.5;
// }
//
// for (i = 0; i < tapsLen; i++)
// if (pFTaps[i] < 0)
// pSTaps[i] = (Ipp32s)(mpy*pFTaps[i]-0.5);
// else
// pSTaps[i] = (Ipp32s)(mpy*pFTaps[i]+0.5);
*)
function ippsFIRInitAlloc32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRMRInitAlloc32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRInitAlloc32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRMRInitAlloc32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRInitAlloc32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRMRInitAlloc32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRInitAlloc32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRMRInitAlloc32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRFree32s(pState:PIppsFIRState32s_16s):IppStatus;overload;
function ippsFIRFree32sc(pState:PIppsFIRState32sc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRGetTaps
// Purpose: get FIR taps value from state
// Parameters:
// pTaps - pointer to buffer to get FIR taps
// pState - pointer to the FIR filter state
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
*)
function ippsFIRGetTaps32s(pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsFactor:Plongint):IppStatus;overload;
function ippsFIRGetTaps32sc(pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsFactor:Plongint):IppStatus;overload;
function ippsFIRGetTaps32s(pState:PIppsFIRState32s_16s;pTaps:PIpp32f):IppStatus;overload;
function ippsFIRGetTaps32sc(pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Work with Delay Line
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRGetDlyLine, ippsFIRSetDlyLine
// Purpose: set and get delay line
// Parameters:
// pDlyLine - pointer to the delay line
// pState - pointer to the FIR filter state
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
// Note: pDlyLine may be NULL
*)
function ippsFIRGetDlyLine32s(pState:PIppsFIRState32s_16s;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRSetDlyLine32s(pState:PIppsFIRState32s_16s;pDlyLine:PIpp16s):IppStatus;overload;
function ippsFIRGetDlyLine32sc(pState:PIppsFIRState32sc_16sc;pDlyLine:PIpp16sc):IppStatus;overload;
function ippsFIRSetDlyLine32sc(pState:PIppsFIRState32sc_16sc;pDlyLine:PIpp16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Filtering
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIROne, ippsFIROne
// Purpose: FIR filter with integer taps. One sample filtering
// Parameters:
// src - input sample
// pDstVal - pointer to the output sample
// pState - pointer to the FIR filter state
// scaleFactor - scale factor value
// Return:
// ippStsContextMatchErr - wrong state identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsNoErr - otherwise
*)
function ippsFIROne32s(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsFIRState32s_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32sc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsFIRState32sc_16sc;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIR
// Purpose: FIR filter with integer taps. Vector filtering
// Parameters:
// pSrc - pointer to the input vector
// pDst - pointer to the output vector
// pSrcDst - pointer to input/output vector in in-place operation
// numIters - number iterations (for single-rate equal length data vector)
// pState - pointer to the filter state
// scaleFactor - scale factor value
// Return:
// ippStsContextMatchErr - wrong State identifier
// ippStsNullPtrErr - pointer(s) to the data is NULL
// ippStsSizeErr - numIters <= 0
// ippStsNoErr - otherwise
// Note: for Multi-Rate filtering
// length pSrc = numIters*downFactor
// length pDst = numIters*upFactor
// for inplace functions max this values
*)
function ippsFIR32s(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pState:PIppsFIRState32s_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIR32sc(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pState:PIppsFIRState32sc_16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIR32s(pSrcDst:PIpp16s;numIters:longint;pState:PIppsFIRState32s_16s;scaleFactor:longint):IppStatus;overload;
function ippsFIR32sc(pSrcDst:PIpp16sc;numIters:longint;pState:PIppsFIRState32sc_16sc;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// FIR LMS filters
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSOne_Direct
// Purpose: direct form of a FIR LMS filter. One point operation.
// Parameters:
// src source signal sample
// refval desired signal sample
// pTapsInv FIR taps coefficient values to be fitted
// tapsLen number of the taps
// pDlyLine pointer to the delay line values
// pDlyIndex pointer to the current index of delay line
// mu adaptation step
// muQ15 adaptation step, integer version
// muQ15 = (int)(mu * (1<<15) + 0.5f)
// pDstVal where write output sample to
// Return:
// ippStsNullPtrErr pointer the the data is null
// ippStsSizeErr the taps length is equal or less zero
// ippStsNoErr otherwise
// Note: adaptation error value has been deleted from the parameter
// list because it can be computed as (refval - dst).
// taps array is enverted, delay line is of double size = tapsLen * 2
*)
function ippsFIRLMSOne_Direct(src:Ipp32f;refval:Ipp32f;pDstVal:PIpp32f;pTapsInv:PIpp32f;tapsLen:longint;mu:single;pDlyLine:PIpp32f;pDlyIndex:Plongint):IppStatus;overload;
function ippsFIRLMSOne_Direct32f(src:Ipp16s;refval:Ipp16s;pDstVal:PIpp16s;pTapsInv:PIpp32f;tapsLen:longint;mu:single;pDlyLine:PIpp16s;pDlyIndex:Plongint):IppStatus;overload;
function ippsFIRLMSOne_DirectQ15(src:Ipp16s;refval:Ipp16s;pDstVal:PIpp16s;pTapsInv:PIpp32s;tapsLen:longint;muQ15:longint;pDlyLine:PIpp16s;pDlyIndex:Plongint):IppStatus;overload;
(* context oriented functions *)
(* #if !defined( _OWN_BLDPCS )
struct FIRLMSState_32f;
typedef struct FIRLMSState_32f IppsFIRLMSState_32f;
struct FIRLMSState32f_16s;
typedef struct FIRLMSState32f_16s IppsFIRLMSState32f_16s;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMS
// Purpose: LMS filtering with context use
// Parameters:
// pState pointer to the state
// pSrc pointer to the source signal
// pRef pointer to the desired signal
// pDst pointer to the output signal
// len length of the signals
// mu adaptation step
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsSizeErr the length of signals is equal or less zero
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMS(pSrc:PIpp32f;pRef:PIpp32f;pDst:PIpp32f;len:longint;mu:single;pState:PIppsFIRLMSState_32f):IppStatus;overload;
function ippsFIRLMS32f(pSrc:PIpp16s;pRef:PIpp16s;pDst:PIpp16s;len:longint;mu:single;pStatel:PIppsFIRLMSState32f_16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSInitAlloc, ippsFIRLMSFree
// Purpose: LMS initialization functions
// Parameters:
// pTaps pointer to the taps values. May be null
// tapsLen number of the taps
// pDlyLine pointer to the delay line. May be null
// dlyLineIndex current index value for the delay line
// pState address of pointer to the state returned
// Return:
// ippStsNullPtrErr pointer is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSInitAlloc(var pState:PIppsFIRLMSState_32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;dlyLineIndex:longint):IppStatus;overload;
function ippsFIRLMSInitAlloc32f(var pState:PIppsFIRLMSState32f_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;dlyLineIndex:longint):IppStatus;overload;
function ippsFIRLMSFree(pState:PIppsFIRLMSState_32f):IppStatus;overload;
function ippsFIRLMSFree32f(pState:PIppsFIRLMSState32f_16s):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSGetTaps
// Purpose: get taps values
// Parameters:
// pstate pointer to the state
// pTaps pointer to the array to store the taps values
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsNoErr otherwise
*)
function ippsFIRLMSGetTaps(pState:PIppsFIRLMSState_32f;pOutTaps:PIpp32f):IppStatus;overload;
function ippsFIRLMSGetTaps32f(pState:PIppsFIRLMSState32f_16s;pOutTaps:PIpp32f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSGetDlyl, ippsFIRLMSSetDlyl
// Purpose: set or get delay line
// Parameters:
// pState pointer to the state structure
// pDlyLine pointer to the delay line of the single size = tapsLen
// pDlyLineIndex pointer to get the current delay line index
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSGetDlyLine(pState:PIppsFIRLMSState_32f;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIRLMSGetDlyLine32f(pState:PIppsFIRLMSState32f_16s;pDlyLine:PIpp16s;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIRLMSSetDlyLine(pState:PIppsFIRLMSState_32f;pDlyLine:PIpp32f;dlyLineIndex:longint):IppStatus;overload;
function ippsFIRLMSSetDlyLine32f(pState:PIppsFIRLMSState32f_16s;pDlyLine:PIpp16s;dlyLineIndex:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// FIR LMS MR filters
///////////////////////////////////////////////////////////////////////////// *)
(* context oriented functions *)
(* #if !defined( _OWN_BLDPCS )
struct FIRLMSMRState32s_16s;
typedef struct FIRLMSMRState32s_16s IppsFIRLMSMRState32s_16s;
struct FIRLMSMRState32sc_16sc;
typedef struct FIRLMSMRState32sc_16sc IppsFIRLMSMRState32sc_16sc;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSMROne, ippsFIRLMSMROneVal
// Purpose: LMS MR filtering with context use
// Parameters:
// val the source signal last value to update delay line
// pDstVal pointer to the output signal value
// pState pointer to the state
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSMROne32s(pDstVal:PIpp32s;pState:PIppsFIRLMSMRState32s_16s):IppStatus;overload;
function ippsFIRLMSMROneVal32s(val:Ipp16s;pDstVal:PIpp32s;pState:PIppsFIRLMSMRState32s_16s):IppStatus;overload;
function ippsFIRLMSMROne32sc(pDstVal:PIpp32sc;pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;overload;
function ippsFIRLMSMROneVal32sc(val:Ipp16sc;pDstVal:PIpp32sc;pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSMRInitAlloc, ippsFIRLMSMRFree
// Purpose: LMS MR initialization functions
// Parameters:
// pState address of pointer to the state returned
// pTaps pointer to the taps values. May be null
// tapsLen number of the taps
// pDlyLine pointer to the delay line. May be null
// dlyLineIndex current index value for the delay line
// dlyStep sample down factor
// updateDly update delay in sampls
// mu adaptation step
// Return:
// ippStsNullPtrErr pointer is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSMRInitAlloc32s(var pState:PIppsFIRLMSMRState32s_16s;pTaps:PIpp32s;tapsLen:longint;pDlyLine:PIpp16s;dlyLineIndex:longint;dlyStep:longint;updateDly:longint;mu:longint):IppStatus;overload;
function ippsFIRLMSMRFree32s(pState:PIppsFIRLMSMRState32s_16s):IppStatus;overload;
function ippsFIRLMSMRInitAlloc32sc(var pState:PIppsFIRLMSMRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;pDlyLine:PIpp16sc;dlyLineIndex:longint;dlyStep:longint;updateDly:longint;mu:longint):IppStatus;overload;
function ippsFIRLMSMRFree32sc(pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSMRGetTaps, ippsFIRLMSMRSetTaps,
// ippsFIRLMSMRGetTapsPointer
// Purpose: get & set taps values
// Parameters:
// pState pointer to the state
// pOutTaps pointer to the array to store the taps values
// pInTaps pointer to the taps values. May be null
// pTaps pointer to the state taps values. For direct access
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSMRSetTaps32s(pState:PIppsFIRLMSMRState32s_16s;pInTaps:PIpp32s):IppStatus;overload;
function ippsFIRLMSMRGetTaps32s(pState:PIppsFIRLMSMRState32s_16s;pOutTaps:PIpp32s):IppStatus;overload;
function ippsFIRLMSMRGetTapsPointer32s(pState:PIppsFIRLMSMRState32s_16s;var pTaps:PIpp32s):IppStatus;overload;
function ippsFIRLMSMRSetTaps32sc(pState:PIppsFIRLMSMRState32sc_16sc;pInTaps:PIpp32sc):IppStatus;overload;
function ippsFIRLMSMRGetTaps32sc(pState:PIppsFIRLMSMRState32sc_16sc;pOutTaps:PIpp32sc):IppStatus;overload;
function ippsFIRLMSMRGetTapsPointer32sc(pState:PIppsFIRLMSMRState32sc_16sc;var pTaps:PIpp32sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSMRGetDlyLine, ippsFIRLMSMRSetDlyLine,
// ippsFIRLMSMRGetDlyVal
// Purpose: set or get delay line, or get one delay line value from
// specified position
// Parameters:
// pState pointer to the state structure
// pInDlyLine pointer to the delay line of the (see state definition)
// size = tapsLen * dlyStep + updateDly (may be null)
// pOutDlyLine pointer to the delay line of the (see state definition)
// size = tapsLen * dlyStep + updateDly
// pOutDlyLineIndex pointer to get the current delay line index
// dlyLineIndex current index value for the delay line
// index to get one value posted into delay line "index" iterations ago
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSMRSetDlyLine32s(pState:PIppsFIRLMSMRState32s_16s;pInDlyLine:PIpp16s;dlyLineIndex:longint):IppStatus;overload;
function ippsFIRLMSMRGetDlyLine32s(pState:PIppsFIRLMSMRState32s_16s;pOutDlyLine:PIpp16s;pOutDlyIndex:Plongint):IppStatus;overload;
function ippsFIRLMSMRGetDlyVal32s(pState:PIppsFIRLMSMRState32s_16s;pOutVal:PIpp16s;index:longint):IppStatus;overload;
function ippsFIRLMSMRSetDlyLine32sc(pState:PIppsFIRLMSMRState32sc_16sc;pInDlyLine:PIpp16sc;dlyLineIndex:longint):IppStatus;overload;
function ippsFIRLMSMRGetDlyLine32sc(pState:PIppsFIRLMSMRState32sc_16sc;pOutDlyLine:PIpp16sc;pOutDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIRLMSMRGetDlyVal32sc(pState:PIppsFIRLMSMRState32sc_16sc;pOutVal:PIpp16sc;index:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSMRPutVal
// Purpose: put one value to the delay line
// Parameters:
// val the source signal last value to update delay line
// pState pointer to the state structure
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSMRPutVal32s(val:Ipp16s;pState:PIppsFIRLMSMRState32s_16s):IppStatus;overload;
function ippsFIRLMSMRPutVal32sc(val:Ipp16sc;pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSMRSetMu
// Purpose: set new adaptation step
// Parameters:
// pState pointer to the state structure
// mu new adaptation step
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSMRSetMu32s(pState:PIppsFIRLMSMRState32s_16s;mu:longint):IppStatus;overload;
function ippsFIRLMSMRSetMu32sc(pState:PIppsFIRLMSMRState32sc_16sc;mu:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRLMSMRUpdateTaps
// Purpose: recalculation of taps using Least Mean Square alg
// Parameters:
// ErrVal difference between output and reference signal
// pState pointer to the state structure
// Return:
// ippStsNullPtrErr pointer to the data is null
// ippStsContextMatchErr wrong state identifier
// ippStsNoErr otherwise
*)
function ippsFIRLMSMRUpdateTaps32s(ErrVal:Ipp32s;pState:PIppsFIRLMSMRState32s_16s):IppStatus;overload;
function ippsFIRLMSMRUpdateTaps32sc(ErrVal:Ipp32sc;pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// FIR filters (direct version)
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIROne_Direct
// Purpose: Directly filters a single sample through a FIR filter.
// Parameters:
// src input sample
// pDstVal pointer to the output sample
// pSrcDstVal pointer to the input and output sample for in-place operation.
// pTaps pointer to the array containing the taps values,
// the number of elements in the array is tapsLen
// tapsLen number of elements in the array containing the taps values.
// tapsFactor scale factor for the taps of Ipp32s data type
// (for integer versions only).
// pDlyLine pointer to the array containing the delay line values,
// the number of elements in the array is 2*tapsLen
// pDlyLineIndex pointer to the current delay line index
// scaleFactor integer scaling factor value
// Return:
// ippStsNullPtrErr pointer(s) to data arrays is(are) NULL
// ippStsFIRLenErr tapsLen is less than or equal to 0
// ippStsNoErr otherwise
*)
function ippsFIROne_Direct(src:Ipp32f;pDstVal:PIpp32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne_Direct(src:Ipp32fc;pDstVal:PIpp32fc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne_Direct(pSrcDstVal:PIpp32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne_Direct(pSrcDstVal:PIpp32fc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne32f_Direct(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32fc_Direct(src:Ipp16sc;pDstVal:PIpp16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32f_Direct(pSrcDstVal:PIpp16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32fc_Direct(pSrcDstVal:PIpp16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne_Direct(src:Ipp64f;pDstVal:PIpp64f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne_Direct(src:Ipp64fc;pDstVal:PIpp64fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne_Direct(pSrcDstVal:PIpp64f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne_Direct(pSrcDstVal:PIpp64fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne64f_Direct(src:Ipp32f;pDstVal:PIpp32f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne64fc_Direct(src:Ipp32fc;pDstVal:PIpp32fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne64f_Direct(pSrcDstVal:PIpp32f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne64fc_Direct(pSrcDstVal:PIpp32fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIROne64f_Direct(src:Ipp32s;pDstVal:PIpp32s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64fc_Direct(src:Ipp32sc;pDstVal:PIpp32sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64f_Direct(pSrcDstVal:PIpp32s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64fc_Direct(pSrcDstVal:PIpp32sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64f_Direct(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64fc_Direct(src:Ipp16sc;pDstVal:PIpp16sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64f_Direct(pSrcDstVal:PIpp16s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne64fc_Direct(pSrcDstVal:PIpp16sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32s_Direct(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32sc_Direct(src:Ipp16sc;pDstVal:PIpp16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32s_Direct(pSrcDstVal:PIpp16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne32sc_Direct(pSrcDstVal:PIpp16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
(* ///////////////////////////////////////////////////////////////////////////////////////////
// Names: ippsFIR_Direct
// Purpose: Directly filters a block of samples through a single-rate FIR filter.
// Parameters:
// pSrc pointer to the input array
// pDst pointer to the output array
// pSrcDst pointer to the input and output array for in-place operation.
// numIters number of samples in the input array
// pTaps pointer to the array containing the taps values,
// the number of elements in the array is tapsLen
// tapsLen number of elements in the array containing the taps values.
// tapsFactor scale factor for the taps of Ipp32s data type
// (for integer versions only).
// pDlyLine pointer to the array containing the delay line values,
// the number of elements in the array is 2*tapsLen
// pDlyLineIndex pointer to the current delay line index
// scaleFactor integer scaling factor value
// Return:
// ippStsNullPtrErr pointer(s) to data arrays is(are) NULL
// ippStsFIRLenErr tapsLen is less than or equal to 0
// ippStsSizeErr numIters is less than or equal to 0
// ippStsNoErr otherwise
*)
function ippsFIR_Direct(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR_Direct(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR_Direct(pSrcDst:PIpp32f;numIters:longint;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR_Direct(pSrcDst:PIpp32fc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR32f_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR32fc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR32f_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR32fc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR_Direct(pSrc:PIpp64f;pDst:PIpp64f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR_Direct(pSrc:PIpp64fc;pDst:PIpp64fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR_Direct(pSrcDst:PIpp64f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR_Direct(pSrcDst:PIpp64fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR64f_Direct(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR64fc_Direct(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR64f_Direct(pSrcDst:PIpp32f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR64fc_Direct(pSrcDst:PIpp32fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;overload;
function ippsFIR64f_Direct(pSrc:PIpp32s;pDst:PIpp32s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR64fc_Direct(pSrc:PIpp32sc;pDst:PIpp32sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR64f_Direct(pSrcDst:PIpp32s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR64fc_Direct(pSrcDst:PIpp32sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR64f_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR64fc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR64f_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR64fc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR32s_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR32sc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR32s_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR32sc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
(* ///////////////////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRMR_Direct
// Purpose: Directly filters a block of samples through a multi-rate FIR filter.
// Parameters:
// pSrc pointer to the input array
// pDst pointer to the output array
// pSrcDst pointer to the input and output array for in-place operation.
// numIters number of iterations in the input array
// pTaps pointer to the array containing the taps values,
// the number of elements in the array is tapsLen
// tapsLen number of elements in the array containing the taps values.
// tapsFactor scale factor for the taps of Ipp32s data type
// (for integer versions only).
// pDlyLine pointer to the array containing the delay line values
// upFactor up-sampling factor
// downFactor down-sampling factor
// upPhase up-sampling phase
// downPhase down-sampling phase
// scaleFactor integer scaling factor value
// Return:
// ippStsNullPtrErr pointer(s) to data arrays is(are) NULL
// ippStsFIRLenErr tapsLen is less than or equal to 0
// ippStsSizeErr numIters is less than or equal to 0
// ippStsFIRMRFactorErr upFactor (downFactor) is less than or equal to 0
// ippStsFIRMRPhaseErr upPhase (downPhase) is negative,
// or less than or equal to upFactor (downFactor).
// ippStsNoErr otherwise
*)
function ippsFIRMR_Direct(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRMR_Direct(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRMR_Direct(pSrcDst:PIpp32f;numIters:longint;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRMR_Direct(pSrcDst:PIpp32fc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRMR32f_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR32fc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR32f_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR32fc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR_Direct(pSrc:PIpp64f;pDst:PIpp64f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsFIRMR_Direct(pSrc:PIpp64fc;pDst:PIpp64fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsFIRMR_Direct(pSrcDst:PIpp64f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64f):IppStatus;overload;
function ippsFIRMR_Direct(pSrcDst:PIpp64fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64fc):IppStatus;overload;
function ippsFIRMR64f_Direct(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRMR64fc_Direct(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRMR64f_Direct(pSrcDst:PIpp32f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;overload;
function ippsFIRMR64fc_Direct(pSrcDst:PIpp32fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;overload;
function ippsFIRMR64f_Direct(pSrc:PIpp32s;pDst:PIpp32s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR64fc_Direct(pSrc:PIpp32sc;pDst:PIpp32sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32sc;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR64f_Direct(pSrcDst:PIpp32s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR64fc_Direct(pSrcDst:PIpp32sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32sc;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR64f_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR64fc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR64f_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR64fc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR32s_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR32sc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR32s_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;overload;
function ippsFIRMR32sc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;overload;
(* ////////////////////////////////////////////////////////////////////////////
// Names: ippsFIR_Direct_16s_Sfs,
// ippsFIR_Direct_16s_ISfs,
// ippsFIROne_Direct_16s_Sfs,
// ippsFIROne_Direct_16s_ISfs.
// Purpose: Directly filters a block of samples (or one sample in 'One'
// case) through a single-rate FIR filter with fixed point taps
// ( Q15 ).
// Parameters:
// pSrc pointer to the input array.
// src input sample in 'One' case.
// pDst pointer to the output array.
// pDstVal pointer to the output sample in 'One' case.
// pSrcDst pointer to the input and output array for in-place
// operation.
// pSrcDstVal pointer to the input and output sample for in-place
// operation in 'One' case.
// numIters number of samples in the input array.
// pTapsQ15 pointer to the array containing the taps values,
// the number of elements in the array is tapsLen.
// tapsLen number of elements in the array containing the taps
// values.
// pDlyLine pointer to the array containing the delay line values,
// the number of elements in the array is 2 * tapsLen.
// pDlyLineIndex pointer to the current delay line index.
// scaleFactor integer scaling factor value.
// Return:
// ippStsNullPtrErr pointer(s) to data arrays is(are) NULL.
// ippStsFIRLenErr tapsLen is less than or equal to 0.
// ippStsSizeErr sampLen is less than or equal to 0.
// ippStsDlyLineIndexErr current delay line index is greater or equal
// tapsLen, or less than 0.
// ippStsNoErr otherwise.
*)
function ippsFIR_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTapsQ15:PIpp16s;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIR_Direct(pSrcDst:PIpp16s;numIters:longint;pTapsQ15:PIpp16s;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne_Direct(src:Ipp16s;pDstVal:PIpp16s;pTapsQ15:PIpp16s;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
function ippsFIROne_Direct(pSrcDstVal:PIpp16s;pTapsQ15:PIpp16s;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFIRGenLowpass_64f, ippsFIRGenHighpass_64f, ippsFIRGenBandpass_64f
// ippsFIRGenBandstop_64f
// Purpose: This function computes the lowpass FIR filter coefficients
// by windowing of ideal (infinite) filter coefficients segment
//
// Parameters:
// rfreq cut off frequency (0 < rfreq < 0.5)
//
// taps pointer to the array which specifies
// the filter coefficients;
//
// tapsLen the number of taps in taps[] array (tapsLen>=5);
//
// winType the ippWindowType switch variable,
// which specifies the smoothing window type;
//
// doNormal if doNormal=0 the functions calculates
// non-normalized sequence of filter coefficients,
// in other cases the sequence of coefficients
// will be normalized.
// Return:
// ippStsNullPtrErr the null pointer to taps[] array pass to function
// ippStsSizeErr the length of coefficient's array is less then five
// ippStsSizeErr the low or high frequency isn’t satisfy
// the condition 0 < rLowFreq < 0.5
// ippStsNoErr otherwise
//
*)
function ippsFIRGenLowpass(rfreq:Ipp64f;taps:PIpp64f;tapsLen:longint;winType:IppWinType;doNormal:IppBool):IppStatus;overload;
function ippsFIRGenHighpass(rfreq:Ipp64f;taps:PIpp64f;tapsLen:longint;winType:IppWinType;doNormal:IppBool):IppStatus;overload;
function ippsFIRGenBandpass(rLowFreq:Ipp64f;rHighFreq:Ipp64f;taps:PIpp64f;tapsLen:longint;winType:IppWinType;doNormal:IppBool):IppStatus;overload;
function ippsFIRGenBandstop(rLowFreq:Ipp64f;rHighFreq:Ipp64f;taps:PIpp64f;tapsLen:longint;winType:IppWinType;doNormal:IppBool):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Windowing functions
// Note: to create the window coefficients you have to make two calls
// Set(1,x,n) and Win(x,n)
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsWinBartlett
// Parameters:
// pSrcDst pointer to the vector
// len length of the vector, window size
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vector is less 3
// ippStsNoErr otherwise
*)
function ippsWinBartlett(pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrcDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinBartlett(pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsWinHann
// Parameters:
// pSrcDst pointer to the vector
// len length of the vector, window size
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vector is less 3
// ippStsNoErr otherwise
// Functionality: 0.5*(1-cos(2*pi*n/(N-1)))
*)
function ippsWinHann(pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinHann(pSrcDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinHann(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinHann(pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinHann(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinHann(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinHann(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinHann(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinHann(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinHann(pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsWinHann(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinHann(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsWinHamming
// Parameters:
// pSrcDst pointer to the vector
// len length of the vector, window size
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vector is less 3
// ippStsNoErr otherwise
*)
function ippsWinHamming(pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinHamming(pSrcDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinHamming(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinHamming(pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinHamming(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinHamming(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinHamming(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinHamming(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinHamming(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinHamming(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsWinHamming(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinHamming(pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsWinBlackman
// Purpose: multiply vector by Blackman windowing function
// Parameters:
// pSrcDst pointer to the vector
// len length of the vector, window size
// alpha adjustable parameter associated with the
// Blackman windowing equation
// alphaQ15 scaled (scale factor 15) version of the alpha
// scaleFactor scale factor of the output signal
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vector is less 3, for Opt it's 4
// ippStsNoErr otherwise
// Notes:
// parameter alpha value
// WinBlackmaStd : -0.16
// WinBlackmaOpt : -0.5 / (1+cos(2*pi/(len-1)))
*)
function ippsWinBlackmanQ15(pSrcDst:PIpp16s;len:longint;alphaQ15:longint;scaleFactor:longint):IppStatus;overload;
function ippsWinBlackmanQ15(pSrcDst:PIpp16s;len:longint;alphaQ15:longint):IppStatus;overload;
function ippsWinBlackmanQ15(pSrcDst:PIpp16sc;len:longint;alphaQ15:longint):IppStatus;overload;
function ippsWinBlackman(pSrcDst:PIpp16s;len:longint;alpha:single):IppStatus;overload;
function ippsWinBlackman(pSrcDst:PIpp16sc;len:longint;alpha:single):IppStatus;overload;
function ippsWinBlackman(pSrcDst:PIpp32f;len:longint;alpha:single):IppStatus;overload;
function ippsWinBlackman(pSrcDst:PIpp32fc;len:longint;alpha:single):IppStatus;overload;
function ippsWinBlackmanQ15(pSrc:PIpp16s;pDst:PIpp16s;len:longint;alphaQ15:longint):IppStatus;overload;
function ippsWinBlackmanQ15(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;alphaQ15:longint):IppStatus;overload;
function ippsWinBlackman(pSrc:PIpp16s;pDst:PIpp16s;len:longint;alpha:single):IppStatus;overload;
function ippsWinBlackman(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;alpha:single):IppStatus;overload;
function ippsWinBlackman(pSrc:PIpp32f;pDst:PIpp32f;len:longint;alpha:single):IppStatus;overload;
function ippsWinBlackman(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;alpha:single):IppStatus;overload;
function ippsWinBlackmanStd(pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrcDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrcDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrcDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrcDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrcDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;overload;
function ippsWinBlackman(pSrcDst:PIpp64f;len:longint;alpha:double):IppStatus;overload;
function ippsWinBlackman(pSrcDst:PIpp64fc;len:longint;alpha:double):IppStatus;overload;
function ippsWinBlackman(pSrc:PIpp64f;pDst:PIpp64f;len:longint;alpha:double):IppStatus;overload;
function ippsWinBlackman(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;alpha:double):IppStatus;overload;
function ippsWinBlackmanStd(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinBlackmanStd(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrcDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrcDst:PIpp64fc;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;overload;
function ippsWinBlackmanOpt(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsWinKaiser
// Purpose: multiply vector by Kaiser windowing function
// Parameters:
// pSrcDst pointer to the vector
// len length of the vector, window size
// alpha adjustable parameter associated with the
// Kaiser windowing equation
// alphaQ15 scaled (scale factor 15) version of the alpha
// Return:
// ippStsNullPtrErr pointer to the vector is NULL
// ippStsSizeErr length of the vector is less 1
// ippStsHugeWinErr window in function is huge
// ippStsNoErr otherwise
*)
function ippsWinKaiser(pSrc:PIpp16s;pDst:PIpp16s;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrcDst:PIpp16s;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiserQ15(pSrc:PIpp16s;pDst:PIpp16s;len:longint;alphaQ15:longint):IppStatus;overload;
function ippsWinKaiserQ15(pSrcDst:PIpp16s;len:longint;alphaQ15:longint):IppStatus;overload;
function ippsWinKaiser(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrcDst:PIpp16sc;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiserQ15(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;alphaQ15:longint):IppStatus;overload;
function ippsWinKaiserQ15(pSrcDst:PIpp16sc;len:longint;alphaQ15:longint):IppStatus;overload;
function ippsWinKaiser(pSrc:PIpp32f;pDst:PIpp32f;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrcDst:PIpp32f;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrcDst:PIpp32fc;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrc:PIpp64f;pDst:PIpp64f;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrcDst:PIpp64f;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrcDst:PIpp64fc;len:longint;alpha:single):IppStatus;overload;
function ippsWinKaiser(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;alpha:single):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Median filter
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsFilterMedian
// Purpose: filter source data by the Median Filter
// Parameters:
// pSrcDst pointer to the source vector
// pSrc pointer to the source vector
// pDst pointer to the destination vector
// len length of the vector(s)
// maskSize median mask size (odd)
// Return:
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsSizeErr length of the vector(s) is less or equal zero
// ippStsEvenMedianMaskSize median mask size is even warning
// ippStsNoErr otherwise
// Notes:
// - if len is even then len=len-1
// - value of not existed point equals to the last point value,
// for example, x[-1]=x[0] or x[len]=x[len-1]
*)
function ippsFilterMedian(pSrcDst:PIpp32f;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrcDst:PIpp64f;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrcDst:PIpp16s;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrcDst:PIpp8u;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrc:PIpp32f;pDst:PIpp32f;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrc:PIpp64f;pDst:PIpp64f;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrc:PIpp16s;pDst:PIpp16s;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrc:PIpp8u;pDst:PIpp8u;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrcDst:PIpp32s;len:longint;maskSize:longint):IppStatus;overload;
function ippsFilterMedian(pSrc:PIpp32s;pDst:PIpp32s;len:longint;maskSize:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Statistic functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsNorm
// Purpose: calculate norm of vector
// Inf - calculate C-norm of vector: n = MAX |src1|
// L1 - calculate L1-norm of vector: n = SUM |src1|
// L2 - calculate L2-norm of vector: n = SQRT(SUM |src1|^2)
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of vector is less or equal zero
// Parameters:
// pSrc The sourses data pointer.
// len The length of vector
// pNorm The pointer to result
// Notes:
*)
function ippsNorm_Inf(pSrc:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNorm_Inf(pSrc:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsNorm_Inf(pSrc:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNorm_Inf(pSrc:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNorm_L1(pSrc:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNorm_L1(pSrc:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsNorm_L1(pSrc:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNorm_L1(pSrc:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNorm_L2(pSrc:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNorm_L2(pSrc:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsNorm_L2(pSrc:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNorm_L2(pSrc:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsNormDiff
// Purpose: calculate norm of vectors
// Inf - calculate C-norm of vectors: n = MAX |src1-src2|
// L1 - calculate L1-norm of vectors: n = SUM |src1-src2|
// L2 - calculate L2-norm of vectors: n = SQRT(SUM |src1-src2|^2)
// Context:
// Returns: IppStatus
// ippStsNoErr Ok
// ippStsNullPtrErr Some of pointers to input or output data are NULL
// ippStsSizeErr The length of vector is less or equal zero
// Parameters:
// pSrc1, pSrc2 The sourses data pointer.
// len The length of vector
// pNorm The pointer to result
// Notes:
*)
function ippsNormDiff_Inf(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNormDiff_Inf(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsNormDiff_Inf(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNormDiff_Inf(pSrc1:PIpp64f;pSrc2:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNormDiff_L1(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNormDiff_L1(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsNormDiff_L1(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNormDiff_L1(pSrc1:PIpp64f;pSrc2:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNormDiff_L2(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNormDiff_L2(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;overload;
function ippsNormDiff_L2(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNormDiff_L2(pSrc1:PIpp64f;pSrc2:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNorm_Inf(pSrc:PIpp32fc;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNorm_L1(pSrc:PIpp32fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNorm_L2(pSrc:PIpp32fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNormDiff_Inf(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pNorm:PIpp32f):IppStatus;overload;
function ippsNormDiff_L1(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNormDiff_L2(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNorm_Inf(pSrc:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNorm_L1(pSrc:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNorm_L2(pSrc:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNormDiff_Inf(pSrc1:PIpp64fc;pSrc2:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNormDiff_L1(pSrc1:PIpp64fc;pSrc2:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
function ippsNormDiff_L2(pSrc1:PIpp64fc;pSrc2:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Cross Correlation Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsCrossCorr_32f, ippsCrossCorr_64f,
// ippsCrossCorr_32fc, ippsCrossCorr_64fc
//
// Purpose: Calculate Cross Correlation
//
// Arguments:
// pSrc1 - pointer to the vector_1 source
// len1 - vector_1 source length
// pSrc2 - pointer to the vector_2 source
// len - vector_2 source length
// pDst - pointer to the cross correlation
// dstLen - length of cross-correlation
// lowLag - cross-correlation lowest lag
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr either pSrc1 or(and) pSrc2 are NULL
// ippStsSizeErr vector's length is not positive
// roi problem
*)
function ippsCrossCorr(pSrc1:PIpp32f;len1:longint;pSrc2:PIpp32f;len2:longint;pDst:PIpp32f;dstLen:longint;lowLag:longint):IppStatus;overload;
function ippsCrossCorr(pSrc1:PIpp64f;len1:longint;pSrc2:PIpp64f;len2:longint;pDst:PIpp64f;dstLen:longint;lowLag:longint):IppStatus;overload;
function ippsCrossCorr(pSrc1:PIpp32fc;len1:longint;pSrc2:PIpp32fc;len2:longint;pDst:PIpp32fc;dstLen:longint;lowLag:longint):IppStatus;overload;
function ippsCrossCorr(pSrc1:PIpp64fc;len1:longint;pSrc2:PIpp64fc;len2:longint;pDst:PIpp64fc;dstLen:longint;lowLag:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsCrossCorr_16s_Sfs
//
// Purpose: Calculate Cross Correlation and Scale Result (with saturate)
//
// Arguments:
// pSrc1 - pointer to the vector_1 source
// len1 - vector_1 source length
// pSrc2 - pointer to the vector_2 source
// len - vector_2 source length
// pDst - pointer to the cross correlation
// dstLen -
// lowLag -
// scaleFactor - scale factor value
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr either pSrc1 or(and) pSrc2 are NULL
// ippStsSizeErr vector's length is not positive
// roi problem
*)
function ippsCrossCorr(pSrc1:PIpp16s;len1:longint;pSrc2:PIpp16s;len2:longint;pDst:PIpp16s;dstLen:longint;lowLag:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// AutoCorrelation Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsAutoCorr_32f, ippsAutoCorr_NormA_32f, ippsAutoCorr_NormB_32f,
// ippsAutoCorr_64f, ippsAutoCorr_NormA_64f, ippsAutoCorr_NormB_64f,
// ippsAutoCorr_32fc, ippsAutoCorr_NormA_32fc, ippsAutoCorr_NormB_32fc,
// ippsAutoCorr_64fc, ippsAutoCorr_NormA_64fc, ippsAutoCorr_NormB_64fc,
//
// Purpose: Calculate the autocorrelation,
// without suffix NormX specifies that the normal autocorrelation to be
// computed;
// suffix NormA specifies that the biased autocorrelation to be
// computed (the resulting values are to be divided on srcLen);
// suffix NormB specifies that the unbiased autocorrelation to be
// computed (the resulting values are to be divided on ( srcLen - n ),
// where "n" means current iteration).
//
// Arguments:
// pSrc - pointer to the source vector
// srcLen - source vector length
// pDst - pointer to the auto-correlation result vector
// dstLen - length of auto-correlation
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr either pSrc or(and) pDst are NULL
// ippStsSizeErr vector's length is not positive
*)
function ippsAutoCorr(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:longint):IppStatus;overload;
function ippsAutoCorr_NormA(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:longint):IppStatus;overload;
function ippsAutoCorr_NormB(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:longint):IppStatus;overload;
function ippsAutoCorr(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:longint):IppStatus;overload;
function ippsAutoCorr_NormA(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:longint):IppStatus;overload;
function ippsAutoCorr_NormB(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:longint):IppStatus;overload;
function ippsAutoCorr(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:longint):IppStatus;overload;
function ippsAutoCorr_NormA(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:longint):IppStatus;overload;
function ippsAutoCorr_NormB(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:longint):IppStatus;overload;
function ippsAutoCorr(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:longint):IppStatus;overload;
function ippsAutoCorr_NormA(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:longint):IppStatus;overload;
function ippsAutoCorr_NormB(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Names: ippsAutoCorr_16s_Sfs,
// ippsAutoCorr_NormA_16s_Sfs,
// ippsAutoCorr_NormB_16s_Sfs
//
// Purpose: Calculate the autocorrelation,
// without suffix NormX specifies that the normal autocorrelation to be
// computed;
// suffix NormA specifies that the biased autocorrelation to be
// computed (the resulting values are to be divided on srcLen);
// suffix NormB specifies that the unbiased autocorrelation to be
// computed (the resulting values are to be divided on ( srcLen - n ),
// where n means current iteration).
//
// Arguments:
// pSrc - pointer to the source vector
// srcLen - source vector length
// pDst - pointer to the auto-correlation result vector
// dstLen - length of auto-correlation
// scaleFactor - scale factor value
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr either pSrc or(and) pDst are NULL
// ippStsSizeErr vector's length is not positive
*)
function ippsAutoCorr(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:longint;scaleFactor:longint):IppStatus;overload;
function ippsAutoCorr_NormA(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:longint;scaleFactor:longint):IppStatus;overload;
function ippsAutoCorr_NormB(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:longint;scaleFactor:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Sampling functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsSampleUp
// Purpose: upsampling, i.e. expansion of input vector to get output vector
// by simple adding zeroes between input elements
// Parameters:
// pSrc (in) pointer to the input vector
// pDst (in) pointer to the output vector
// srcLen (in) length of input vector
// dstLen (out) pointer to the length of output vector
// factor (in) the number of output elements, corresponding to one element
// of input vector.
// phase(in-out) pointer to value, that is the position (0, ..., factor-1) of
// element from input vector in the group of factor elements of
// output vector. Out value is ready to continue upsampling with
// the same factor (out = in).
//
// Return:
// ippStsNullPtrErr one or several pointers pSrc, pDst, dstLen or phase
// is NULL
// ippStsSizeErr length of input vector is less or equal zero
// ippStsSampleFactorErr factor <= 0
// ippStsSamplePhaseErr *phase < 0 or *phase >= factor
// ippStsNoErr otherwise
*)
function ippsSampleUp(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleUp(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleUp(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleUp(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleUp(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleUp(pSrc:PIpp16sc;srcLen:longint;pDst:PIpp16sc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsSampleDown
// Purpose: subsampling, i.e. only one of "factor" elements of input vector
// are placed to output vector
// Parameters:
// pSrc (in) pointer to the input vector
// pDst (in) pointer to the output vector
// srcLen (in) length of input vector
// dstLen (out) pointer to the length of output vector
// factor (in) the number of input elements, corresponding to one element
// of output vector.
// phase(in-out) pointer to value, that is the position (0, ..., factor-1) of
// choosen element in the group of "factor" elements. Out value
// of *phase is ready to continue subsampling with the same
// factor.
//
// Return:
// ippStsNullPtrErr one or several pointers pSrc, pDst, dstLen or phase
// is NULL
// ippStsSizeErr length of input vector is less or equal zero
// ippStsSampleFactorErr factor <= 0
// ippStsSamplePhaseErr *phase < 0 or *phase >=factor
// ippStsNoErr otherwise
*)
function ippsSampleDown(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleDown(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleDown(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleDown(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleDown(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
function ippsSampleDown(pSrc:PIpp16sc;srcLen:longint;pDst:PIpp16sc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;overload;
(* ///////////////////////////////////////////////////////////////////////////
// Names: ippsGetVarPointDV_16sc
// Purpose: Fills the array VariantPoint with information about 8
// (if State = 32,64) or 4 (if State = 16) closest to the
// refPoint complex points (stores the indexes in the
// offset table and errors between refPoint and the
// current point)
// Return:
// ippStsNoErr Ok
// ippStsNullPtrErr Any of the specified pointers is NULL
// Parameters:
// pSrc pointer to the reference point in format 9:7
// pDst pointer to the closest to the reference point left
// and bottom comlexpoint in format 9:7
// pVariantPoint pointer to the array where the information is stored
// pLabel pointer to the labels table
// state number of states of the convolution coder
*)
function ippsGetVarPointDV(pSrc:PIpp16sc;pDst:PIpp16sc;pVariantPoint:PIpp16sc;pLabel:PIpp8u;state:longint):IppStatus;overload;
(* ///////////////////////////////////////////////////////////////////////////
// Names: ippsCalcStatesDV_16sc
// Purpose: Computes possible states of the Viterbi decoder
// Return:
// ippStsNoErr OK
// ippStsNullPtrErr Any of the specified pointers is NULL
// Parameters:
// pPathError pointer to the table of path error metrics
// pNextState pointer to the next state table
// pBranchError pointer to the branch error table
// pCurrentSubsetPoint pointer to the current 4D subset
// pPathTable pointer to the Viterbi path table
// state number of states of the convolution coder
// presentIndex start index in Viterbi Path table
*)
function ippsCalcStatesDV(pathError:PIpp16u;pNextState:PIpp8u;pBranchError:PIpp16u;pCurrentSubsetPoint:PIpp16s;pPathTable:PIpp16s;state:longint;presentIndex:longint):IppStatus;overload;
(* ///////////////////////////////////////////////////////////////////////////
// Names: ippsBuildSymblTableDV4D_16s
// Purpose: Fills the array with an information of possible 4D symbols
// Return:
// ippStsNoErr OK
// ippStsNullPtrErr Any of the specified pointers is NULL
// Parameters:
// pVariantPoint pointer to the array of possible 2D symbols
// pCurrentSubsetPoint pointer to the current array of 4D symbols
// state number of states of the convolution coder
// bitInversion bit Inversion
*)
function ippsBuildSymblTableDV4D(pVariantPoint:PIpp16sc;pCurrentSubsetPoint:PIpp16sc;state:longint;bitInversion:longint):IppStatus;overload;
(* ///////////////////////////////////////////////////////////////////////////
// Names: ippsUpdatePathMetricsDV_16u
// Purpose: Searches for the minimum path metric and updates states of the decoder
// Return:
// ippStsNoErr OK
// ippStsNullPtrErr Any of the specified pointers is NULL
// Parameters:
// pBranchError pointer to the branch error table
// pMinPathError pointer to the current minimum path error metric
// pMinSost pointer to the state with minimum path metric
// pPathError pointer to table of path error metrics
// state number of states of the convolution coder
*)
function ippsUpdatePathMetricsDV(pBranchError:PIpp16u;pMinPathError:PIpp16u;pMinSost:PIpp8u;pPathError:PIpp16u;state:longint):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Definitions for Hilbert Functions
///////////////////////////////////////////////////////////////////////////// *)
(* #if !defined( _OWN_BLDPCS )
struct HilbertSpec_32f32fc;
typedef struct HilbertSpec_32f32fc IppsHilbertSpec_32f32fc;
struct HilbertSpec_16s32fc;
typedef struct HilbertSpec_16s32fc IppsHilbertSpec_16s32fc;
struct HilbertSpec_16s16sc;
typedef struct HilbertSpec_16s16sc IppsHilbertSpec_16s16sc;
#endif /* _OWN_BLDPCS */ *)
(* /////////////////////////////////////////////////////////////////////////////
// Hilbert Context Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsHilbertInitAlloc_32f32fc, ippsHilbertFree_32f32fc,
// ippsHilbertInitAlloc_16s32fc, ippsHilbertFree_16s32fc,
// ippsHilbertInitAlloc_16s16sc, ippsHilbertFree_16s16sc
// Purpose: create, initialize and delete Hilbert context
// Arguments:
// pSpec - where write pointer to new context
// length - number of samples in Hilbert
// hint - code specific use hints (DFT)
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pSpec == NULL
// ippStsSizeErr bad the length value
// ippStsContextMatchErr bad context identifier
// ippStsMemAllocErr memory allocation error
*)
function ippsHilbertInitAlloc(var pSpec:PIppsHilbertSpec_32f32fc;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsHilbertInitAlloc(var pSpec:PIppsHilbertSpec_16s32fc;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsHilbertInitAlloc(var pSpec:PIppsHilbertSpec_16s16sc;length:longint;hint:IppHintAlgorithm):IppStatus;overload;
function ippsHilbertFree(pSpec:PIppsHilbertSpec_32f32fc):IppStatus;overload;
function ippsHilbertFree(pSpec:PIppsHilbertSpec_16s32fc):IppStatus;overload;
function ippsHilbertFree(pSpec:PIppsHilbertSpec_16s16sc):IppStatus;overload;
(* /////////////////////////////////////////////////////////////////////////////
// Hilbert Transform Functions
///////////////////////////////////////////////////////////////////////////// *)
(* /////////////////////////////////////////////////////////////////////////////
// Name: ippsHilbert_32f32fc,
// ippsHilbert_16s32fc,
// ippsHilbert_16s16sc_Sfs
// Purpose: compute Hilbert transform of the real signal
// Arguments:
// pSrc - pointer to source real signal
// pDst - pointer to destination complex signal
// pSpec - pointer to Hilbert context
// scaleFactor - scale factor for output signal
// Return:
// ippStsNoErr no errors
// ippStsNullPtrErr pointer(s) to the data is NULL
// ippStsContextMatchErr bad context identifier
// ippStsMemAllocErr memory allocation error
*)
function ippsHilbert(pSrc:PIpp32f;pDst:PIpp32fc;pSpec:PIppsHilbertSpec_32f32fc):IppStatus;overload;
function ippsHilbert(pSrc:PIpp16s;pDst:PIpp32fc;pSpec:PIppsHilbertSpec_16s32fc):IppStatus;overload;
function ippsHilbert(pSrc:PIpp16s;pDst:PIpp16sc;pSpec:PIppsHilbertSpec_16s16sc;scaleFactor:longint):IppStatus;overload;
(* #ifdef __cplusplus
}
#endif *)
(* ////////////////////////// End of file "ipps.h" ////////////////////////// *)
IMPLEMENTATION
function ippsMalloc(len: int64):pointer;
begin
if len mod 8=0 then result:=ippsMalloc_64f(len div 8)
else
if len mod 4=0 then result:=ippsMalloc_32f(len div 4)
else
result:=ippsMalloc_8u(len);
end;
function ippsCopy(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsCopy_8u(pSrc,pDst,len);
end;
function ippsCopy(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsCopy_16s(pSrc,pDst,len);
end;
function ippsCopy(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsCopy_16sc(pSrc,pDst,len);
end;
function ippsCopy(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsCopy_32f(pSrc,pDst,len);
end;
function ippsCopy(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsCopy_32fc(pSrc,pDst,len);
end;
function ippsCopy(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsCopy_64f(pSrc,pDst,len);
end;
function ippsCopy(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsCopy_64fc(pSrc,pDst,len);
end;
function ippsMove(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsMove_8u(pSrc,pDst,len);
end;
function ippsMove(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsMove_16s(pSrc,pDst,len);
end;
function ippsMove(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsMove_16sc(pSrc,pDst,len);
end;
function ippsMove(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMove_32f(pSrc,pDst,len);
end;
function ippsMove(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsMove_32fc(pSrc,pDst,len);
end;
function ippsMove(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsMove_64f(pSrc,pDst,len);
end;
function ippsMove(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsMove_64fc(pSrc,pDst,len);
end;
function ippsZero(pDst: pointer;len: int64):IppStatus;
begin
if len mod 8=0 then result:=ippsZero_64f(PIpp64f(pDst), len div 8)
else
if len mod 4=0 then result:=ippsZero_32f(PIpp32f(pDst), len div 4)
else
if len mod 2=0 then result:=ippsZero_16s(PIpp16s(pDst), len div 2)
else
result:=ippsZero_8u(PIpp8u(pDst), len);
end;
function ippsZero(pDst:PIpp8u;len:longint):IppStatus;
begin
if assigned(ippsZero_8u) then result:=ippsZero_8u(pDst,len)
else
begin
fillchar(pDst^,len,0);
result:=0;
end;
end;
function ippsZero(pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsZero_16s(pDst,len);
end;
function ippsZero(pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsZero_16sc(pDst,len);
end;
function ippsZero(pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsZero_32f(pDst,len);
end;
function ippsZero(pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsZero_32fc(pDst,len);
end;
function ippsZero(pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsZero_64f(pDst,len);
end;
function ippsZero(pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsZero_64fc(pDst,len);
end;
function ippsSet(val:Ipp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsSet_8u(val,pDst,len);
end;
function ippsSet(val:Ipp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsSet_16s(val,pDst,len);
end;
function ippsSet(val:Ipp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsSet_16sc(val,pDst,len);
end;
function ippsSet(val:Ipp32s;pDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsSet_32s(val,pDst,len);
end;
function ippsSet(val:Ipp32sc;pDst:PIpp32sc;len:longint):IppStatus;
begin
result:=ippsSet_32sc(val,pDst,len);
end;
function ippsSet(val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSet_32f(val,pDst,len);
end;
function ippsSet(val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSet_32fc(val,pDst,len);
end;
function ippsSet(val:Ipp64s;pDst:PIpp64s;len:longint):IppStatus;
begin
result:=ippsSet_64s(val,pDst,len);
end;
function ippsSet(val:Ipp64sc;pDst:PIpp64sc;len:longint):IppStatus;
begin
result:=ippsSet_64sc(val,pDst,len);
end;
function ippsSet(val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSet_64f(val,pDst,len);
end;
function ippsSet(val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSet_64fc(val,pDst,len);
end;
function ippsRandUniform_Direct(pDst:PIpp16s;len:longint;low:Ipp16s;high:Ipp16s;pSeed:PlongWord):IppStatus;
begin
result:=ippsRandUniform_Direct_16s(pDst,len,low,high,pSeed);
end;
function ippsRandUniform_Direct(pDst:PIpp32f;len:longint;low:Ipp32f;high:Ipp32f;pSeed:PlongWord):IppStatus;
begin
result:=ippsRandUniform_Direct_32f(pDst,len,low,high,pSeed);
end;
function ippsRandUniform_Direct(pDst:PIpp64f;len:longint;low:Ipp64f;high:Ipp64f;pSeed:PlongWord):IppStatus;
begin
result:=ippsRandUniform_Direct_64f(pDst,len,low,high,pSeed);
end;
function ippsRandGauss_Direct(pDst:PIpp16s;len:longint;mean:Ipp16s;stdev:Ipp16s;pSeed:PlongWord):IppStatus;
begin
result:=ippsRandGauss_Direct_16s(pDst,len,mean,stdev,pSeed);
end;
function ippsRandGauss_Direct(pDst:PIpp32f;len:longint;mean:Ipp32f;stdev:Ipp32f;pSeed:PlongWord):IppStatus;
begin
result:=ippsRandGauss_Direct_32f(pDst,len,mean,stdev,pSeed);
end;
function ippsRandGauss_Direct(pDst:PIpp64f;len:longint;mean:Ipp64f;stdev:Ipp64f;pSeed:PlongWord):IppStatus;
begin
result:=ippsRandGauss_Direct_64f(pDst,len,mean,stdev,pSeed);
end;
function ippsRandUniformInitAlloc(var pRandUniState:PIppsRandUniState_8u;low:Ipp8u;high:Ipp8u;seed:longWord):IppStatus;
begin
result:=ippsRandUniformInitAlloc_8u(pRandUniState,low,high,seed);
end;
function ippsRandUniformInitAlloc(var pRandUniState:PIppsRandUniState_16s;low:Ipp16s;high:Ipp16s;seed:longWord):IppStatus;
begin
result:=ippsRandUniformInitAlloc_16s(pRandUniState,low,high,seed);
end;
function ippsRandUniformInitAlloc(var pRandUniState:PIppsRandUniState_32f;low:Ipp32f;high:Ipp32f;seed:longWord):IppStatus;
begin
result:=ippsRandUniformInitAlloc_32f(pRandUniState,low,high,seed);
end;
function ippsRandUniform(pDst:PIpp8u;len:longint;pRandUniState:PIppsRandUniState_8u):IppStatus;
begin
result:=ippsRandUniform_8u(pDst,len,pRandUniState);
end;
function ippsRandUniform(pDst:PIpp16s;len:longint;pRandUniState:PIppsRandUniState_16s):IppStatus;
begin
result:=ippsRandUniform_16s(pDst,len,pRandUniState);
end;
function ippsRandUniform(pDst:PIpp32f;len:longint;pRandUniState:PIppsRandUniState_32f):IppStatus;
begin
result:=ippsRandUniform_32f(pDst,len,pRandUniState);
end;
function ippsRandUniformFree(pRandUniState:PIppsRandUniState_8u):IppStatus;
begin
result:=ippsRandUniformFree_8u(pRandUniState);
end;
function ippsRandUniformFree(pRandUniState:PIppsRandUniState_16s):IppStatus;
begin
result:=ippsRandUniformFree_16s(pRandUniState);
end;
function ippsRandUniformFree(pRandUniState:PIppsRandUniState_32f):IppStatus;
begin
result:=ippsRandUniformFree_32f(pRandUniState);
end;
function ippsRandGaussInitAlloc(var pRandGaussState:PIppsRandGaussState_8u;mean:Ipp8u;stdDev:Ipp8u;seed:longWord):IppStatus;
begin
result:=ippsRandGaussInitAlloc_8u(pRandGaussState,mean,stdDev,seed);
end;
function ippsRandGaussInitAlloc(var pRandGaussState:PIppsRandGaussState_16s;mean:Ipp16s;stdDev:Ipp16s;seed:longWord):IppStatus;
begin
result:=ippsRandGaussInitAlloc_16s(pRandGaussState,mean,stdDev,seed);
end;
function ippsRandGaussInitAlloc(var pRandGaussState:PIppsRandGaussState_32f;mean:Ipp32f;stdDev:Ipp32f;seed:longWord):IppStatus;
begin
result:=ippsRandGaussInitAlloc_32f(pRandGaussState,mean,stdDev,seed);
end;
function ippsRandGauss(pDst:PIpp8u;len:longint;pRandGaussState:PIppsRandGaussState_8u):IppStatus;
begin
result:=ippsRandGauss_8u(pDst,len,pRandGaussState);
end;
function ippsRandGauss(pDst:PIpp16s;len:longint;pRandGaussState:PIppsRandGaussState_16s):IppStatus;
begin
result:=ippsRandGauss_16s(pDst,len,pRandGaussState);
end;
function ippsRandGauss(pDst:PIpp32f;len:longint;pRandGaussState:PIppsRandGaussState_32f):IppStatus;
begin
result:=ippsRandGauss_32f(pDst,len,pRandGaussState);
end;
function ippsRandGaussFree(pRandGaussState:PIppsRandGaussState_8u):IppStatus;
begin
result:=ippsRandGaussFree_8u(pRandGaussState);
end;
function ippsRandGaussFree(pRandGaussState:PIppsRandGaussState_16s):IppStatus;
begin
result:=ippsRandGaussFree_16s(pRandGaussState);
end;
function ippsRandGaussFree(pRandGaussState:PIppsRandGaussState_32f):IppStatus;
begin
result:=ippsRandGaussFree_32f(pRandGaussState);
end;
function ippsRandGaussGetSize(pRandGaussStateSize:Plongint):IppStatus;
begin
result:=ippsRandGaussGetSize_16s(pRandGaussStateSize);
end;
function ippsRandGaussInit(pRandGaussState:PIppsRandGaussState_16s;mean:Ipp16s;stdDev:Ipp16s;seed:longWord):IppStatus;
begin
result:=ippsRandGaussInit_16s(pRandGaussState,mean,stdDev,seed);
end;
function ippsRandUniformGetSize(pRandUniformStateSize:Plongint):IppStatus;
begin
result:=ippsRandUniformGetSize_16s(pRandUniformStateSize);
end;
function ippsRandUniformInit(pRandUniState:PIppsRandUniState_16s;low:Ipp16s;high:Ipp16s;seed:longWord):IppStatus;
begin
result:=ippsRandUniformInit_16s(pRandUniState,low,high,seed);
end;
function ippsVectorJaehne(pDst:PIpp8u;len:longint;magn:Ipp8u):IppStatus;
begin
result:=ippsVectorJaehne_8u(pDst,len,magn);
end;
function ippsVectorJaehne(pDst:PIpp8s;len:longint;magn:Ipp8s):IppStatus;
begin
result:=ippsVectorJaehne_8s(pDst,len,magn);
end;
function ippsVectorJaehne(pDst:PIpp16u;len:longint;magn:Ipp16u):IppStatus;
begin
result:=ippsVectorJaehne_16u(pDst,len,magn);
end;
function ippsVectorJaehne(pDst:PIpp16s;len:longint;magn:Ipp16s):IppStatus;
begin
result:=ippsVectorJaehne_16s(pDst,len,magn);
end;
function ippsVectorJaehne(pDst:PIpp32u;len:longint;magn:Ipp32u):IppStatus;
begin
result:=ippsVectorJaehne_32u(pDst,len,magn);
end;
function ippsVectorJaehne(pDst:PIpp32s;len:longint;magn:Ipp32s):IppStatus;
begin
result:=ippsVectorJaehne_32s(pDst,len,magn);
end;
function ippsVectorJaehne(pDst:PIpp32f;len:longint;magn:Ipp32f):IppStatus;
begin
result:=ippsVectorJaehne_32f(pDst,len,magn);
end;
function ippsVectorJaehne(pDst:PIpp64f;len:longint;magn:Ipp64f):IppStatus;
begin
result:=ippsVectorJaehne_64f(pDst,len,magn);
end;
function ippsTone_Direct(pDst:PIpp32f;len:longint;magn:single;rFreq:single;pPhase:Psingle;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsTone_Direct_32f(pDst,len,magn,rFreq,pPhase,hint);
end;
function ippsTone_Direct(pDst:PIpp32fc;len:longint;magn:single;rFreq:single;pPhase:Psingle;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsTone_Direct_32fc(pDst,len,magn,rFreq,pPhase,hint);
end;
function ippsTone_Direct(pDst:PIpp64f;len:longint;magn:double;rFreq:double;pPhase:Pdouble;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsTone_Direct_64f(pDst,len,magn,rFreq,pPhase,hint);
end;
function ippsTone_Direct(pDst:PIpp64fc;len:longint;magn:double;rFreq:double;pPhase:Pdouble;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsTone_Direct_64fc(pDst,len,magn,rFreq,pPhase,hint);
end;
function ippsTone_Direct(pDst:PIpp16s;len:longint;magn:Ipp16s;rFreq:single;pPhase:Psingle;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsTone_Direct_16s(pDst,len,magn,rFreq,pPhase,hint);
end;
function ippsTone_Direct(pDst:PIpp16sc;len:longint;magn:Ipp16s;rFreq:single;pPhase:Psingle;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsTone_Direct_16sc(pDst,len,magn,rFreq,pPhase,hint);
end;
function ippsToneInitAllocQ15(var pToneState:PIppToneState_16s;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s):IppStatus;
begin
result:=ippsToneInitAllocQ15_16s(pToneState,magn,rFreqQ15,phaseQ15);
end;
function ippsToneGetStateSizeQ15(pToneStateSize:Plongint):IppStatus;
begin
result:=ippsToneGetStateSizeQ15_16s(pToneStateSize);
end;
function ippsToneInitQ15(pToneState:PIppToneState_16s;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s):IppStatus;
begin
result:=ippsToneInitQ15_16s(pToneState,magn,rFreqQ15,phaseQ15);
end;
function ippsToneQ15(pDst:PIpp16s;len:longint;pToneState:PIppToneState_16s):IppStatus;
begin
result:=ippsToneQ15_16s(pDst,len,pToneState);
end;
function ippsTriangle_Direct(pDst:PIpp64f;len:longint;magn:double;rFreq:double;asym:double;pPhase:Pdouble):IppStatus;
begin
result:=ippsTriangle_Direct_64f(pDst,len,magn,rFreq,asym,pPhase);
end;
function ippsTriangle_Direct(pDst:PIpp64fc;len:longint;magn:double;rFreq:double;asym:double;pPhase:Pdouble):IppStatus;
begin
result:=ippsTriangle_Direct_64fc(pDst,len,magn,rFreq,asym,pPhase);
end;
function ippsTriangle_Direct(pDst:PIpp32f;len:longint;magn:single;rFreq:single;asym:single;pPhase:Psingle):IppStatus;
begin
result:=ippsTriangle_Direct_32f(pDst,len,magn,rFreq,asym,pPhase);
end;
function ippsTriangle_Direct(pDst:PIpp32fc;len:longint;magn:single;rFreq:single;asym:single;pPhase:Psingle):IppStatus;
begin
result:=ippsTriangle_Direct_32fc(pDst,len,magn,rFreq,asym,pPhase);
end;
function ippsTriangle_Direct(pDst:PIpp16s;len:longint;magn:Ipp16s;rFreq:single;asym:single;pPhase:Psingle):IppStatus;
begin
result:=ippsTriangle_Direct_16s(pDst,len,magn,rFreq,asym,pPhase);
end;
function ippsTriangle_Direct(pDst:PIpp16sc;len:longint;magn:Ipp16s;rFreq:single;asym:single;pPhase:Psingle):IppStatus;
begin
result:=ippsTriangle_Direct_16sc(pDst,len,magn,rFreq,asym,pPhase);
end;
function ippsTriangleInitAllocQ15(var pTriangleState:PIppTriangleState_16s;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s;asymQ15:Ipp32s):IppStatus;
begin
result:=ippsTriangleInitAllocQ15_16s(pTriangleState,magn,rFreqQ15,phaseQ15,asymQ15);
end;
function ippsTriangleGetStateSizeQ15(pTriangleStateSize:Plongint):IppStatus;
begin
result:=ippsTriangleGetStateSizeQ15_16s(pTriangleStateSize);
end;
function ippsTriangleInitQ15(pTriangleState:PIppTriangleState_16s;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s;asymQ15:Ipp32s):IppStatus;
begin
result:=ippsTriangleInitQ15_16s(pTriangleState,magn,rFreqQ15,phaseQ15,asymQ15);
end;
function ippsTriangleQ15(pDst:PIpp16s;len:longint;pTriangleState:PIppTriangleState_16s):IppStatus;
begin
result:=ippsTriangleQ15_16s(pDst,len,pTriangleState);
end;
function ippsToneQ15_Direct(pDst:PIpp16s;len:longint;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s):IppStatus;
begin
result:=ippsToneQ15_Direct_16s(pDst,len,magn,rFreqQ15,phaseQ15);
end;
function ippsTriangleQ15_Direct(pDst:PIpp16s;len:longint;magn:Ipp16s;rFreqQ15:Ipp16s;phaseQ15:Ipp32s;asymQ15:Ipp32s):IppStatus;
begin
result:=ippsTriangleQ15_Direct_16s(pDst,len,magn,rFreqQ15,phaseQ15,asymQ15);
end;
function ippsVectorRamp(pDst:PIpp8u;len:longint;offset:single;slope:single):IppStatus;
begin
result:=ippsVectorRamp_8u(pDst,len,offset,slope);
end;
function ippsVectorRamp(pDst:PIpp8s;len:longint;offset:single;slope:single):IppStatus;
begin
result:=ippsVectorRamp_8s(pDst,len,offset,slope);
end;
function ippsVectorRamp(pDst:PIpp16u;len:longint;offset:single;slope:single):IppStatus;
begin
result:=ippsVectorRamp_16u(pDst,len,offset,slope);
end;
function ippsVectorRamp(pDst:PIpp16s;len:longint;offset:single;slope:single):IppStatus;
begin
result:=ippsVectorRamp_16s(pDst,len,offset,slope);
end;
function ippsVectorRamp(pDst:PIpp32u;len:longint;offset:single;slope:single):IppStatus;
begin
result:=ippsVectorRamp_32u(pDst,len,offset,slope);
end;
function ippsVectorRamp(pDst:PIpp32s;len:longint;offset:single;slope:single):IppStatus;
begin
result:=ippsVectorRamp_32s(pDst,len,offset,slope);
end;
function ippsVectorRamp(pDst:PIpp32f;len:longint;offset:single;slope:single):IppStatus;
begin
result:=ippsVectorRamp_32f(pDst,len,offset,slope);
end;
function ippsVectorRamp(pDst:PIpp64f;len:longint;offset:single;slope:single):IppStatus;
begin
result:=ippsVectorRamp_64f(pDst,len,offset,slope);
end;
function ippsReal(pSrc:PIpp64fc;pDstRe:PIpp64f;len:longint):IppStatus;
begin
result:=ippsReal_64fc(pSrc,pDstRe,len);
end;
function ippsReal(pSrc:PIpp32fc;pDstRe:PIpp32f;len:longint):IppStatus;
begin
result:=ippsReal_32fc(pSrc,pDstRe,len);
end;
function ippsReal(pSrc:PIpp16sc;pDstRe:PIpp16s;len:longint):IppStatus;
begin
result:=ippsReal_16sc(pSrc,pDstRe,len);
end;
function ippsImag(pSrc:PIpp64fc;pDstIm:PIpp64f;len:longint):IppStatus;
begin
result:=ippsImag_64fc(pSrc,pDstIm,len);
end;
function ippsImag(pSrc:PIpp32fc;pDstIm:PIpp32f;len:longint):IppStatus;
begin
result:=ippsImag_32fc(pSrc,pDstIm,len);
end;
function ippsImag(pSrc:PIpp16sc;pDstIm:PIpp16s;len:longint):IppStatus;
begin
result:=ippsImag_16sc(pSrc,pDstIm,len);
end;
function ippsCplxToReal(pSrc:PIpp64fc;pDstRe:PIpp64f;pDstIm:PIpp64f;len:longint):IppStatus;
begin
result:=ippsCplxToReal_64fc(pSrc,pDstRe,pDstIm,len);
end;
function ippsCplxToReal(pSrc:PIpp32fc;pDstRe:PIpp32f;pDstIm:PIpp32f;len:longint):IppStatus;
begin
result:=ippsCplxToReal_32fc(pSrc,pDstRe,pDstIm,len);
end;
function ippsCplxToReal(pSrc:PIpp16sc;pDstRe:PIpp16s;pDstIm:PIpp16s;len:longint):IppStatus;
begin
result:=ippsCplxToReal_16sc(pSrc,pDstRe,pDstIm,len);
end;
function ippsRealToCplx(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsRealToCplx_64f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsRealToCplx(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsRealToCplx_32f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsRealToCplx(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsRealToCplx_16s(pSrcRe,pSrcIm,pDst,len);
end;
function ippsConj(pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsConj_64fc_I(pSrcDst,len);
end;
function ippsConj(pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsConj_32fc_I(pSrcDst,len);
end;
function ippsConj(pSrcDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsConj_16sc_I(pSrcDst,len);
end;
function ippsConj(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsConj_64fc(pSrc,pDst,len);
end;
function ippsConj(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsConj_32fc(pSrc,pDst,len);
end;
function ippsConj(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsConj_16sc(pSrc,pDst,len);
end;
function ippsConjFlip(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsConjFlip_64fc(pSrc,pDst,len);
end;
function ippsConjFlip(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsConjFlip_32fc(pSrc,pDst,len);
end;
function ippsConjFlip(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsConjFlip_16sc(pSrc,pDst,len);
end;
function ippsConjCcs(pSrcDst:PIpp64fc;lenDst:longint):IppStatus;
begin
result:=ippsConjCcs_64fc_I(pSrcDst,lenDst);
end;
function ippsConjCcs(pSrcDst:PIpp32fc;lenDst:longint):IppStatus;
begin
result:=ippsConjCcs_32fc_I(pSrcDst,lenDst);
end;
function ippsConjCcs(pSrcDst:PIpp16sc;lenDst:longint):IppStatus;
begin
result:=ippsConjCcs_16sc_I(pSrcDst,lenDst);
end;
function ippsConjCcs(pSrc:PIpp64f;pDst:PIpp64fc;lenDst:longint):IppStatus;
begin
result:=ippsConjCcs_64fc(pSrc,pDst,lenDst);
end;
function ippsConjCcs(pSrc:PIpp32f;pDst:PIpp32fc;lenDst:longint):IppStatus;
begin
result:=ippsConjCcs_32fc(pSrc,pDst,lenDst);
end;
function ippsConjCcs(pSrc:PIpp16s;pDst:PIpp16sc;lenDst:longint):IppStatus;
begin
result:=ippsConjCcs_16sc(pSrc,pDst,lenDst);
end;
function ippsConjPack(pSrcDst:PIpp64fc;lenDst:longint):IppStatus;
begin
result:=ippsConjPack_64fc_I(pSrcDst,lenDst);
end;
function ippsConjPack(pSrcDst:PIpp32fc;lenDst:longint):IppStatus;
begin
result:=ippsConjPack_32fc_I(pSrcDst,lenDst);
end;
function ippsConjPack(pSrcDst:PIpp16sc;lenDst:longint):IppStatus;
begin
result:=ippsConjPack_16sc_I(pSrcDst,lenDst);
end;
function ippsConjPack(pSrc:PIpp64f;pDst:PIpp64fc;lenDst:longint):IppStatus;
begin
result:=ippsConjPack_64fc(pSrc,pDst,lenDst);
end;
function ippsConjPack(pSrc:PIpp32f;pDst:PIpp32fc;lenDst:longint):IppStatus;
begin
result:=ippsConjPack_32fc(pSrc,pDst,lenDst);
end;
function ippsConjPack(pSrc:PIpp16s;pDst:PIpp16sc;lenDst:longint):IppStatus;
begin
result:=ippsConjPack_16sc(pSrc,pDst,lenDst);
end;
function ippsConjPerm(pSrcDst:PIpp64fc;lenDst:longint):IppStatus;
begin
result:=ippsConjPerm_64fc_I(pSrcDst,lenDst);
end;
function ippsConjPerm(pSrcDst:PIpp32fc;lenDst:longint):IppStatus;
begin
result:=ippsConjPerm_32fc_I(pSrcDst,lenDst);
end;
function ippsConjPerm(pSrcDst:PIpp16sc;lenDst:longint):IppStatus;
begin
result:=ippsConjPerm_16sc_I(pSrcDst,lenDst);
end;
function ippsConjPerm(pSrc:PIpp64f;pDst:PIpp64fc;lenDst:longint):IppStatus;
begin
result:=ippsConjPerm_64fc(pSrc,pDst,lenDst);
end;
function ippsConjPerm(pSrc:PIpp32f;pDst:PIpp32fc;lenDst:longint):IppStatus;
begin
result:=ippsConjPerm_32fc(pSrc,pDst,lenDst);
end;
function ippsConjPerm(pSrc:PIpp16s;pDst:PIpp16sc;lenDst:longint):IppStatus;
begin
result:=ippsConjPerm_16sc(pSrc,pDst,lenDst);
end;
function ippsConvert(pSrc:PIpp8s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsConvert_8s16s(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp16s;pDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsConvert_16s32s(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsConvert_32s16s(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp8s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsConvert_8s32f(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp8u;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsConvert_8u32f(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsConvert_16s32f(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp16u;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsConvert_16u32f(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsConvert_32s64f(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsConvert_32s32f(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp8s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32f8s_Sfs(pSrc,pDst,len,rndmode,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp8u;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32f8u_Sfs(pSrc,pDst,len,rndmode,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp16s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32f16s_Sfs(pSrc,pDst,len,rndmode,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp16u;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32f16u_Sfs(pSrc,pDst,len,rndmode,scaleFactor);
end;
function ippsConvert(pSrc:PIpp64f;pDst:PIpp32s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_64f32s_Sfs(pSrc,pDst,len,rndmode,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp32s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32f32s_Sfs(pSrc,pDst,len,rndmode,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsConvert_32f64f(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp64f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsConvert_64f32f(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp16s;pDst:PIpp32f;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_16s32f_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsConvert(pSrc:PIpp16s;pDst:PIpp64f;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_16s64f_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp32f;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32s32f_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp64f;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32s64f_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32s16s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsConvert(pSrc:PIpp8u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsConvert_24u32u(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp32u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32u24u_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32f24u_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsConvert(pSrc:PIpp8u;pDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsConvert_24s32s(pSrc,pDst,len);
end;
function ippsConvert(pSrc:PIpp32s;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_32s24s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsConvert(pSrc:PIpp16s;pDst:PIpp16f;len:longint;rndmode:IppRoundMode):IppStatus;
begin
result:=ippsConvert_16s16f(pSrc,pDst,len,rndmode);
end;
function ippsConvert(pSrc:PIpp16f;pDst:PIpp16s;len:longint;rndmode:IppRoundMode;scaleFactor:longint):IppStatus;
begin
result:=ippsConvert_16f16s_Sfs(pSrc,pDst,len,rndmode,scaleFactor);
end;
function ippsConvert(pSrc:PIpp32f;pDst:PIpp16f;len:longint;rndmode:IppRoundMode):IppStatus;
begin
result:=ippsConvert_32f16f(pSrc,pDst,len,rndmode);
end;
function ippsConvert(pSrc:PIpp16f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsConvert_16f32f(pSrc,pDst,len);
end;
function ippsThreshold(pSrcDst:PIpp32f;len:longint;level:Ipp32f;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_32f_I(pSrcDst,len,level,relOp);
end;
function ippsThreshold(pSrcDst:PIpp32fc;len:longint;level:Ipp32f;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_32fc_I(pSrcDst,len,level,relOp);
end;
function ippsThreshold(pSrcDst:PIpp64f;len:longint;level:Ipp64f;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_64f_I(pSrcDst,len,level,relOp);
end;
function ippsThreshold(pSrcDst:PIpp64fc;len:longint;level:Ipp64f;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_64fc_I(pSrcDst,len,level,relOp);
end;
function ippsThreshold(pSrcDst:PIpp16s;len:longint;level:Ipp16s;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_16s_I(pSrcDst,len,level,relOp);
end;
function ippsThreshold(pSrcDst:PIpp16sc;len:longint;level:Ipp16s;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_16sc_I(pSrcDst,len,level,relOp);
end;
function ippsThreshold(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_32f(pSrc,pDst,len,level,relOp);
end;
function ippsThreshold(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_32fc(pSrc,pDst,len,level,relOp);
end;
function ippsThreshold(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_64f(pSrc,pDst,len,level,relOp);
end;
function ippsThreshold(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_64fc(pSrc,pDst,len,level,relOp);
end;
function ippsThreshold(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_16s(pSrc,pDst,len,level,relOp);
end;
function ippsThreshold(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s;relOp:IppCmpOp):IppStatus;
begin
result:=ippsThreshold_16sc(pSrc,pDst,len,level,relOp);
end;
function ippsThreshold_LT(pSrcDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LT_32f_I(pSrcDst,len,level);
end;
function ippsThreshold_LT(pSrcDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LT_32fc_I(pSrcDst,len,level);
end;
function ippsThreshold_LT(pSrcDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LT_64f_I(pSrcDst,len,level);
end;
function ippsThreshold_LT(pSrcDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LT_64fc_I(pSrcDst,len,level);
end;
function ippsThreshold_LT(pSrcDst:PIpp16s;len:longint;level:Ipp16s):IppStatus;
begin
result:=ippsThreshold_LT_16s_I(pSrcDst,len,level);
end;
function ippsThreshold_LT(pSrcDst:PIpp16sc;len:longint;level:Ipp16s):IppStatus;
begin
result:=ippsThreshold_LT_16sc_I(pSrcDst,len,level);
end;
function ippsThreshold_LT(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LT_32f(pSrc,pDst,len,level);
end;
function ippsThreshold_LT(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LT_32fc(pSrc,pDst,len,level);
end;
function ippsThreshold_LT(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LT_64f(pSrc,pDst,len,level);
end;
function ippsThreshold_LT(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LT_64fc(pSrc,pDst,len,level);
end;
function ippsThreshold_LT(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s):IppStatus;
begin
result:=ippsThreshold_LT_16s(pSrc,pDst,len,level);
end;
function ippsThreshold_LT(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s):IppStatus;
begin
result:=ippsThreshold_LT_16sc(pSrc,pDst,len,level);
end;
function ippsThreshold_LT(pSrcDst:PIpp32s;len:longint;level:Ipp32s):IppStatus;
begin
result:=ippsThreshold_LT_32s_I(pSrcDst,len,level);
end;
function ippsThreshold_LT(pSrc:PIpp32s;pDst:PIpp32s;len:longint;level:Ipp32s):IppStatus;
begin
result:=ippsThreshold_LT_32s(pSrc,pDst,len,level);
end;
function ippsThreshold_GT(pSrcDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_GT_32f_I(pSrcDst,len,level);
end;
function ippsThreshold_GT(pSrcDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_GT_32fc_I(pSrcDst,len,level);
end;
function ippsThreshold_GT(pSrcDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_GT_64f_I(pSrcDst,len,level);
end;
function ippsThreshold_GT(pSrcDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_GT_64fc_I(pSrcDst,len,level);
end;
function ippsThreshold_GT(pSrcDst:PIpp16s;len:longint;level:Ipp16s):IppStatus;
begin
result:=ippsThreshold_GT_16s_I(pSrcDst,len,level);
end;
function ippsThreshold_GT(pSrcDst:PIpp16sc;len:longint;level:Ipp16s):IppStatus;
begin
result:=ippsThreshold_GT_16sc_I(pSrcDst,len,level);
end;
function ippsThreshold_GT(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_GT_32f(pSrc,pDst,len,level);
end;
function ippsThreshold_GT(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_GT_32fc(pSrc,pDst,len,level);
end;
function ippsThreshold_GT(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_GT_64f(pSrc,pDst,len,level);
end;
function ippsThreshold_GT(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_GT_64fc(pSrc,pDst,len,level);
end;
function ippsThreshold_GT(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s):IppStatus;
begin
result:=ippsThreshold_GT_16s(pSrc,pDst,len,level);
end;
function ippsThreshold_GT(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s):IppStatus;
begin
result:=ippsThreshold_GT_16sc(pSrc,pDst,len,level);
end;
function ippsThreshold_LTVal(pSrcDst:PIpp32f;len:longint;level:Ipp32f;value:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LTVal_32f_I(pSrcDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrcDst:PIpp32fc;len:longint;level:Ipp32f;value:Ipp32fc):IppStatus;
begin
result:=ippsThreshold_LTVal_32fc_I(pSrcDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrcDst:PIpp64f;len:longint;level:Ipp64f;value:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LTVal_64f_I(pSrcDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrcDst:PIpp64fc;len:longint;level:Ipp64f;value:Ipp64fc):IppStatus;
begin
result:=ippsThreshold_LTVal_64fc_I(pSrcDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrcDst:PIpp16s;len:longint;level:Ipp16s;value:Ipp16s):IppStatus;
begin
result:=ippsThreshold_LTVal_16s_I(pSrcDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrcDst:PIpp16sc;len:longint;level:Ipp16s;value:Ipp16sc):IppStatus;
begin
result:=ippsThreshold_LTVal_16sc_I(pSrcDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f;value:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LTVal_32f(pSrc,pDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f;value:Ipp32fc):IppStatus;
begin
result:=ippsThreshold_LTVal_32fc(pSrc,pDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f;value:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LTVal_64f(pSrc,pDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f;value:Ipp64fc):IppStatus;
begin
result:=ippsThreshold_LTVal_64fc(pSrc,pDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s;value:Ipp16s):IppStatus;
begin
result:=ippsThreshold_LTVal_16s(pSrc,pDst,len,level,value);
end;
function ippsThreshold_LTVal(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s;value:Ipp16sc):IppStatus;
begin
result:=ippsThreshold_LTVal_16sc(pSrc,pDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrcDst:PIpp32f;len:longint;level:Ipp32f;value:Ipp32f):IppStatus;
begin
result:=ippsThreshold_GTVal_32f_I(pSrcDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrcDst:PIpp32fc;len:longint;level:Ipp32f;value:Ipp32fc):IppStatus;
begin
result:=ippsThreshold_GTVal_32fc_I(pSrcDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrcDst:PIpp64f;len:longint;level:Ipp64f;value:Ipp64f):IppStatus;
begin
result:=ippsThreshold_GTVal_64f_I(pSrcDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrcDst:PIpp64fc;len:longint;level:Ipp64f;value:Ipp64fc):IppStatus;
begin
result:=ippsThreshold_GTVal_64fc_I(pSrcDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrcDst:PIpp16s;len:longint;level:Ipp16s;value:Ipp16s):IppStatus;
begin
result:=ippsThreshold_GTVal_16s_I(pSrcDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrcDst:PIpp16sc;len:longint;level:Ipp16s;value:Ipp16sc):IppStatus;
begin
result:=ippsThreshold_GTVal_16sc_I(pSrcDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f;value:Ipp32f):IppStatus;
begin
result:=ippsThreshold_GTVal_32f(pSrc,pDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f;value:Ipp32fc):IppStatus;
begin
result:=ippsThreshold_GTVal_32fc(pSrc,pDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f;value:Ipp64f):IppStatus;
begin
result:=ippsThreshold_GTVal_64f(pSrc,pDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f;value:Ipp64fc):IppStatus;
begin
result:=ippsThreshold_GTVal_64fc(pSrc,pDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrc:PIpp16s;pDst:PIpp16s;len:longint;level:Ipp16s;value:Ipp16s):IppStatus;
begin
result:=ippsThreshold_GTVal_16s(pSrc,pDst,len,level,value);
end;
function ippsThreshold_GTVal(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;level:Ipp16s;value:Ipp16sc):IppStatus;
begin
result:=ippsThreshold_GTVal_16sc(pSrc,pDst,len,level,value);
end;
function ippsThreshold_LTInv(pSrcDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LTInv_32f_I(pSrcDst,len,level);
end;
function ippsThreshold_LTInv(pSrcDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LTInv_32fc_I(pSrcDst,len,level);
end;
function ippsThreshold_LTInv(pSrcDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LTInv_64f_I(pSrcDst,len,level);
end;
function ippsThreshold_LTInv(pSrcDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LTInv_64fc_I(pSrcDst,len,level);
end;
function ippsThreshold_LTInv(pSrc:PIpp32f;pDst:PIpp32f;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LTInv_32f(pSrc,pDst,len,level);
end;
function ippsThreshold_LTInv(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;level:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LTInv_32fc(pSrc,pDst,len,level);
end;
function ippsThreshold_LTInv(pSrc:PIpp64f;pDst:PIpp64f;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LTInv_64f(pSrc,pDst,len,level);
end;
function ippsThreshold_LTInv(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;level:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LTInv_64fc(pSrc,pDst,len,level);
end;
function ippsThreshold_LTValGTVal(pSrcDst:PIpp32f;len:longint;levelLT:Ipp32f;valueLT:Ipp32f;levelGT:Ipp32f;valueGT:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LTValGTVal_32f_I(pSrcDst,len,levelLT,valueLT,levelGT,valueGT);
end;
function ippsThreshold_LTValGTVal(pSrcDst:PIpp64f;len:longint;levelLT:Ipp64f;valueLT:Ipp64f;levelGT:Ipp64f;valueGT:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LTValGTVal_64f_I(pSrcDst,len,levelLT,valueLT,levelGT,valueGT);
end;
function ippsThreshold_LTValGTVal(pSrc:PIpp32f;pDst:PIpp32f;len:longint;levelLT:Ipp32f;valueLT:Ipp32f;levelGT:Ipp32f;valueGT:Ipp32f):IppStatus;
begin
result:=ippsThreshold_LTValGTVal_32f(pSrc,pDst,len,levelLT,valueLT,levelGT,valueGT);
end;
function ippsThreshold_LTValGTVal(pSrc:PIpp64f;pDst:PIpp64f;len:longint;levelLT:Ipp64f;valueLT:Ipp64f;levelGT:Ipp64f;valueGT:Ipp64f):IppStatus;
begin
result:=ippsThreshold_LTValGTVal_64f(pSrc,pDst,len,levelLT,valueLT,levelGT,valueGT);
end;
function ippsThreshold_LTValGTVal(pSrcDst:PIpp16s;len:longint;levelLT:Ipp16s;valueLT:Ipp16s;levelGT:Ipp16s;valueGT:Ipp16s):IppStatus;
begin
result:=ippsThreshold_LTValGTVal_16s_I(pSrcDst,len,levelLT,valueLT,levelGT,valueGT);
end;
function ippsThreshold_LTValGTVal(pSrc:PIpp16s;pDst:PIpp16s;len:longint;levelLT:Ipp16s;valueLT:Ipp16s;levelGT:Ipp16s;valueGT:Ipp16s):IppStatus;
begin
result:=ippsThreshold_LTValGTVal_16s(pSrc,pDst,len,levelLT,valueLT,levelGT,valueGT);
end;
function ippsCartToPolar(pSrc:PIpp32fc;pDstMagn:PIpp32f;pDstPhase:PIpp32f;len:longint):IppStatus;
begin
result:=ippsCartToPolar_32fc(pSrc,pDstMagn,pDstPhase,len);
end;
function ippsCartToPolar(pSrc:PIpp64fc;pDstMagn:PIpp64f;pDstPhase:PIpp64f;len:longint):IppStatus;
begin
result:=ippsCartToPolar_64fc(pSrc,pDstMagn,pDstPhase,len);
end;
function ippsCartToPolar(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstMagn:PIpp32f;pDstPhase:PIpp32f;len:longint):IppStatus;
begin
result:=ippsCartToPolar_32f(pSrcRe,pSrcIm,pDstMagn,pDstPhase,len);
end;
function ippsCartToPolar(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstMagn:PIpp64f;pDstPhase:PIpp64f;len:longint):IppStatus;
begin
result:=ippsCartToPolar_64f(pSrcRe,pSrcIm,pDstMagn,pDstPhase,len);
end;
function ippsPolarToCart(pSrcMagn:PIpp32f;pSrcPhase:PIpp32f;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsPolarToCart_32fc(pSrcMagn,pSrcPhase,pDst,len);
end;
function ippsPolarToCart(pSrcMagn:PIpp64f;pSrcPhase:PIpp64f;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsPolarToCart_64fc(pSrcMagn,pSrcPhase,pDst,len);
end;
function ippsPolarToCart(pSrcMagn:PIpp32f;pSrcPhase:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPolarToCart_32f(pSrcMagn,pSrcPhase,pDstRe,pDstIm,len);
end;
function ippsPolarToCart(pSrcMagn:PIpp64f;pSrcPhase:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;len:longint):IppStatus;
begin
result:=ippsPolarToCart_64f(pSrcMagn,pSrcPhase,pDstRe,pDstIm,len);
end;
function ippsALawToLin(pSrc:PIpp8u;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsALawToLin_8u32f(pSrc,pDst,len);
end;
function ippsALawToLin(pSrc:PIpp8u;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsALawToLin_8u16s(pSrc,pDst,len);
end;
function ippsMuLawToLin(pSrc:PIpp8u;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMuLawToLin_8u32f(pSrc,pDst,len);
end;
function ippsMuLawToLin(pSrc:PIpp8u;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsMuLawToLin_8u16s(pSrc,pDst,len);
end;
function ippsLinToALaw(pSrc:PIpp32f;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsLinToALaw_32f8u(pSrc,pDst,len);
end;
function ippsLinToALaw(pSrc:PIpp16s;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsLinToALaw_16s8u(pSrc,pDst,len);
end;
function ippsLinToMuLaw(pSrc:PIpp32f;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsLinToMuLaw_32f8u(pSrc,pDst,len);
end;
function ippsLinToMuLaw(pSrc:PIpp16s;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsLinToMuLaw_16s8u(pSrc,pDst,len);
end;
function ippsALawToMuLaw(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsALawToMuLaw_8u(pSrc,pDst,len);
end;
function ippsMuLawToALaw(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsMuLawToALaw_8u(pSrc,pDst,len);
end;
function ippsPreemphasize(pSrcDst:PIpp32f;len:longint;val:Ipp32f):IppStatus;
begin
result:=ippsPreemphasize_32f(pSrcDst,len,val);
end;
function ippsPreemphasize(pSrcDst:PIpp16s;len:longint;val:Ipp32f):IppStatus;
begin
result:=ippsPreemphasize_16s(pSrcDst,len,val);
end;
function ippsFlip(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsFlip_8u(pSrc,pDst,len);
end;
function ippsFlip(pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsFlip_8u_I(pSrcDst,len);
end;
function ippsFlip(pSrc:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsFlip_16u(pSrc,pDst,len);
end;
function ippsFlip(pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsFlip_16u_I(pSrcDst,len);
end;
function ippsFlip(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsFlip_32f(pSrc,pDst,len);
end;
function ippsFlip(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsFlip_32f_I(pSrcDst,len);
end;
function ippsFlip(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsFlip_64f(pSrc,pDst,len);
end;
function ippsFlip(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsFlip_64f_I(pSrcDst,len);
end;
function ippsUpdateLinear(pSrc:PIpp16s;len:longint;pSrcDst:PIpp32s;srcShiftRight:longint;alpha:Ipp16s;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsUpdateLinear_16s32s_I(pSrc,len,pSrcDst,srcShiftRight,alpha,hint);
end;
function ippsUpdatePower(pSrc:PIpp16s;len:longint;pSrcDst:PIpp32s;srcShiftRight:longint;alpha:Ipp16s;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsUpdatePower_16s32s_I(pSrc,len,pSrcDst,srcShiftRight,alpha,hint);
end;
function ippsJoin(var pSrc:PIpp32f;nChannels:longint;chanLen:longint;pDst:PIpp16s):IppStatus;
begin
result:=ippsJoin_32f16s_D2L(pSrc,nChannels,chanLen,pDst);
end;
function ippsSwapBytes(pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsSwapBytes_16u_I(pSrcDst,len);
end;
function ippsSwapBytes(pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsSwapBytes_24u_I(pSrcDst,len);
end;
function ippsSwapBytes(pSrcDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsSwapBytes_32u_I(pSrcDst,len);
end;
function ippsSwapBytes(pSrc:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsSwapBytes_16u(pSrc,pDst,len);
end;
function ippsSwapBytes(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsSwapBytes_24u(pSrc,pDst,len);
end;
function ippsSwapBytes(pSrc:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsSwapBytes_32u(pSrc,pDst,len);
end;
function ippsAddC(val:Ipp16s;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsAddC_16s_I(val,pSrcDst,len);
end;
function ippsSubC(val:Ipp16s;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsSubC_16s_I(val,pSrcDst,len);
end;
function ippsMulC(val:Ipp16s;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsMulC_16s_I(val,pSrcDst,len);
end;
function ippsAddC(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsAddC_32f_I(val,pSrcDst,len);
end;
function ippsAddC(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsAddC_32fc_I(val,pSrcDst,len);
end;
function ippsSubC(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSubC_32f_I(val,pSrcDst,len);
end;
function ippsSubC(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSubC_32fc_I(val,pSrcDst,len);
end;
function ippsSubCRev(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSubCRev_32f_I(val,pSrcDst,len);
end;
function ippsSubCRev(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSubCRev_32fc_I(val,pSrcDst,len);
end;
function ippsMulC(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMulC_32f_I(val,pSrcDst,len);
end;
function ippsMulC(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsMulC_32fc_I(val,pSrcDst,len);
end;
function ippsAddC(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsAddC_64f_I(val,pSrcDst,len);
end;
function ippsAddC(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsAddC_64fc_I(val,pSrcDst,len);
end;
function ippsSubC(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSubC_64f_I(val,pSrcDst,len);
end;
function ippsSubC(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSubC_64fc_I(val,pSrcDst,len);
end;
function ippsSubCRev(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSubCRev_64f_I(val,pSrcDst,len);
end;
function ippsSubCRev(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSubCRev_64fc_I(val,pSrcDst,len);
end;
function ippsMulC(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsMulC_64f_I(val,pSrcDst,len);
end;
function ippsMulC(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsMulC_64fc_I(val,pSrcDst,len);
end;
function ippsMulC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_32f16s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsMulC_Low(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsMulC_Low_32f16s(pSrc,val,pDst,len);
end;
function ippsAddC(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_8u_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubC(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_8u_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubCRev(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_8u_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsMulC(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_8u_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsAddC(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_16s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubC(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_16s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsMulC(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_16s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsAddC(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_16sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubC(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_16sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsMulC(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_16sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubCRev(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_16s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubCRev(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_16sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsAddC(val:Ipp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_32s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsAddC(val:Ipp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_32sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubC(val:Ipp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_32s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubC(val:Ipp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_32sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubCRev(val:Ipp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_32s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsSubCRev(val:Ipp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_32sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsMulC(val:Ipp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_32s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsMulC(val:Ipp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_32sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsAddC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsAddC_32f(pSrc,val,pDst,len);
end;
function ippsAddC(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsAddC_32fc(pSrc,val,pDst,len);
end;
function ippsSubC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSubC_32f(pSrc,val,pDst,len);
end;
function ippsSubC(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSubC_32fc(pSrc,val,pDst,len);
end;
function ippsSubCRev(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSubCRev_32f(pSrc,val,pDst,len);
end;
function ippsSubCRev(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSubCRev_32fc(pSrc,val,pDst,len);
end;
function ippsMulC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMulC_32f(pSrc,val,pDst,len);
end;
function ippsMulC(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsMulC_32fc(pSrc,val,pDst,len);
end;
function ippsAddC(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsAddC_64f(pSrc,val,pDst,len);
end;
function ippsAddC(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsAddC_64fc(pSrc,val,pDst,len);
end;
function ippsSubC(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSubC_64f(pSrc,val,pDst,len);
end;
function ippsSubC(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSubC_64fc(pSrc,val,pDst,len);
end;
function ippsSubCRev(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSubCRev_64f(pSrc,val,pDst,len);
end;
function ippsSubCRev(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSubCRev_64fc(pSrc,val,pDst,len);
end;
function ippsMulC(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsMulC_64f(pSrc,val,pDst,len);
end;
function ippsMulC(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsMulC_64fc(pSrc,val,pDst,len);
end;
function ippsAddC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_8u_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_8u_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubCRev(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_8u_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsMulC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_8u_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsAddC(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_16s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsAddC(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_16sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubC(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_16s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubC(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_16sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubCRev(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_16s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubCRev(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_16sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsMulC(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_16s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsMulC(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_16sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsAddC(pSrc:PIpp32s;val:Ipp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_32s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsAddC(pSrc:PIpp32sc;val:Ipp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddC_32sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubC(pSrc:PIpp32s;val:Ipp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_32s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubC(pSrc:PIpp32sc;val:Ipp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubC_32sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubCRev(pSrc:PIpp32s;val:Ipp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_32s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsSubCRev(pSrc:PIpp32sc;val:Ipp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSubCRev_32sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsMulC(pSrc:PIpp32s;val:Ipp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_32s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsMulC(pSrc:PIpp32sc;val:Ipp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulC_32sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsAdd(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsAdd_16s_I(pSrc,pSrcDst,len);
end;
function ippsSub(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsSub_16s_I(pSrc,pSrcDst,len);
end;
function ippsMul(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsMul_16s_I(pSrc,pSrcDst,len);
end;
function ippsAdd(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsAdd_32f_I(pSrc,pSrcDst,len);
end;
function ippsAdd(pSrc:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsAdd_32fc_I(pSrc,pSrcDst,len);
end;
function ippsSub(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSub_32f_I(pSrc,pSrcDst,len);
end;
function ippsSub(pSrc:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSub_32fc_I(pSrc,pSrcDst,len);
end;
function ippsMul(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMul_32f_I(pSrc,pSrcDst,len);
end;
function ippsMul(pSrc:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsMul_32fc_I(pSrc,pSrcDst,len);
end;
function ippsAdd(pSrc:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsAdd_64f_I(pSrc,pSrcDst,len);
end;
function ippsAdd(pSrc:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsAdd_64fc_I(pSrc,pSrcDst,len);
end;
function ippsSub(pSrc:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSub_64f_I(pSrc,pSrcDst,len);
end;
function ippsSub(pSrc:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSub_64fc_I(pSrc,pSrcDst,len);
end;
function ippsMul(pSrc:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsMul_64f_I(pSrc,pSrcDst,len);
end;
function ippsMul(pSrc:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsMul_64fc_I(pSrc,pSrcDst,len);
end;
function ippsAdd(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_8u_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsSub(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_8u_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsMul(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_8u_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsAdd(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_16s_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsAdd(pSrc:PIpp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_16sc_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsSub(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_16s_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsSub(pSrc:PIpp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_16sc_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsMul(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_16s_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsMul(pSrc:PIpp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_16sc_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsAdd(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_32s_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsAdd(pSrc:PIpp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_32sc_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsSub(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_32s_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsSub(pSrc:PIpp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_32sc_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsMul(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_32s_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsMul(pSrc:PIpp32sc;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_32sc_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsAdd(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsAdd_8u16u(pSrc1,pSrc2,pDst,len);
end;
function ippsMul(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsMul_8u16u(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsAdd_16s(pSrc1,pSrc2,pDst,len);
end;
function ippsSub(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsSub_16s(pSrc1,pSrc2,pDst,len);
end;
function ippsMul(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsMul_16s(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp16u;pSrc2:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsAdd_16u(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp32u;pSrc2:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsAdd_32u(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsAdd_16s32f(pSrc1,pSrc2,pDst,len);
end;
function ippsSub(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSub_16s32f(pSrc1,pSrc2,pDst,len);
end;
function ippsMul(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMul_16s32f(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsAdd_32f(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsAdd_32fc(pSrc1,pSrc2,pDst,len);
end;
function ippsSub(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSub_32f(pSrc1,pSrc2,pDst,len);
end;
function ippsSub(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSub_32fc(pSrc1,pSrc2,pDst,len);
end;
function ippsMul(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMul_32f(pSrc1,pSrc2,pDst,len);
end;
function ippsMul(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsMul_32fc(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsAdd_64f(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsAdd_64fc(pSrc1,pSrc2,pDst,len);
end;
function ippsSub(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSub_64f(pSrc1,pSrc2,pDst,len);
end;
function ippsSub(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSub_64fc(pSrc1,pSrc2,pDst,len);
end;
function ippsMul(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsMul_64f(pSrc1,pSrc2,pDst,len);
end;
function ippsMul(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsMul_64fc(pSrc1,pSrc2,pDst,len);
end;
function ippsAdd(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_8u_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsSub(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_8u_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsMul(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_8u_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsAdd(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_16s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsAdd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_16sc_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsSub(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_16s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsSub(pSrc1:PIpp16sc;pSrc2:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_16sc_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsMul(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_16s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsMul(pSrc1:PIpp16sc;pSrc2:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_16sc_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsMul(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_16s32s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsAdd(pSrc1:PIpp32s;pSrc2:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_32s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsAdd(pSrc1:PIpp32sc;pSrc2:PIpp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAdd_32sc_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsSub(pSrc1:PIpp32s;pSrc2:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_32s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsSub(pSrc1:PIpp32sc;pSrc2:PIpp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSub_32sc_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsMul(pSrc1:PIpp32s;pSrc2:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_32s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsMul(pSrc1:PIpp32sc;pSrc2:PIpp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_32sc_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsMul(pSrc1:PIpp16u;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_16u16s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsMul(pSrc:PIpp32s;pSrcDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_32s32sc_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsMul(pSrc1:PIpp32s;pSrc2:PIpp32sc;pDst:PIpp32sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMul_32s32sc_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsAddProduct(pSrc1:PIpp16s;pSrc2:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddProduct_16s_Sfs(pSrc1,pSrc2,pSrcDst,len,scaleFactor);
end;
function ippsAddProduct(pSrc1:PIpp16s;pSrc2:PIpp16s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddProduct_16s32s_Sfs(pSrc1,pSrc2,pSrcDst,len,scaleFactor);
end;
function ippsAddProduct(pSrc1:PIpp32s;pSrc2:PIpp32s;pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAddProduct_32s_Sfs(pSrc1,pSrc2,pSrcDst,len,scaleFactor);
end;
function ippsAddProduct(pSrc1:PIpp32f;pSrc2:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsAddProduct_32f(pSrc1,pSrc2,pSrcDst,len);
end;
function ippsAddProduct(pSrc1:PIpp64f;pSrc2:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsAddProduct_64f(pSrc1,pSrc2,pSrcDst,len);
end;
function ippsAddProduct(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsAddProduct_32fc(pSrc1,pSrc2,pSrcDst,len);
end;
function ippsAddProduct(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsAddProduct_64fc(pSrc1,pSrc2,pSrcDst,len);
end;
function ippsSqr(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSqr_32f_I(pSrcDst,len);
end;
function ippsSqr(pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSqr_32fc_I(pSrcDst,len);
end;
function ippsSqr(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSqr_64f_I(pSrcDst,len);
end;
function ippsSqr(pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSqr_64fc_I(pSrcDst,len);
end;
function ippsSqr(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSqr_32f(pSrc,pDst,len);
end;
function ippsSqr(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSqr_32fc(pSrc,pDst,len);
end;
function ippsSqr(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSqr_64f(pSrc,pDst,len);
end;
function ippsSqr(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSqr_64fc(pSrc,pDst,len);
end;
function ippsSqr(pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqr_16s_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqr(pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqr_16sc_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqr(pSrc:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqr_16s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsSqr(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqr_16sc_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsSqr(pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqr_8u_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqr(pSrc:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqr_8u_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsSqr(pSrcDst:PIpp16u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqr_16u_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqr(pSrc:PIpp16u;pDst:PIpp16u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqr_16u_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsDiv(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsDiv_32f(pSrc1,pSrc2,pDst,len);
end;
function ippsDiv(pSrc1:PIpp32fc;pSrc2:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsDiv_32fc(pSrc1,pSrc2,pDst,len);
end;
function ippsDiv(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsDiv_64f(pSrc1,pSrc2,pDst,len);
end;
function ippsDiv(pSrc1:PIpp64fc;pSrc2:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsDiv_64fc(pSrc1,pSrc2,pDst,len);
end;
function ippsDiv(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDiv_16s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsDiv(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDiv_8u_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsDiv(pSrc1:PIpp16sc;pSrc2:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDiv_16sc_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsDivC(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsDivC_32f(pSrc,val,pDst,len);
end;
function ippsDivC(pSrc:PIpp32fc;val:Ipp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsDivC_32fc(pSrc,val,pDst,len);
end;
function ippsDivC(pSrc:PIpp64f;val:Ipp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsDivC_64f(pSrc,val,pDst,len);
end;
function ippsDivC(pSrc:PIpp64fc;val:Ipp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsDivC_64fc(pSrc,val,pDst,len);
end;
function ippsDivC(pSrc:PIpp16s;val:Ipp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDivC_16s_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsDivC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDivC_8u_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsDivC(pSrc:PIpp16sc;val:Ipp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDivC_16sc_Sfs(pSrc,val,pDst,len,scaleFactor);
end;
function ippsDiv(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsDiv_32f_I(pSrc,pSrcDst,len);
end;
function ippsDiv(pSrc:PIpp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsDiv_32fc_I(pSrc,pSrcDst,len);
end;
function ippsDiv(pSrc:PIpp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsDiv_64f_I(pSrc,pSrcDst,len);
end;
function ippsDiv(pSrc:PIpp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsDiv_64fc_I(pSrc,pSrcDst,len);
end;
function ippsDiv(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDiv_16s_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsDiv(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDiv_8u_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsDiv(pSrc:PIpp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDiv_16sc_ISfs(pSrc,pSrcDst,len,scaleFactor);
end;
function ippsDiv(pSrc1:PIpp32s;pSrc2:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDiv_32s_Sfs(pSrc1,pSrc2,pDst,len,scaleFactor);
end;
function ippsDiv(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint;ScaleFactor:longint):IppStatus;
begin
result:=ippsDiv_32s_ISfs(pSrc,pSrcDst,len,ScaleFactor);
end;
function ippsDivC(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsDivC_32f_I(val,pSrcDst,len);
end;
function ippsDivC(val:Ipp32fc;pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsDivC_32fc_I(val,pSrcDst,len);
end;
function ippsDivC(val:Ipp64f;pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsDivC_64f_I(val,pSrcDst,len);
end;
function ippsDivC(val:Ipp64fc;pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsDivC_64fc_I(val,pSrcDst,len);
end;
function ippsDivC(val:Ipp16s;pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDivC_16s_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsDivC(val:Ipp8u;pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDivC_8u_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsDivC(val:Ipp16sc;pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsDivC_16sc_ISfs(val,pSrcDst,len,scaleFactor);
end;
function ippsDivCRev(pSrc:PIpp16u;val:Ipp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsDivCRev_16u(pSrc,val,pDst,len);
end;
function ippsDivCRev(pSrc:PIpp32f;val:Ipp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsDivCRev_32f(pSrc,val,pDst,len);
end;
function ippsDivCRev(val:Ipp16u;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsDivCRev_16u_I(val,pSrcDst,len);
end;
function ippsDivCRev(val:Ipp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsDivCRev_32f_I(val,pSrcDst,len);
end;
function ippsSqrt(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSqrt_32f_I(pSrcDst,len);
end;
function ippsSqrt(pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSqrt_32fc_I(pSrcDst,len);
end;
function ippsSqrt(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSqrt_64f_I(pSrcDst,len);
end;
function ippsSqrt(pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSqrt_64fc_I(pSrcDst,len);
end;
function ippsSqrt(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSqrt_32f(pSrc,pDst,len);
end;
function ippsSqrt(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsSqrt_32fc(pSrc,pDst,len);
end;
function ippsSqrt(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSqrt_64f(pSrc,pDst,len);
end;
function ippsSqrt(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsSqrt_64fc(pSrc,pDst,len);
end;
function ippsSqrt(pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_16s_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqrt(pSrcDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_16sc_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqrt(pSrc:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_16s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsSqrt(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_16sc_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsSqrt(pSrcDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_64s_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqrt(pSrc:PIpp64s;pDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_64s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsSqrt(pSrcDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_8u_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqrt(pSrc:PIpp8u;pDst:PIpp8u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_8u_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsSqrt(pSrcDst:PIpp16u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_16u_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsSqrt(pSrc:PIpp16u;pDst:PIpp16u;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsSqrt_16u_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsCubrt(pSrc:PIpp32s;pDst:PIpp16s;Len:longint;sFactor:longint):IppStatus;
begin
result:=ippsCubrt_32s16s_Sfs(pSrc,pDst,Len,sFactor);
end;
function ippsCubrt(pSrc:PIpp32f;pDst:PIpp32f;Len:longint):IppStatus;
begin
result:=ippsCubrt_32f(pSrc,pDst,Len);
end;
function ippsAbs(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsAbs_32f_I(pSrcDst,len);
end;
function ippsAbs(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsAbs_64f_I(pSrcDst,len);
end;
function ippsAbs(pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsAbs_16s_I(pSrcDst,len);
end;
function ippsAbs(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsAbs_32f(pSrc,pDst,len);
end;
function ippsAbs(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsAbs_64f(pSrc,pDst,len);
end;
function ippsAbs(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsAbs_16s(pSrc,pDst,len);
end;
function ippsAbs(pSrcDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsAbs_32s_I(pSrcDst,len);
end;
function ippsAbs(pSrc:PIpp32s;pDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsAbs_32s(pSrc,pDst,len);
end;
function ippsMagnitude(pSrc:PIpp32fc;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMagnitude_32fc(pSrc,pDst,len);
end;
function ippsMagnitude(pSrc:PIpp64fc;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsMagnitude_64fc(pSrc,pDst,len);
end;
function ippsMagnitude(pSrc:PIpp16sc;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMagnitude_16sc32f(pSrc,pDst,len);
end;
function ippsMagnitude(pSrc:PIpp16sc;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMagnitude_16sc_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsMagnitude(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMagnitude_32f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsMagnitude(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsMagnitude_64f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsMagnitude(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMagnitude_16s_Sfs(pSrcRe,pSrcIm,pDst,len,scaleFactor);
end;
function ippsMagnitude(pSrc:PIpp32sc;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMagnitude_32sc_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsMagnitude(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMagnitude_16s32f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsMagSquared(pSrc:PIpp32sc;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMagSquared_32sc32s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsExp(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsExp_32f_I(pSrcDst,len);
end;
function ippsExp(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsExp_64f_I(pSrcDst,len);
end;
function ippsExp(pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsExp_16s_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsExp(pSrcDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsExp_32s_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsExp(pSrcDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsExp_64s_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsExp(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsExp_32f(pSrc,pDst,len);
end;
function ippsExp(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsExp_64f(pSrc,pDst,len);
end;
function ippsExp(pSrc:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsExp_16s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsExp(pSrc:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsExp_32s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsExp(pSrc:PIpp64s;pDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsExp_64s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsExp(pSrc:PIpp32f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsExp_32f64f(pSrc,pDst,len);
end;
function ippsLn(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsLn_32f_I(pSrcDst,len);
end;
function ippsLn(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsLn_64f_I(pSrcDst,len);
end;
function ippsLn(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsLn_32f(pSrc,pDst,len);
end;
function ippsLn(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsLn_64f(pSrc,pDst,len);
end;
function ippsLn(pSrc:PIpp64f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsLn_64f32f(pSrc,pDst,len);
end;
function ippsLn(pSrcDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsLn_16s_ISfs(pSrcDst,len,scaleFactor);
end;
function ippsLn(pSrc:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsLn_16s_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsLn(pSrc:PIpp32s;pDst:PIpp16s;Len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsLn_32s16s_Sfs(pSrc,pDst,Len,scaleFactor);
end;
function ippsLn(pSrcDst:PIpp32s;Len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsLn_32s_ISfs(pSrcDst,Len,scaleFactor);
end;
function ippsLn(pSrc:PIpp32s;pDst:PIpp32s;Len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsLn_32s_Sfs(pSrc,pDst,Len,scaleFactor);
end;
function ipps10Log10(pSrcDst:PIpp32s;Len:longint;scaleFactor:longint):IppStatus;
begin
result:=ipps10Log10_32s_ISfs(pSrcDst,Len,scaleFactor);
end;
function ipps10Log10(pSrc:PIpp32s;pDst:PIpp32s;Len:longint;scaleFactor:longint):IppStatus;
begin
result:=ipps10Log10_32s_Sfs(pSrc,pDst,Len,scaleFactor);
end;
function ippsSumLn(pSrc:PIpp32f;len:longint;pSum:PIpp32f):IppStatus;
begin
result:=ippsSumLn_32f(pSrc,len,pSum);
end;
function ippsSumLn(pSrc:PIpp64f;len:longint;pSum:PIpp64f):IppStatus;
begin
result:=ippsSumLn_64f(pSrc,len,pSum);
end;
function ippsSumLn(pSrc:PIpp32f;len:longint;pSum:PIpp64f):IppStatus;
begin
result:=ippsSumLn_32f64f(pSrc,len,pSum);
end;
function ippsSumLn(pSrc:PIpp16s;len:longint;pSum:PIpp32f):IppStatus;
begin
result:=ippsSumLn_16s32f(pSrc,len,pSum);
end;
function ippsSortAscend(pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsSortAscend_8u_I(pSrcDst,len);
end;
function ippsSortAscend(pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsSortAscend_16s_I(pSrcDst,len);
end;
function ippsSortAscend(pSrcDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsSortAscend_32s_I(pSrcDst,len);
end;
function ippsSortAscend(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSortAscend_32f_I(pSrcDst,len);
end;
function ippsSortAscend(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSortAscend_64f_I(pSrcDst,len);
end;
function ippsSortDescend(pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsSortDescend_8u_I(pSrcDst,len);
end;
function ippsSortDescend(pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsSortDescend_16s_I(pSrcDst,len);
end;
function ippsSortDescend(pSrcDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsSortDescend_32s_I(pSrcDst,len);
end;
function ippsSortDescend(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsSortDescend_32f_I(pSrcDst,len);
end;
function ippsSortDescend(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsSortDescend_64f_I(pSrcDst,len);
end;
function ippsSum(pSrc:PIpp32f;len:longint;pSum:PIpp32f;Const hint:IppHintAlgorithm=ippAlgHintNone):IppStatus;
begin
result:=ippsSum_32f(pSrc,len,pSum,hint);
end;
function ippsSum(pSrc:PIpp64f;len:longint;pSum:PIpp64f):IppStatus;
begin
result:=ippsSum_64f(pSrc,len,pSum);
end;
function ippsSum(pSrc:PIpp32fc;len:longint;pSum:PIpp32fc; Const hint:IppHintAlgorithm=ippAlgHintNone):IppStatus;
begin
result:=ippsSum_32fc(pSrc,len,pSum,hint);
end;
function ippsSum(pSrc:PIpp16s;len:longint;pSum:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsSum_16s32s_Sfs(pSrc,len,pSum,scaleFactor);
end;
function ippsSum(pSrc:PIpp16sc;len:longint;pSum:PIpp32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsSum_16sc32sc_Sfs(pSrc,len,pSum,scaleFactor);
end;
function ippsSum(pSrc:PIpp16s;len:longint;pSum:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsSum_16s_Sfs(pSrc,len,pSum,scaleFactor);
end;
function ippsSum(pSrc:PIpp16sc;len:longint;pSum:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsSum_16sc_Sfs(pSrc,len,pSum,scaleFactor);
end;
function ippsSum(pSrc:PIpp32s;len:longint;pSum:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsSum_32s_Sfs(pSrc,len,pSum,scaleFactor);
end;
function ippsSum(pSrc:PIpp64fc;len:longint;pSum:PIpp64fc):IppStatus;
begin
result:=ippsSum_64fc(pSrc,len,pSum);
end;
function ippsMean(pSrc:PIpp32f;len:longint;pMean:PIpp32f;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsMean_32f(pSrc,len,pMean,hint);
end;
function ippsMean(pSrc:PIpp32fc;len:longint;pMean:PIpp32fc;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsMean_32fc(pSrc,len,pMean,hint);
end;
function ippsMean(pSrc:PIpp64f;len:longint;pMean:PIpp64f):IppStatus;
begin
result:=ippsMean_64f(pSrc,len,pMean);
end;
function ippsMean(pSrc:PIpp16s;len:longint;pMean:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsMean_16s_Sfs(pSrc,len,pMean,scaleFactor);
end;
function ippsMean(pSrc:PIpp16sc;len:longint;pMean:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsMean_16sc_Sfs(pSrc,len,pMean,scaleFactor);
end;
function ippsMean(pSrc:PIpp64fc;len:longint;pMean:PIpp64fc):IppStatus;
begin
result:=ippsMean_64fc(pSrc,len,pMean);
end;
function ippsStdDev(pSrc:PIpp32f;len:longint;pStdDev:PIpp32f;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsStdDev_32f(pSrc,len,pStdDev,hint);
end;
function ippsStdDev(pSrc:PIpp64f;len:longint;pStdDev:PIpp64f):IppStatus;
begin
result:=ippsStdDev_64f(pSrc,len,pStdDev);
end;
function ippsStdDev(pSrc:PIpp16s;len:longint;pStdDev:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsStdDev_16s32s_Sfs(pSrc,len,pStdDev,scaleFactor);
end;
function ippsStdDev(pSrc:PIpp16s;len:longint;pStdDev:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsStdDev_16s_Sfs(pSrc,len,pStdDev,scaleFactor);
end;
function ippsMax(pSrc:PIpp32f;len:longint;pMax:PIpp32f):IppStatus;
begin
result:=ippsMax_32f(pSrc,len,pMax);
end;
function ippsMax(pSrc:PIpp64f;len:longint;pMax:PIpp64f):IppStatus;
begin
result:=ippsMax_64f(pSrc,len,pMax);
end;
function ippsMax(pSrc:PIpp16s;len:longint;pMax:PIpp16s):IppStatus;
begin
result:=ippsMax_16s(pSrc,len,pMax);
end;
function ippsMaxIndx(pSrc:PIpp16s;len:longint;pMax:PIpp16s;pIndx:Plongint):IppStatus;
begin
result:=ippsMaxIndx_16s(pSrc,len,pMax,pIndx);
end;
function ippsMaxIndx(pSrc:PIpp32f;len:longint;pMax:PIpp32f;pIndx:Plongint):IppStatus;
begin
result:=ippsMaxIndx_32f(pSrc,len,pMax,pIndx);
end;
function ippsMaxIndx(pSrc:PIpp64f;len:longint;pMax:PIpp64f;pIndx:Plongint):IppStatus;
begin
result:=ippsMaxIndx_64f(pSrc,len,pMax,pIndx);
end;
function ippsMin(pSrc:PIpp32f;len:longint;pMin:PIpp32f):IppStatus;
begin
result:=ippsMin_32f(pSrc,len,pMin);
end;
function ippsMin(pSrc:PIpp64f;len:longint;pMin:PIpp64f):IppStatus;
begin
result:=ippsMin_64f(pSrc,len,pMin);
end;
function ippsMin(pSrc:PIpp16s;len:longint;pMin:PIpp16s):IppStatus;
begin
result:=ippsMin_16s(pSrc,len,pMin);
end;
function ippsMinIndx(pSrc:PIpp16s;len:longint;pMin:PIpp16s;pIndx:Plongint):IppStatus;
begin
result:=ippsMinIndx_16s(pSrc,len,pMin,pIndx);
end;
function ippsMinIndx(pSrc:PIpp32f;len:longint;pMin:PIpp32f;pIndx:Plongint):IppStatus;
begin
result:=ippsMinIndx_32f(pSrc,len,pMin,pIndx);
end;
function ippsMinIndx(pSrc:PIpp64f;len:longint;pMin:PIpp64f;pIndx:Plongint):IppStatus;
begin
result:=ippsMinIndx_64f(pSrc,len,pMin,pIndx);
end;
function ippsMinEvery(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsMinEvery_16s_I(pSrc,pSrcDst,len);
end;
function ippsMinEvery(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsMinEvery_32s_I(pSrc,pSrcDst,len);
end;
function ippsMinEvery(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMinEvery_32f_I(pSrc,pSrcDst,len);
end;
function ippsMaxEvery(pSrc:PIpp16s;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsMaxEvery_16s_I(pSrc,pSrcDst,len);
end;
function ippsMaxEvery(pSrc:PIpp32s;pSrcDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsMaxEvery_32s_I(pSrc,pSrcDst,len);
end;
function ippsMaxEvery(pSrc:PIpp32f;pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsMaxEvery_32f_I(pSrc,pSrcDst,len);
end;
function ippsMinMax(pSrc:PIpp64f;len:longint;pMin:PIpp64f;pMax:PIpp64f):IppStatus;
begin
result:=ippsMinMax_64f(pSrc,len,pMin,pMax);
end;
function ippsMinMax(pSrc:PIpp32f;len:longint;pMin:PIpp32f;pMax:PIpp32f):IppStatus;
begin
result:=ippsMinMax_32f(pSrc,len,pMin,pMax);
end;
function ippsMinMax(pSrc:PIpp32s;len:longint;pMin:PIpp32s;pMax:PIpp32s):IppStatus;
begin
result:=ippsMinMax_32s(pSrc,len,pMin,pMax);
end;
function ippsMinMax(pSrc:PIpp32u;len:longint;pMin:PIpp32u;pMax:PIpp32u):IppStatus;
begin
result:=ippsMinMax_32u(pSrc,len,pMin,pMax);
end;
function ippsMinMax(pSrc:PIpp16s;len:longint;pMin:PIpp16s;pMax:PIpp16s):IppStatus;
begin
result:=ippsMinMax_16s(pSrc,len,pMin,pMax);
end;
function ippsMinMax(pSrc:PIpp16u;len:longint;pMin:PIpp16u;pMax:PIpp16u):IppStatus;
begin
result:=ippsMinMax_16u(pSrc,len,pMin,pMax);
end;
function ippsMinMax(pSrc:PIpp8u;len:longint;pMin:PIpp8u;pMax:PIpp8u):IppStatus;
begin
result:=ippsMinMax_8u(pSrc,len,pMin,pMax);
end;
function ippsMinMaxIndx(pSrc:PIpp64f;len:longint;pMin:PIpp64f;pMinIndx:Plongint;pMax:PIpp64f;pMaxIndx:Plongint):IppStatus;
begin
result:=ippsMinMaxIndx_64f(pSrc,len,pMin,pMinIndx,pMax,pMaxIndx);
end;
function ippsMinMaxIndx(pSrc:PIpp32f;len:longint;pMin:PIpp32f;pMinIndx:Plongint;pMax:PIpp32f;pMaxIndx:Plongint):IppStatus;
begin
result:=ippsMinMaxIndx_32f(pSrc,len,pMin,pMinIndx,pMax,pMaxIndx);
end;
function ippsMinMaxIndx(pSrc:PIpp32s;len:longint;pMin:PIpp32s;pMinIndx:Plongint;pMax:PIpp32s;pMaxIndx:Plongint):IppStatus;
begin
result:=ippsMinMaxIndx_32s(pSrc,len,pMin,pMinIndx,pMax,pMaxIndx);
end;
function ippsMinMaxIndx(pSrc:PIpp32u;len:longint;pMin:PIpp32u;pMinIndx:Plongint;pMax:PIpp32u;pMaxIndx:Plongint):IppStatus;
begin
result:=ippsMinMaxIndx_32u(pSrc,len,pMin,pMinIndx,pMax,pMaxIndx);
end;
function ippsMinMaxIndx(pSrc:PIpp16s;len:longint;pMin:PIpp16s;pMinIndx:Plongint;pMax:PIpp16s;pMaxIndx:Plongint):IppStatus;
begin
result:=ippsMinMaxIndx_16s(pSrc,len,pMin,pMinIndx,pMax,pMaxIndx);
end;
function ippsMinMaxIndx(pSrc:PIpp16u;len:longint;pMin:PIpp16u;pMinIndx:Plongint;pMax:PIpp16u;pMaxIndx:Plongint):IppStatus;
begin
result:=ippsMinMaxIndx_16u(pSrc,len,pMin,pMinIndx,pMax,pMaxIndx);
end;
function ippsMinMaxIndx(pSrc:PIpp8u;len:longint;pMin:PIpp8u;pMinIndx:Plongint;pMax:PIpp8u;pMaxIndx:Plongint):IppStatus;
begin
result:=ippsMinMaxIndx_8u(pSrc,len,pMin,pMinIndx,pMax,pMaxIndx);
end;
function ippsPhase(pSrc:PIpp64fc;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsPhase_64fc(pSrc,pDst,len);
end;
function ippsPhase(pSrc:PIpp32fc;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPhase_32fc(pSrc,pDst,len);
end;
function ippsPhase(pSrc:PIpp16sc;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPhase_16sc32f(pSrc,pDst,len);
end;
function ippsPhase(pSrc:PIpp16sc;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsPhase_16sc_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsPhase(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsPhase_64f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsPhase(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPhase_32f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsPhase(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsPhase_16s_Sfs(pSrcRe,pSrcIm,pDst,len,scaleFactor);
end;
function ippsPhase(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPhase_16s32f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsPhase(pSrc:PIpp32sc;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsPhase_32sc_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsMaxOrder(pSrc:PIpp64f;len:longint;pOrder:Plongint):IppStatus;
begin
result:=ippsMaxOrder_64f(pSrc,len,pOrder);
end;
function ippsMaxOrder(pSrc:PIpp32f;len:longint;pOrder:Plongint):IppStatus;
begin
result:=ippsMaxOrder_32f(pSrc,len,pOrder);
end;
function ippsMaxOrder(pSrc:PIpp32s;len:longint;pOrder:Plongint):IppStatus;
begin
result:=ippsMaxOrder_32s(pSrc,len,pOrder);
end;
function ippsMaxOrder(pSrc:PIpp16s;len:longint;pOrder:Plongint):IppStatus;
begin
result:=ippsMaxOrder_16s(pSrc,len,pOrder);
end;
function ippsArctan(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsArctan_32f_I(pSrcDst,len);
end;
function ippsArctan(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsArctan_32f(pSrc,pDst,len);
end;
function ippsArctan(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsArctan_64f_I(pSrcDst,len);
end;
function ippsArctan(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsArctan_64f(pSrc,pDst,len);
end;
function ippsFindNearestOne(inpVal:Ipp16u;pOutVal:PIpp16u;pOutIndex:Plongint;pTable:PIpp16u;tblLen:longint):IppStatus;
begin
result:=ippsFindNearestOne_16u(inpVal,pOutVal,pOutIndex,pTable,tblLen);
end;
function ippsFindNearest(pVals:PIpp16u;pOutVals:PIpp16u;pOutIndexes:Plongint;len:longint;pTable:PIpp16u;tblLen:longint):IppStatus;
begin
result:=ippsFindNearest_16u(pVals,pOutVals,pOutIndexes,len,pTable,tblLen);
end;
function ippsAndC(val:Ipp8u;pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsAndC_8u_I(val,pSrcDst,len);
end;
function ippsAndC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsAndC_8u(pSrc,val,pDst,len);
end;
function ippsAndC(val:Ipp16u;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsAndC_16u_I(val,pSrcDst,len);
end;
function ippsAndC(pSrc:PIpp16u;val:Ipp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsAndC_16u(pSrc,val,pDst,len);
end;
function ippsAndC(val:Ipp32u;pSrcDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsAndC_32u_I(val,pSrcDst,len);
end;
function ippsAndC(pSrc:PIpp32u;val:Ipp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsAndC_32u(pSrc,val,pDst,len);
end;
function ippsAnd(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsAnd_8u_I(pSrc,pSrcDst,len);
end;
function ippsAnd(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsAnd_8u(pSrc1,pSrc2,pDst,len);
end;
function ippsAnd(pSrc:PIpp16u;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsAnd_16u_I(pSrc,pSrcDst,len);
end;
function ippsAnd(pSrc1:PIpp16u;pSrc2:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsAnd_16u(pSrc1,pSrc2,pDst,len);
end;
function ippsAnd(pSrc:PIpp32u;pSrcDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsAnd_32u_I(pSrc,pSrcDst,len);
end;
function ippsAnd(pSrc1:PIpp32u;pSrc2:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsAnd_32u(pSrc1,pSrc2,pDst,len);
end;
function ippsOrC(val:Ipp8u;pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsOrC_8u_I(val,pSrcDst,len);
end;
function ippsOrC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsOrC_8u(pSrc,val,pDst,len);
end;
function ippsOrC(val:Ipp16u;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsOrC_16u_I(val,pSrcDst,len);
end;
function ippsOrC(pSrc:PIpp16u;val:Ipp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsOrC_16u(pSrc,val,pDst,len);
end;
function ippsOrC(val:Ipp32u;pSrcDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsOrC_32u_I(val,pSrcDst,len);
end;
function ippsOrC(pSrc:PIpp32u;val:Ipp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsOrC_32u(pSrc,val,pDst,len);
end;
function ippsOr(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsOr_8u_I(pSrc,pSrcDst,len);
end;
function ippsOr(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsOr_8u(pSrc1,pSrc2,pDst,len);
end;
function ippsOr(pSrc:PIpp16u;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsOr_16u_I(pSrc,pSrcDst,len);
end;
function ippsOr(pSrc1:PIpp16u;pSrc2:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsOr_16u(pSrc1,pSrc2,pDst,len);
end;
function ippsOr(pSrc:PIpp32u;pSrcDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsOr_32u_I(pSrc,pSrcDst,len);
end;
function ippsOr(pSrc1:PIpp32u;pSrc2:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsOr_32u(pSrc1,pSrc2,pDst,len);
end;
function ippsXorC(val:Ipp8u;pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsXorC_8u_I(val,pSrcDst,len);
end;
function ippsXorC(pSrc:PIpp8u;val:Ipp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsXorC_8u(pSrc,val,pDst,len);
end;
function ippsXorC(val:Ipp16u;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsXorC_16u_I(val,pSrcDst,len);
end;
function ippsXorC(pSrc:PIpp16u;val:Ipp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsXorC_16u(pSrc,val,pDst,len);
end;
function ippsXorC(val:Ipp32u;pSrcDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsXorC_32u_I(val,pSrcDst,len);
end;
function ippsXorC(pSrc:PIpp32u;val:Ipp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsXorC_32u(pSrc,val,pDst,len);
end;
function ippsXor(pSrc:PIpp8u;pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsXor_8u_I(pSrc,pSrcDst,len);
end;
function ippsXor(pSrc1:PIpp8u;pSrc2:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsXor_8u(pSrc1,pSrc2,pDst,len);
end;
function ippsXor(pSrc:PIpp16u;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsXor_16u_I(pSrc,pSrcDst,len);
end;
function ippsXor(pSrc1:PIpp16u;pSrc2:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsXor_16u(pSrc1,pSrc2,pDst,len);
end;
function ippsXor(pSrc:PIpp32u;pSrcDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsXor_32u_I(pSrc,pSrcDst,len);
end;
function ippsXor(pSrc1:PIpp32u;pSrc2:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsXor_32u(pSrc1,pSrc2,pDst,len);
end;
function ippsNot(pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsNot_8u_I(pSrcDst,len);
end;
function ippsNot(pSrc:PIpp8u;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsNot_8u(pSrc,pDst,len);
end;
function ippsNot(pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsNot_16u_I(pSrcDst,len);
end;
function ippsNot(pSrc:PIpp16u;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsNot_16u(pSrc,pDst,len);
end;
function ippsNot(pSrcDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsNot_32u_I(pSrcDst,len);
end;
function ippsNot(pSrc:PIpp32u;pDst:PIpp32u;len:longint):IppStatus;
begin
result:=ippsNot_32u(pSrc,pDst,len);
end;
function ippsLShiftC(val:longint;pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsLShiftC_8u_I(val,pSrcDst,len);
end;
function ippsLShiftC(pSrc:PIpp8u;val:longint;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsLShiftC_8u(pSrc,val,pDst,len);
end;
function ippsLShiftC(val:longint;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsLShiftC_16u_I(val,pSrcDst,len);
end;
function ippsLShiftC(pSrc:PIpp16u;val:longint;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsLShiftC_16u(pSrc,val,pDst,len);
end;
function ippsLShiftC(val:longint;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsLShiftC_16s_I(val,pSrcDst,len);
end;
function ippsLShiftC(pSrc:PIpp16s;val:longint;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsLShiftC_16s(pSrc,val,pDst,len);
end;
function ippsLShiftC(val:longint;pSrcDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsLShiftC_32s_I(val,pSrcDst,len);
end;
function ippsLShiftC(pSrc:PIpp32s;val:longint;pDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsLShiftC_32s(pSrc,val,pDst,len);
end;
function ippsRShiftC(val:longint;pSrcDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsRShiftC_8u_I(val,pSrcDst,len);
end;
function ippsRShiftC(pSrc:PIpp8u;val:longint;pDst:PIpp8u;len:longint):IppStatus;
begin
result:=ippsRShiftC_8u(pSrc,val,pDst,len);
end;
function ippsRShiftC(val:longint;pSrcDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsRShiftC_16u_I(val,pSrcDst,len);
end;
function ippsRShiftC(pSrc:PIpp16u;val:longint;pDst:PIpp16u;len:longint):IppStatus;
begin
result:=ippsRShiftC_16u(pSrc,val,pDst,len);
end;
function ippsRShiftC(val:longint;pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsRShiftC_16s_I(val,pSrcDst,len);
end;
function ippsRShiftC(pSrc:PIpp16s;val:longint;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsRShiftC_16s(pSrc,val,pDst,len);
end;
function ippsRShiftC(val:longint;pSrcDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsRShiftC_32s_I(val,pSrcDst,len);
end;
function ippsRShiftC(pSrc:PIpp32s;val:longint;pDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsRShiftC_32s(pSrc,val,pDst,len);
end;
function ippsDotProd(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pDp:PIpp32f):IppStatus;
begin
result:=ippsDotProd_32f(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pDp:PIpp32fc):IppStatus;
begin
result:=ippsDotProd_32fc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp32f;pSrc2:PIpp32fc;len:longint;pDp:PIpp32fc):IppStatus;
begin
result:=ippsDotProd_32f32fc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp64f;pSrc2:PIpp64f;len:longint;pDp:PIpp64f):IppStatus;
begin
result:=ippsDotProd_64f(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp64fc;pSrc2:PIpp64fc;len:longint;pDp:PIpp64fc):IppStatus;
begin
result:=ippsDotProd_64fc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp64f;pSrc2:PIpp64fc;len:longint;pDp:PIpp64fc):IppStatus;
begin
result:=ippsDotProd_64f64fc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pDp:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_16s_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;len:longint;pDp:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_16sc_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16sc;len:longint;pDp:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_16s16sc_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pDp:PIpp64s):IppStatus;
begin
result:=ippsDotProd_16s64s(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;len:longint;pDp:PIpp64sc):IppStatus;
begin
result:=ippsDotProd_16sc64sc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16sc;len:longint;pDp:PIpp64sc):IppStatus;
begin
result:=ippsDotProd_16s16sc64sc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pDp:PIpp32f):IppStatus;
begin
result:=ippsDotProd_16s32f(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;len:longint;pDp:PIpp32fc):IppStatus;
begin
result:=ippsDotProd_16sc32fc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16sc;len:longint;pDp:PIpp32fc):IppStatus;
begin
result:=ippsDotProd_16s16sc32fc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pDp:PIpp64f):IppStatus;
begin
result:=ippsDotProd_32f64f(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pDp:PIpp64fc):IppStatus;
begin
result:=ippsDotProd_32fc64fc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp32f;pSrc2:PIpp32fc;len:longint;pDp:PIpp64fc):IppStatus;
begin
result:=ippsDotProd_32f32fc64fc(pSrc1,pSrc2,len,pDp);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pDp:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_16s32s_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp16sc;pSrc2:PIpp16sc;len:longint;pDp:PIpp32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_16sc32sc_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp16sc;len:longint;pDp:PIpp32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_16s16sc32sc_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp32s;pSrc2:PIpp32s;len:longint;pDp:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_32s_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp32sc;pSrc2:PIpp32sc;len:longint;pDp:PIpp32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_32sc_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp32s;pSrc2:PIpp32sc;len:longint;pDp:PIpp32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_32s32sc_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsDotProd(pSrc1:PIpp16s;pSrc2:PIpp32s;len:longint;pDp:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsDotProd_16s32s32s_Sfs(pSrc1,pSrc2,len,pDp,scaleFactor);
end;
function ippsPowerSpectr(pSrc:PIpp64fc;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsPowerSpectr_64fc(pSrc,pDst,len);
end;
function ippsPowerSpectr(pSrc:PIpp32fc;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPowerSpectr_32fc(pSrc,pDst,len);
end;
function ippsPowerSpectr(pSrc:PIpp16sc;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsPowerSpectr_16sc_Sfs(pSrc,pDst,len,scaleFactor);
end;
function ippsPowerSpectr(pSrc:PIpp16sc;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPowerSpectr_16sc32f(pSrc,pDst,len);
end;
function ippsPowerSpectr(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsPowerSpectr_64f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsPowerSpectr(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPowerSpectr_32f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsPowerSpectr(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsPowerSpectr_16s_Sfs(pSrcRe,pSrcIm,pDst,len,scaleFactor);
end;
function ippsPowerSpectr(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsPowerSpectr_16s32f(pSrcRe,pSrcIm,pDst,len);
end;
function ippsNormalize(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;vsub:Ipp64fc;vdiv:Ipp64f):IppStatus;
begin
result:=ippsNormalize_64fc(pSrc,pDst,len,vsub,vdiv);
end;
function ippsNormalize(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;vsub:Ipp32fc;vdiv:Ipp32f):IppStatus;
begin
result:=ippsNormalize_32fc(pSrc,pDst,len,vsub,vdiv);
end;
function ippsNormalize(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;vsub:Ipp16sc;vdiv:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsNormalize_16sc_Sfs(pSrc,pDst,len,vsub,vdiv,scaleFactor);
end;
function ippsNormalize(pSrc:PIpp64f;pDst:PIpp64f;len:longint;vsub:Ipp64f;vdiv:Ipp64f):IppStatus;
begin
result:=ippsNormalize_64f(pSrc,pDst,len,vsub,vdiv);
end;
function ippsNormalize(pSrc:PIpp32f;pDst:PIpp32f;len:longint;vsub:Ipp32f;vdiv:Ipp32f):IppStatus;
begin
result:=ippsNormalize_32f(pSrc,pDst,len,vsub,vdiv);
end;
function ippsNormalize(pSrc:PIpp16s;pDst:PIpp16s;len:longint;vsub:Ipp16s;vdiv:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsNormalize_16s_Sfs(pSrc,pDst,len,vsub,vdiv,scaleFactor);
end;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_16sc;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_C_16sc(pFFTSpec,order,flag,hint);
end;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_16s;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_C_16s(pFFTSpec,order,flag,hint);
end;
function ippsFFTInitAlloc_R(var pFFTSpec:PIppsFFTSpec_R_16s;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_R_16s(pFFTSpec,order,flag,hint);
end;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_32fc;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_C_32fc(pFFTSpec,order,flag,hint);
end;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_32f;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_C_32f(pFFTSpec,order,flag,hint);
end;
function ippsFFTInitAlloc_R(var pFFTSpec:PIppsFFTSpec_R_32f;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_R_32f(pFFTSpec,order,flag,hint);
end;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_64fc;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_C_64fc(pFFTSpec,order,flag,hint);
end;
function ippsFFTInitAlloc_C(var pFFTSpec:PIppsFFTSpec_C_64f;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_C_64f(pFFTSpec,order,flag,hint);
end;
function ippsFFTInitAlloc_R(var pFFTSpec:PIppsFFTSpec_R_64f;order:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsFFTInitAlloc_R_64f(pFFTSpec,order,flag,hint);
end;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_16sc):IppStatus;
begin
result:=ippsFFTFree_C_16sc(pFFTSpec);
end;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_16s):IppStatus;
begin
result:=ippsFFTFree_C_16s(pFFTSpec);
end;
function ippsFFTFree_R(pFFTSpec:PIppsFFTSpec_R_16s):IppStatus;
begin
result:=ippsFFTFree_R_16s(pFFTSpec);
end;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_32fc):IppStatus;
begin
result:=ippsFFTFree_C_32fc(pFFTSpec);
end;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_32f):IppStatus;
begin
result:=ippsFFTFree_C_32f(pFFTSpec);
end;
function ippsFFTFree_R(pFFTSpec:PIppsFFTSpec_R_32f):IppStatus;
begin
result:=ippsFFTFree_R_32f(pFFTSpec);
end;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_64fc):IppStatus;
begin
result:=ippsFFTFree_C_64fc(pFFTSpec);
end;
function ippsFFTFree_C(pFFTSpec:PIppsFFTSpec_C_64f):IppStatus;
begin
result:=ippsFFTFree_C_64f(pFFTSpec);
end;
function ippsFFTFree_R(pFFTSpec:PIppsFFTSpec_R_64f):IppStatus;
begin
result:=ippsFFTFree_R_64f(pFFTSpec);
end;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_16sc;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_C_16sc(pFFTSpec,pSize);
end;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_16s;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_C_16s(pFFTSpec,pSize);
end;
function ippsFFTGetBufSize_R(pFFTSpec:PIppsFFTSpec_R_16s;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_R_16s(pFFTSpec,pSize);
end;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_32fc;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_C_32fc(pFFTSpec,pSize);
end;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_32f;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_C_32f(pFFTSpec,pSize);
end;
function ippsFFTGetBufSize_R(pFFTSpec:PIppsFFTSpec_R_32f;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_R_32f(pFFTSpec,pSize);
end;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_64fc;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_C_64fc(pFFTSpec,pSize);
end;
function ippsFFTGetBufSize_C(pFFTSpec:PIppsFFTSpec_C_64f;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_C_64f(pFFTSpec,pSize);
end;
function ippsFFTGetBufSize_R(pFFTSpec:PIppsFFTSpec_R_64f;pSize:Plongint):IppStatus;
begin
result:=ippsFFTGetBufSize_R_64f(pFFTSpec,pSize);
end;
function ippsFFTFwd_CToC(pSrc:PIpp16sc;pDst:PIpp16sc;pFFTSpec:PIppsFFTSpec_C_16sc;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_CToC_16sc_Sfs(pSrc,pDst,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTInv_CToC(pSrc:PIpp16sc;pDst:PIpp16sc;pFFTSpec:PIppsFFTSpec_C_16sc;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CToC_16sc_Sfs(pSrc,pDst,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTFwd_CToC(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDstRe:PIpp16s;pDstIm:PIpp16s;pFFTSpec:PIppsFFTSpec_C_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_CToC_16s_Sfs(pSrcRe,pSrcIm,pDstRe,pDstIm,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTInv_CToC(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDstRe:PIpp16s;pDstIm:PIpp16s;pFFTSpec:PIppsFFTSpec_C_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CToC_16s_Sfs(pSrcRe,pSrcIm,pDstRe,pDstIm,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTFwd_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pFFTSpec:PIppsFFTSpec_C_32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_CToC_32fc(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTInv_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pFFTSpec:PIppsFFTSpec_C_32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CToC_32fc(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_CToC(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;pFFTSpec:PIppsFFTSpec_C_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_CToC_32f(pSrcRe,pSrcIm,pDstRe,pDstIm,pFFTSpec,pBuffer);
end;
function ippsFFTInv_CToC(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;pFFTSpec:PIppsFFTSpec_C_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CToC_32f(pSrcRe,pSrcIm,pDstRe,pDstIm,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pFFTSpec:PIppsFFTSpec_C_64fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_CToC_64fc(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTInv_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pFFTSpec:PIppsFFTSpec_C_64fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CToC_64fc(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_CToC(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;pFFTSpec:PIppsFFTSpec_C_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_CToC_64f(pSrcRe,pSrcIm,pDstRe,pDstIm,pFFTSpec,pBuffer);
end;
function ippsFFTInv_CToC(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;pFFTSpec:PIppsFFTSpec_C_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CToC_64f(pSrcRe,pSrcIm,pDstRe,pDstIm,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_RToPerm(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToPerm_16s_Sfs(pSrc,pDst,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTFwd_RToPack(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToPack_16s_Sfs(pSrc,pDst,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTFwd_RToCCS(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToCCS_16s_Sfs(pSrc,pDst,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTInv_PermToR(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_PermToR_16s_Sfs(pSrc,pDst,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTInv_PackToR(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_PackToR_16s_Sfs(pSrc,pDst,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTInv_CCSToR(pSrc:PIpp16s;pDst:PIpp16s;pFFTSpec:PIppsFFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CCSToR_16s_Sfs(pSrc,pDst,pFFTSpec,scaleFactor,pBuffer);
end;
function ippsFFTFwd_RToPerm(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToPerm_32f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_RToPack(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToPack_32f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_RToCCS(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToCCS_32f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTInv_PermToR(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_PermToR_32f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTInv_PackToR(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_PackToR_32f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTInv_CCSToR(pSrc:PIpp32f;pDst:PIpp32f;pFFTSpec:PIppsFFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CCSToR_32f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_RToPerm(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToPerm_64f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_RToPack(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToPack_64f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTFwd_RToCCS(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTFwd_RToCCS_64f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTInv_PermToR(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_PermToR_64f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTInv_PackToR(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_PackToR_64f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsFFTInv_CCSToR(pSrc:PIpp64f;pDst:PIpp64f;pFFTSpec:PIppsFFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFFTInv_CCSToR_64f(pSrc,pDst,pFFTSpec,pBuffer);
end;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_16sc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_C_16sc(pDFTSpec,length,flag,hint);
end;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_16s;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_C_16s(pDFTSpec,length,flag,hint);
end;
function ippsDFTInitAlloc_R(var pDFTSpec:PIppsDFTSpec_R_16s;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_R_16s(pDFTSpec,length,flag,hint);
end;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_32fc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_C_32fc(pDFTSpec,length,flag,hint);
end;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_32f;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_C_32f(pDFTSpec,length,flag,hint);
end;
function ippsDFTInitAlloc_R(var pDFTSpec:PIppsDFTSpec_R_32f;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_R_32f(pDFTSpec,length,flag,hint);
end;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_64fc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_C_64fc(pDFTSpec,length,flag,hint);
end;
function ippsDFTInitAlloc_C(var pDFTSpec:PIppsDFTSpec_C_64f;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_C_64f(pDFTSpec,length,flag,hint);
end;
function ippsDFTInitAlloc_R(var pDFTSpec:PIppsDFTSpec_R_64f;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTInitAlloc_R_64f(pDFTSpec,length,flag,hint);
end;
function ippsDFTOutOrdInitAlloc_C(var pDFTSpec:PIppsDFTOutOrdSpec_C_32fc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTOutOrdInitAlloc_C_32fc(pDFTSpec,length,flag,hint);
end;
function ippsDFTOutOrdInitAlloc_C(var pDFTSpec:PIppsDFTOutOrdSpec_C_64fc;length:longint;flag:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDFTOutOrdInitAlloc_C_64fc(pDFTSpec,length,flag,hint);
end;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_16sc):IppStatus;
begin
result:=ippsDFTFree_C_16sc(pDFTSpec);
end;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_16s):IppStatus;
begin
result:=ippsDFTFree_C_16s(pDFTSpec);
end;
function ippsDFTFree_R(pDFTSpec:PIppsDFTSpec_R_16s):IppStatus;
begin
result:=ippsDFTFree_R_16s(pDFTSpec);
end;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_32fc):IppStatus;
begin
result:=ippsDFTFree_C_32fc(pDFTSpec);
end;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_32f):IppStatus;
begin
result:=ippsDFTFree_C_32f(pDFTSpec);
end;
function ippsDFTFree_R(pDFTSpec:PIppsDFTSpec_R_32f):IppStatus;
begin
result:=ippsDFTFree_R_32f(pDFTSpec);
end;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_64fc):IppStatus;
begin
result:=ippsDFTFree_C_64fc(pDFTSpec);
end;
function ippsDFTFree_C(pDFTSpec:PIppsDFTSpec_C_64f):IppStatus;
begin
result:=ippsDFTFree_C_64f(pDFTSpec);
end;
function ippsDFTFree_R(pDFTSpec:PIppsDFTSpec_R_64f):IppStatus;
begin
result:=ippsDFTFree_R_64f(pDFTSpec);
end;
function ippsDFTOutOrdFree_C(pDFTSpec:PIppsDFTOutOrdSpec_C_32fc):IppStatus;
begin
result:=ippsDFTOutOrdFree_C_32fc(pDFTSpec);
end;
function ippsDFTOutOrdFree_C(pDFTSpec:PIppsDFTOutOrdSpec_C_64fc):IppStatus;
begin
result:=ippsDFTOutOrdFree_C_64fc(pDFTSpec);
end;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_16sc;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_C_16sc(pDFTSpec,pSize);
end;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_16s;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_C_16s(pDFTSpec,pSize);
end;
function ippsDFTGetBufSize_R(pDFTSpec:PIppsDFTSpec_R_16s;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_R_16s(pDFTSpec,pSize);
end;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_32fc;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_C_32fc(pDFTSpec,pSize);
end;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_32f;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_C_32f(pDFTSpec,pSize);
end;
function ippsDFTGetBufSize_R(pDFTSpec:PIppsDFTSpec_R_32f;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_R_32f(pDFTSpec,pSize);
end;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_64fc;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_C_64fc(pDFTSpec,pSize);
end;
function ippsDFTGetBufSize_C(pDFTSpec:PIppsDFTSpec_C_64f;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_C_64f(pDFTSpec,pSize);
end;
function ippsDFTGetBufSize_R(pDFTSpec:PIppsDFTSpec_R_64f;pSize:Plongint):IppStatus;
begin
result:=ippsDFTGetBufSize_R_64f(pDFTSpec,pSize);
end;
function ippsDFTOutOrdGetBufSize_C(pDFTSpec:PIppsDFTOutOrdSpec_C_32fc;size:Plongint):IppStatus;
begin
result:=ippsDFTOutOrdGetBufSize_C_32fc(pDFTSpec,size);
end;
function ippsDFTOutOrdGetBufSize_C(pDFTSpec:PIppsDFTOutOrdSpec_C_64fc;size:Plongint):IppStatus;
begin
result:=ippsDFTOutOrdGetBufSize_C_64fc(pDFTSpec,size);
end;
function ippsDFTFwd_CToC(pSrc:PIpp16sc;pDst:PIpp16sc;pDFTSpec:PIppsDFTSpec_C_16sc;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_CToC_16sc_Sfs(pSrc,pDst,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTInv_CToC(pSrc:PIpp16sc;pDst:PIpp16sc;pDFTSpec:PIppsDFTSpec_C_16sc;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CToC_16sc_Sfs(pSrc,pDst,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTFwd_CToC(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDstRe:PIpp16s;pDstIm:PIpp16s;pDFTSpec:PIppsDFTSpec_C_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_CToC_16s_Sfs(pSrcRe,pSrcIm,pDstRe,pDstIm,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTInv_CToC(pSrcRe:PIpp16s;pSrcIm:PIpp16s;pDstRe:PIpp16s;pDstIm:PIpp16s;pDFTSpec:PIppsDFTSpec_C_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CToC_16s_Sfs(pSrcRe,pSrcIm,pDstRe,pDstIm,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTFwd_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pDFTSpec:PIppsDFTSpec_C_32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_CToC_32fc(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTInv_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pDFTSpec:PIppsDFTSpec_C_32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CToC_32fc(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_CToC(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;pDFTSpec:PIppsDFTSpec_C_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_CToC_32f(pSrcRe,pSrcIm,pDstRe,pDstIm,pDFTSpec,pBuffer);
end;
function ippsDFTInv_CToC(pSrcRe:PIpp32f;pSrcIm:PIpp32f;pDstRe:PIpp32f;pDstIm:PIpp32f;pDFTSpec:PIppsDFTSpec_C_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CToC_32f(pSrcRe,pSrcIm,pDstRe,pDstIm,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pDFTSpec:PIppsDFTSpec_C_64fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_CToC_64fc(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTInv_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pDFTSpec:PIppsDFTSpec_C_64fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CToC_64fc(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_CToC(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;pDFTSpec:PIppsDFTSpec_C_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_CToC_64f(pSrcRe,pSrcIm,pDstRe,pDstIm,pDFTSpec,pBuffer);
end;
function ippsDFTInv_CToC(pSrcRe:PIpp64f;pSrcIm:PIpp64f;pDstRe:PIpp64f;pDstIm:PIpp64f;pDFTSpec:PIppsDFTSpec_C_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CToC_64f(pSrcRe,pSrcIm,pDstRe,pDstIm,pDFTSpec,pBuffer);
end;
function ippsDFTOutOrdFwd_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pDFTSpec:PIppsDFTOutOrdSpec_C_32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTOutOrdFwd_CToC_32fc(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTOutOrdInv_CToC(pSrc:PIpp32fc;pDst:PIpp32fc;pDFTSpec:PIppsDFTOutOrdSpec_C_32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTOutOrdInv_CToC_32fc(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTOutOrdFwd_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pDFTSpec:PIppsDFTOutOrdSpec_C_64fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTOutOrdFwd_CToC_64fc(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTOutOrdInv_CToC(pSrc:PIpp64fc;pDst:PIpp64fc;pDFTSpec:PIppsDFTOutOrdSpec_C_64fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTOutOrdInv_CToC_64fc(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_RToPerm(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToPerm_16s_Sfs(pSrc,pDst,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTFwd_RToPack(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToPack_16s_Sfs(pSrc,pDst,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTFwd_RToCCS(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToCCS_16s_Sfs(pSrc,pDst,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTInv_PermToR(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_PermToR_16s_Sfs(pSrc,pDst,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTInv_PackToR(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_PackToR_16s_Sfs(pSrc,pDst,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTInv_CCSToR(pSrc:PIpp16s;pDst:PIpp16s;pDFTSpec:PIppsDFTSpec_R_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CCSToR_16s_Sfs(pSrc,pDst,pDFTSpec,scaleFactor,pBuffer);
end;
function ippsDFTFwd_RToPerm(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToPerm_32f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_RToPack(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToPack_32f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_RToCCS(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToCCS_32f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTInv_PermToR(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_PermToR_32f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTInv_PackToR(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_PackToR_32f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTInv_CCSToR(pSrc:PIpp32f;pDst:PIpp32f;pDFTSpec:PIppsDFTSpec_R_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CCSToR_32f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_RToPerm(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToPerm_64f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_RToPack(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToPack_64f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTFwd_RToCCS(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTFwd_RToCCS_64f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTInv_PermToR(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_PermToR_64f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTInv_PackToR(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_PackToR_64f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsDFTInv_CCSToR(pSrc:PIpp64f;pDst:PIpp64f;pDFTSpec:PIppsDFTSpec_R_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDFTInv_CCSToR_64f(pSrc,pDst,pDFTSpec,pBuffer);
end;
function ippsMulPack(pSrc:PIpp16s;pSrcDst:PIpp16s;length:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulPack_16s_ISfs(pSrc,pSrcDst,length,scaleFactor);
end;
function ippsMulPerm(pSrc:PIpp16s;pSrcDst:PIpp16s;length:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulPerm_16s_ISfs(pSrc,pSrcDst,length,scaleFactor);
end;
function ippsMulPack(pSrc:PIpp32f;pSrcDst:PIpp32f;length:longint):IppStatus;
begin
result:=ippsMulPack_32f_I(pSrc,pSrcDst,length);
end;
function ippsMulPerm(pSrc:PIpp32f;pSrcDst:PIpp32f;length:longint):IppStatus;
begin
result:=ippsMulPerm_32f_I(pSrc,pSrcDst,length);
end;
function ippsMulPack(pSrc:PIpp64f;pSrcDst:PIpp64f;length:longint):IppStatus;
begin
result:=ippsMulPack_64f_I(pSrc,pSrcDst,length);
end;
function ippsMulPerm(pSrc:PIpp64f;pSrcDst:PIpp64f;length:longint):IppStatus;
begin
result:=ippsMulPerm_64f_I(pSrc,pSrcDst,length);
end;
function ippsMulPack(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;length:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulPack_16s_Sfs(pSrc1,pSrc2,pDst,length,scaleFactor);
end;
function ippsMulPerm(pSrc1:PIpp16s;pSrc2:PIpp16s;pDst:PIpp16s;length:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsMulPerm_16s_Sfs(pSrc1,pSrc2,pDst,length,scaleFactor);
end;
function ippsMulPack(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;length:longint):IppStatus;
begin
result:=ippsMulPack_32f(pSrc1,pSrc2,pDst,length);
end;
function ippsMulPerm(pSrc1:PIpp32f;pSrc2:PIpp32f;pDst:PIpp32f;length:longint):IppStatus;
begin
result:=ippsMulPerm_32f(pSrc1,pSrc2,pDst,length);
end;
function ippsMulPack(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;length:longint):IppStatus;
begin
result:=ippsMulPack_64f(pSrc1,pSrc2,pDst,length);
end;
function ippsMulPerm(pSrc1:PIpp64f;pSrc2:PIpp64f;pDst:PIpp64f;length:longint):IppStatus;
begin
result:=ippsMulPerm_64f(pSrc1,pSrc2,pDst,length);
end;
function ippsMulPackConj(pSrc:PIpp32f;pSrcDst:PIpp32f;length:longint):IppStatus;
begin
result:=ippsMulPackConj_32f_I(pSrc,pSrcDst,length);
end;
function ippsMulPackConj(pSrc:PIpp64f;pSrcDst:PIpp64f;length:longint):IppStatus;
begin
result:=ippsMulPackConj_64f_I(pSrc,pSrcDst,length);
end;
function ippsGoertz(pSrc:PIpp32fc;len:longint;pVal:PIpp32fc;freq:Ipp32f):IppStatus;
begin
result:=ippsGoertz_32fc(pSrc,len,pVal,freq);
end;
function ippsGoertz(pSrc:PIpp64fc;len:longint;pVal:PIpp64fc;freq:Ipp64f):IppStatus;
begin
result:=ippsGoertz_64fc(pSrc,len,pVal,freq);
end;
function ippsGoertz(pSrc:PIpp16sc;len:longint;pVal:PIpp16sc;freq:Ipp32f;scaleFactor:longint):IppStatus;
begin
result:=ippsGoertz_16sc_Sfs(pSrc,len,pVal,freq,scaleFactor);
end;
function ippsGoertz(pSrc:PIpp32f;len:longint;pVal:PIpp32fc;freq:Ipp32f):IppStatus;
begin
result:=ippsGoertz_32f(pSrc,len,pVal,freq);
end;
function ippsGoertz(pSrc:PIpp16s;len:longint;pVal:PIpp16sc;freq:Ipp32f;scaleFactor:longint):IppStatus;
begin
result:=ippsGoertz_16s_Sfs(pSrc,len,pVal,freq,scaleFactor);
end;
function ippsGoertzTwo(pSrc:PIpp32fc;len:longint;var pVal:Ipp32fc;var freq:Ipp32f):IppStatus;
begin
result:=ippsGoertzTwo_32fc(pSrc,len,pVal,freq);
end;
function ippsGoertzTwo(pSrc:PIpp64fc;len:longint;var pVal:Ipp64fc;var freq:Ipp64f):IppStatus;
begin
result:=ippsGoertzTwo_64fc(pSrc,len,pVal,freq);
end;
function ippsGoertzTwo(pSrc:PIpp16sc;len:longint;var pVal:Ipp16sc;var freq:Ipp32f;scaleFactor:longint):IppStatus;
begin
result:=ippsGoertzTwo_16sc_Sfs(pSrc,len,pVal,freq,scaleFactor);
end;
function ippsDCTFwdInitAlloc(var pDCTSpec:PIppsDCTFwdSpec_16s;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDCTFwdInitAlloc_16s(pDCTSpec,length,hint);
end;
function ippsDCTInvInitAlloc(var pDCTSpec:PIppsDCTInvSpec_16s;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDCTInvInitAlloc_16s(pDCTSpec,length,hint);
end;
function ippsDCTFwdInitAlloc(var pDCTSpec:PIppsDCTFwdSpec_32f;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDCTFwdInitAlloc_32f(pDCTSpec,length,hint);
end;
function ippsDCTInvInitAlloc(var pDCTSpec:PIppsDCTInvSpec_32f;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDCTInvInitAlloc_32f(pDCTSpec,length,hint);
end;
function ippsDCTFwdInitAlloc(var pDCTSpec:PIppsDCTFwdSpec_64f;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDCTFwdInitAlloc_64f(pDCTSpec,length,hint);
end;
function ippsDCTInvInitAlloc(var pDCTSpec:PIppsDCTInvSpec_64f;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsDCTInvInitAlloc_64f(pDCTSpec,length,hint);
end;
function ippsDCTFwdFree(pDCTSpec:PIppsDCTFwdSpec_16s):IppStatus;
begin
result:=ippsDCTFwdFree_16s(pDCTSpec);
end;
function ippsDCTInvFree(pDCTSpec:PIppsDCTInvSpec_16s):IppStatus;
begin
result:=ippsDCTInvFree_16s(pDCTSpec);
end;
function ippsDCTFwdFree(pDCTSpec:PIppsDCTFwdSpec_32f):IppStatus;
begin
result:=ippsDCTFwdFree_32f(pDCTSpec);
end;
function ippsDCTInvFree(pDCTSpec:PIppsDCTInvSpec_32f):IppStatus;
begin
result:=ippsDCTInvFree_32f(pDCTSpec);
end;
function ippsDCTFwdFree(pDCTSpec:PIppsDCTFwdSpec_64f):IppStatus;
begin
result:=ippsDCTFwdFree_64f(pDCTSpec);
end;
function ippsDCTInvFree(pDCTSpec:PIppsDCTInvSpec_64f):IppStatus;
begin
result:=ippsDCTInvFree_64f(pDCTSpec);
end;
function ippsDCTFwdGetBufSize(pDCTSpec:PIppsDCTFwdSpec_16s;pSize:Plongint):IppStatus;
begin
result:=ippsDCTFwdGetBufSize_16s(pDCTSpec,pSize);
end;
function ippsDCTInvGetBufSize(pDCTSpec:PIppsDCTInvSpec_16s;pSize:Plongint):IppStatus;
begin
result:=ippsDCTInvGetBufSize_16s(pDCTSpec,pSize);
end;
function ippsDCTFwdGetBufSize(pDCTSpec:PIppsDCTFwdSpec_32f;pSize:Plongint):IppStatus;
begin
result:=ippsDCTFwdGetBufSize_32f(pDCTSpec,pSize);
end;
function ippsDCTInvGetBufSize(pDCTSpec:PIppsDCTInvSpec_32f;pSize:Plongint):IppStatus;
begin
result:=ippsDCTInvGetBufSize_32f(pDCTSpec,pSize);
end;
function ippsDCTFwdGetBufSize(pDCTSpec:PIppsDCTFwdSpec_64f;pSize:Plongint):IppStatus;
begin
result:=ippsDCTFwdGetBufSize_64f(pDCTSpec,pSize);
end;
function ippsDCTInvGetBufSize(pDCTSpec:PIppsDCTInvSpec_64f;pSize:Plongint):IppStatus;
begin
result:=ippsDCTInvGetBufSize_64f(pDCTSpec,pSize);
end;
function ippsDCTFwd(pSrc:PIpp16s;pDst:PIpp16s;pDCTSpec:PIppsDCTFwdSpec_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDCTFwd_16s_Sfs(pSrc,pDst,pDCTSpec,scaleFactor,pBuffer);
end;
function ippsDCTInv(pSrc:PIpp16s;pDst:PIpp16s;pDCTSpec:PIppsDCTInvSpec_16s;scaleFactor:longint;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDCTInv_16s_Sfs(pSrc,pDst,pDCTSpec,scaleFactor,pBuffer);
end;
function ippsDCTFwd(pSrc:PIpp32f;pDst:PIpp32f;pDCTSpec:PIppsDCTFwdSpec_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDCTFwd_32f(pSrc,pDst,pDCTSpec,pBuffer);
end;
function ippsDCTInv(pSrc:PIpp32f;pDst:PIpp32f;pDCTSpec:PIppsDCTInvSpec_32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDCTInv_32f(pSrc,pDst,pDCTSpec,pBuffer);
end;
function ippsDCTFwd(pSrc:PIpp64f;pDst:PIpp64f;pDCTSpec:PIppsDCTFwdSpec_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDCTFwd_64f(pSrc,pDst,pDCTSpec,pBuffer);
end;
function ippsDCTInv(pSrc:PIpp64f;pDst:PIpp64f;pDCTSpec:PIppsDCTInvSpec_64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsDCTInv_64f(pSrc,pDst,pDCTSpec,pBuffer);
end;
function ippsWTHaarFwd(pSrc:PIpp8s;len:longint;pDstLow:PIpp8s;pDstHigh:PIpp8s):IppStatus;
begin
result:=ippsWTHaarFwd_8s(pSrc,len,pDstLow,pDstHigh);
end;
function ippsWTHaarFwd(pSrc:PIpp16s;len:longint;pDstLow:PIpp16s;pDstHigh:PIpp16s):IppStatus;
begin
result:=ippsWTHaarFwd_16s(pSrc,len,pDstLow,pDstHigh);
end;
function ippsWTHaarFwd(pSrc:PIpp32s;len:longint;pDstLow:PIpp32s;pDstHigh:PIpp32s):IppStatus;
begin
result:=ippsWTHaarFwd_32s(pSrc,len,pDstLow,pDstHigh);
end;
function ippsWTHaarFwd(pSrc:PIpp64s;len:longint;pDstLow:PIpp64s;pDstHigh:PIpp64s):IppStatus;
begin
result:=ippsWTHaarFwd_64s(pSrc,len,pDstLow,pDstHigh);
end;
function ippsWTHaarFwd(pSrc:PIpp32f;len:longint;pDstLow:PIpp32f;pDstHigh:PIpp32f):IppStatus;
begin
result:=ippsWTHaarFwd_32f(pSrc,len,pDstLow,pDstHigh);
end;
function ippsWTHaarFwd(pSrc:PIpp64f;len:longint;pDstLow:PIpp64f;pDstHigh:PIpp64f):IppStatus;
begin
result:=ippsWTHaarFwd_64f(pSrc,len,pDstLow,pDstHigh);
end;
function ippsWTHaarFwd(pSrc:PIpp8s;len:longint;pDstLow:PIpp8s;pDstHigh:PIpp8s;scaleFactor:longint):IppStatus;
begin
result:=ippsWTHaarFwd_8s_Sfs(pSrc,len,pDstLow,pDstHigh,scaleFactor);
end;
function ippsWTHaarFwd(pSrc:PIpp16s;len:longint;pDstLow:PIpp16s;pDstHigh:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsWTHaarFwd_16s_Sfs(pSrc,len,pDstLow,pDstHigh,scaleFactor);
end;
function ippsWTHaarFwd(pSrc:PIpp32s;len:longint;pDstLow:PIpp32s;pDstHigh:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsWTHaarFwd_32s_Sfs(pSrc,len,pDstLow,pDstHigh,scaleFactor);
end;
function ippsWTHaarFwd(pSrc:PIpp64s;len:longint;pDstLow:PIpp64s;pDstHigh:PIpp64s;scaleFactor:longint):IppStatus;
begin
result:=ippsWTHaarFwd_64s_Sfs(pSrc,len,pDstLow,pDstHigh,scaleFactor);
end;
function ippsWTHaarInv(pSrcLow:PIpp8s;pSrcHigh:PIpp8s;pDst:PIpp8s;len:longint):IppStatus;
begin
result:=ippsWTHaarInv_8s(pSrcLow,pSrcHigh,pDst,len);
end;
function ippsWTHaarInv(pSrcLow:PIpp16s;pSrcHigh:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWTHaarInv_16s(pSrcLow,pSrcHigh,pDst,len);
end;
function ippsWTHaarInv(pSrcLow:PIpp32s;pSrcHigh:PIpp32s;pDst:PIpp32s;len:longint):IppStatus;
begin
result:=ippsWTHaarInv_32s(pSrcLow,pSrcHigh,pDst,len);
end;
function ippsWTHaarInv(pSrcLow:PIpp64s;pSrcHigh:PIpp64s;pDst:PIpp64s;len:longint):IppStatus;
begin
result:=ippsWTHaarInv_64s(pSrcLow,pSrcHigh,pDst,len);
end;
function ippsWTHaarInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWTHaarInv_32f(pSrcLow,pSrcHigh,pDst,len);
end;
function ippsWTHaarInv(pSrcLow:PIpp64f;pSrcHigh:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWTHaarInv_64f(pSrcLow,pSrcHigh,pDst,len);
end;
function ippsWTHaarInv(pSrcLow:PIpp8s;pSrcHigh:PIpp8s;pDst:PIpp8s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsWTHaarInv_8s_Sfs(pSrcLow,pSrcHigh,pDst,len,scaleFactor);
end;
function ippsWTHaarInv(pSrcLow:PIpp16s;pSrcHigh:PIpp16s;pDst:PIpp16s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsWTHaarInv_16s_Sfs(pSrcLow,pSrcHigh,pDst,len,scaleFactor);
end;
function ippsWTHaarInv(pSrcLow:PIpp32s;pSrcHigh:PIpp32s;pDst:PIpp32s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsWTHaarInv_32s_Sfs(pSrcLow,pSrcHigh,pDst,len,scaleFactor);
end;
function ippsWTHaarInv(pSrcLow:PIpp64s;pSrcHigh:PIpp64s;pDst:PIpp64s;len:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsWTHaarInv_64s_Sfs(pSrcLow,pSrcHigh,pDst,len,scaleFactor);
end;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTFwdInitAlloc_32f(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_8s32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTFwdInitAlloc_8s32f(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_8u32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTFwdInitAlloc_8u32f(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_16s32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTFwdInitAlloc_16s32f(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTFwdInitAlloc(var pState:PIppsWTFwdState_16u32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTFwdInitAlloc_16u32f(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdSetDlyLine_32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_8s32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdSetDlyLine_8s32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_8u32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdSetDlyLine_8u32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_16s32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdSetDlyLine_16s32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdSetDlyLine(pState:PIppsWTFwdState_16u32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdSetDlyLine_16u32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdGetDlyLine_32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_8s32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdGetDlyLine_8s32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_8u32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdGetDlyLine_8u32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_16s32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdGetDlyLine_16s32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwdGetDlyLine(pState:PIppsWTFwdState_16u32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTFwdGetDlyLine_16u32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTFwd(pSrc:PIpp32f;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_32f):IppStatus;
begin
result:=ippsWTFwd_32f(pSrc,pDstLow,pDstHigh,dstLen,pState);
end;
function ippsWTFwd(pSrc:PIpp8s;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_8s32f):IppStatus;
begin
result:=ippsWTFwd_8s32f(pSrc,pDstLow,pDstHigh,dstLen,pState);
end;
function ippsWTFwd(pSrc:PIpp8u;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_8u32f):IppStatus;
begin
result:=ippsWTFwd_8u32f(pSrc,pDstLow,pDstHigh,dstLen,pState);
end;
function ippsWTFwd(pSrc:PIpp16s;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_16s32f):IppStatus;
begin
result:=ippsWTFwd_16s32f(pSrc,pDstLow,pDstHigh,dstLen,pState);
end;
function ippsWTFwd(pSrc:PIpp16u;pDstLow:PIpp32f;pDstHigh:PIpp32f;dstLen:longint;pState:PIppsWTFwdState_16u32f):IppStatus;
begin
result:=ippsWTFwd_16u32f(pSrc,pDstLow,pDstHigh,dstLen,pState);
end;
function ippsWTFwdFree(pState:PIppsWTFwdState_32f):IppStatus;
begin
result:=ippsWTFwdFree_32f(pState);
end;
function ippsWTFwdFree(pState:PIppsWTFwdState_8s32f):IppStatus;
begin
result:=ippsWTFwdFree_8s32f(pState);
end;
function ippsWTFwdFree(pState:PIppsWTFwdState_8u32f):IppStatus;
begin
result:=ippsWTFwdFree_8u32f(pState);
end;
function ippsWTFwdFree(pState:PIppsWTFwdState_16s32f):IppStatus;
begin
result:=ippsWTFwdFree_16s32f(pState);
end;
function ippsWTFwdFree(pState:PIppsWTFwdState_16u32f):IppStatus;
begin
result:=ippsWTFwdFree_16u32f(pState);
end;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTInvInitAlloc_32f(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f8s;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTInvInitAlloc_32f8s(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f8u;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTInvInitAlloc_32f8u(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f16s;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTInvInitAlloc_32f16s(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTInvInitAlloc(var pState:PIppsWTInvState_32f16u;pTapsLow:PIpp32f;lenLow:longint;offsLow:longint;pTapsHigh:PIpp32f;lenHigh:longint;offsHigh:longint):IppStatus;
begin
result:=ippsWTInvInitAlloc_32f16u(pState,pTapsLow,lenLow,offsLow,pTapsHigh,lenHigh,offsHigh);
end;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvSetDlyLine_32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f8s;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvSetDlyLine_32f8s(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f8u;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvSetDlyLine_32f8u(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f16s;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvSetDlyLine_32f16s(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvSetDlyLine(pState:PIppsWTInvState_32f16u;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvSetDlyLine_32f16u(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvGetDlyLine_32f(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f8s;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvGetDlyLine_32f8s(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f8u;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvGetDlyLine_32f8u(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f16s;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvGetDlyLine_32f16s(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInvGetDlyLine(pState:PIppsWTInvState_32f16u;pDlyLow:PIpp32f;pDlyHigh:PIpp32f):IppStatus;
begin
result:=ippsWTInvGetDlyLine_32f16u(pState,pDlyLow,pDlyHigh);
end;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp32f;pState:PIppsWTInvState_32f):IppStatus;
begin
result:=ippsWTInv_32f(pSrcLow,pSrcHigh,srcLen,pDst,pState);
end;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp8s;pState:PIppsWTInvState_32f8s):IppStatus;
begin
result:=ippsWTInv_32f8s(pSrcLow,pSrcHigh,srcLen,pDst,pState);
end;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp8u;pState:PIppsWTInvState_32f8u):IppStatus;
begin
result:=ippsWTInv_32f8u(pSrcLow,pSrcHigh,srcLen,pDst,pState);
end;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp16s;pState:PIppsWTInvState_32f16s):IppStatus;
begin
result:=ippsWTInv_32f16s(pSrcLow,pSrcHigh,srcLen,pDst,pState);
end;
function ippsWTInv(pSrcLow:PIpp32f;pSrcHigh:PIpp32f;srcLen:longint;pDst:PIpp16u;pState:PIppsWTInvState_32f16u):IppStatus;
begin
result:=ippsWTInv_32f16u(pSrcLow,pSrcHigh,srcLen,pDst,pState);
end;
function ippsWTInvFree(pState:PIppsWTInvState_32f):IppStatus;
begin
result:=ippsWTInvFree_32f(pState);
end;
function ippsWTInvFree(pState:PIppsWTInvState_32f8s):IppStatus;
begin
result:=ippsWTInvFree_32f8s(pState);
end;
function ippsWTInvFree(pState:PIppsWTInvState_32f8u):IppStatus;
begin
result:=ippsWTInvFree_32f8u(pState);
end;
function ippsWTInvFree(pState:PIppsWTInvState_32f16s):IppStatus;
begin
result:=ippsWTInvFree_32f16s(pState);
end;
function ippsWTInvFree(pState:PIppsWTInvState_32f16u):IppStatus;
begin
result:=ippsWTInvFree_32f16u(pState);
end;
function ippsConv(pSrc1:PIpp32f;lenSrc1:longint;pSrc2:PIpp32f;lenSrc2:longint;pDst:PIpp32f):IppStatus;
begin
result:=ippsConv_32f(pSrc1,lenSrc1,pSrc2,lenSrc2,pDst);
end;
function ippsConv(pSrc1:PIpp16s;lenSrc1:longint;pSrc2:PIpp16s;lenSrc2:longint;pDst:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsConv_16s_Sfs(pSrc1,lenSrc1,pSrc2,lenSrc2,pDst,scaleFactor);
end;
function ippsConv(pSrc1:PIpp64f;lenSrc1:longint;pSrc2:PIpp64f;lenSrc2:longint;pDst:PIpp64f):IppStatus;
begin
result:=ippsConv_64f(pSrc1,lenSrc1,pSrc2,lenSrc2,pDst);
end;
function ippsConvCyclic8x8(x:PIpp32f;h:PIpp32f;y:PIpp32f):IppStatus;
begin
result:=ippsConvCyclic8x8_32f(x,h,y);
end;
function ippsConvCyclic8x8(x:PIpp16s;h:PIpp16s;y:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsConvCyclic8x8_16s_Sfs(x,h,y,scaleFactor);
end;
function ippsConvCyclic4x4(x:PIpp32f;h:PIpp32fc;y:PIpp32fc):IppStatus;
begin
result:=ippsConvCyclic4x4_32f32fc(x,h,y);
end;
function ippsIIRInitAlloc(var pState:PIppsIIRState_32f;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsIIRInitAlloc_32f(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc(var pState:PIppsIIRState_32fc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsIIRInitAlloc_32fc(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc32f(var pState:PIppsIIRState32f_16s;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsIIRInitAlloc32f_16s(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc32fc(var pState:PIppsIIRState32fc_16sc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsIIRInitAlloc32fc_16sc(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc(var pState:PIppsIIRState_64f;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRInitAlloc_64f(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc(var pState:PIppsIIRState_64fc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRInitAlloc_64fc(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc64f(var pState:PIppsIIRState64f_32f;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRInitAlloc64f_32f(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc64fc(var pState:PIppsIIRState64fc_32fc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRInitAlloc64fc_32fc(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc64f(var pState:PIppsIIRState64f_32s;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRInitAlloc64f_32s(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc64fc(var pState:PIppsIIRState64fc_32sc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRInitAlloc64fc_32sc(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc64f(var pState:PIppsIIRState64f_16s;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRInitAlloc64f_16s(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc64fc(var pState:PIppsIIRState64fc_16sc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRInitAlloc64fc_16sc(pState,pTaps,order,pDlyLine);
end;
function ippsIIRFree(pState:PIppsIIRState_32f):IppStatus;
begin
result:=ippsIIRFree_32f(pState);
end;
function ippsIIRFree(pState:PIppsIIRState_32fc):IppStatus;
begin
result:=ippsIIRFree_32fc(pState);
end;
function ippsIIRFree32f(pState:PIppsIIRState32f_16s):IppStatus;
begin
result:=ippsIIRFree32f_16s(pState);
end;
function ippsIIRFree32fc(pState:PIppsIIRState32fc_16sc):IppStatus;
begin
result:=ippsIIRFree32fc_16sc(pState);
end;
function ippsIIRFree(pState:PIppsIIRState_64f):IppStatus;
begin
result:=ippsIIRFree_64f(pState);
end;
function ippsIIRFree(pState:PIppsIIRState_64fc):IppStatus;
begin
result:=ippsIIRFree_64fc(pState);
end;
function ippsIIRFree64f(pState:PIppsIIRState64f_32f):IppStatus;
begin
result:=ippsIIRFree64f_32f(pState);
end;
function ippsIIRFree64fc(pState:PIppsIIRState64fc_32fc):IppStatus;
begin
result:=ippsIIRFree64fc_32fc(pState);
end;
function ippsIIRFree64f(pState:PIppsIIRState64f_32s):IppStatus;
begin
result:=ippsIIRFree64f_32s(pState);
end;
function ippsIIRFree64fc(pState:PIppsIIRState64fc_32sc):IppStatus;
begin
result:=ippsIIRFree64fc_32sc(pState);
end;
function ippsIIRFree64f(pState:PIppsIIRState64f_16s):IppStatus;
begin
result:=ippsIIRFree64f_16s(pState);
end;
function ippsIIRFree64fc(pState:PIppsIIRState64fc_16sc):IppStatus;
begin
result:=ippsIIRFree64fc_16sc(pState);
end;
function ippsIIRInitAlloc_BiQuad(var pState:PIppsIIRState_32f;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsIIRInitAlloc_BiQuad_32f(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc_BiQuad(var pState:PIppsIIRState_32fc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsIIRInitAlloc_BiQuad_32fc(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc32f_BiQuad(var pState:PIppsIIRState32f_16s;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsIIRInitAlloc32f_BiQuad_16s(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc32fc_BiQuad(var pState:PIppsIIRState32fc_16sc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsIIRInitAlloc32fc_BiQuad_16sc(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc_BiQuad(var pState:PIppsIIRState_64f;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRInitAlloc_BiQuad_64f(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc_BiQuad(var pState:PIppsIIRState_64fc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRInitAlloc_BiQuad_64fc(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc64f_BiQuad(var pState:PIppsIIRState64f_32f;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRInitAlloc64f_BiQuad_32f(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc64fc_BiQuad(var pState:PIppsIIRState64fc_32fc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRInitAlloc64fc_BiQuad_32fc(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc64f_BiQuad(var pState:PIppsIIRState64f_32s;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRInitAlloc64f_BiQuad_32s(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc64fc_BiQuad(var pState:PIppsIIRState64fc_32sc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRInitAlloc64fc_BiQuad_32sc(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc64f_BiQuad(var pState:PIppsIIRState64f_16s;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRInitAlloc64f_BiQuad_16s(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc64fc_BiQuad(var pState:PIppsIIRState64fc_16sc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRInitAlloc64fc_BiQuad_16sc(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRGetDlyLine(pState:PIppsIIRState_32f;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsIIRGetDlyLine_32f(pState,pDlyLine);
end;
function ippsIIRSetDlyLine(pState:PIppsIIRState_32f;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsIIRSetDlyLine_32f(pState,pDlyLine);
end;
function ippsIIRGetDlyLine(pState:PIppsIIRState_32fc;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsIIRGetDlyLine_32fc(pState,pDlyLine);
end;
function ippsIIRSetDlyLine(pState:PIppsIIRState_32fc;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsIIRSetDlyLine_32fc(pState,pDlyLine);
end;
function ippsIIRGetDlyLine32f(pState:PIppsIIRState32f_16s;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsIIRGetDlyLine32f_16s(pState,pDlyLine);
end;
function ippsIIRSetDlyLine32f(pState:PIppsIIRState32f_16s;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsIIRSetDlyLine32f_16s(pState,pDlyLine);
end;
function ippsIIRGetDlyLine32fc(pState:PIppsIIRState32fc_16sc;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsIIRGetDlyLine32fc_16sc(pState,pDlyLine);
end;
function ippsIIRSetDlyLine32fc(pState:PIppsIIRState32fc_16sc;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsIIRSetDlyLine32fc_16sc(pState,pDlyLine);
end;
function ippsIIRGetDlyLine(pState:PIppsIIRState_64f;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRGetDlyLine_64f(pState,pDlyLine);
end;
function ippsIIRSetDlyLine(pState:PIppsIIRState_64f;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRSetDlyLine_64f(pState,pDlyLine);
end;
function ippsIIRGetDlyLine(pState:PIppsIIRState_64fc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRGetDlyLine_64fc(pState,pDlyLine);
end;
function ippsIIRSetDlyLine(pState:PIppsIIRState_64fc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRSetDlyLine_64fc(pState,pDlyLine);
end;
function ippsIIRGetDlyLine64f(pState:PIppsIIRState64f_32f;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRGetDlyLine64f_32f(pState,pDlyLine);
end;
function ippsIIRSetDlyLine64f(pState:PIppsIIRState64f_32f;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRSetDlyLine64f_32f(pState,pDlyLine);
end;
function ippsIIRGetDlyLine64fc(pState:PIppsIIRState64fc_32fc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRGetDlyLine64fc_32fc(pState,pDlyLine);
end;
function ippsIIRSetDlyLine64fc(pState:PIppsIIRState64fc_32fc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRSetDlyLine64fc_32fc(pState,pDlyLine);
end;
function ippsIIRGetDlyLine64f(pState:PIppsIIRState64f_32s;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRGetDlyLine64f_32s(pState,pDlyLine);
end;
function ippsIIRSetDlyLine64f(pState:PIppsIIRState64f_32s;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRSetDlyLine64f_32s(pState,pDlyLine);
end;
function ippsIIRGetDlyLine64fc(pState:PIppsIIRState64fc_32sc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRGetDlyLine64fc_32sc(pState,pDlyLine);
end;
function ippsIIRSetDlyLine64fc(pState:PIppsIIRState64fc_32sc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRSetDlyLine64fc_32sc(pState,pDlyLine);
end;
function ippsIIRGetDlyLine64f(pState:PIppsIIRState64f_16s;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRGetDlyLine64f_16s(pState,pDlyLine);
end;
function ippsIIRSetDlyLine64f(pState:PIppsIIRState64f_16s;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsIIRSetDlyLine64f_16s(pState,pDlyLine);
end;
function ippsIIRGetDlyLine64fc(pState:PIppsIIRState64fc_16sc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRGetDlyLine64fc_16sc(pState,pDlyLine);
end;
function ippsIIRSetDlyLine64fc(pState:PIppsIIRState64fc_16sc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsIIRSetDlyLine64fc_16sc(pState,pDlyLine);
end;
function ippsIIROne(src:Ipp32f;pDstVal:PIpp32f;pState:PIppsIIRState_32f):IppStatus;
begin
result:=ippsIIROne_32f(src,pDstVal,pState);
end;
function ippsIIROne(src:Ipp32fc;pDstVal:PIpp32fc;pState:PIppsIIRState_32fc):IppStatus;
begin
result:=ippsIIROne_32fc(src,pDstVal,pState);
end;
function ippsIIROne32f(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsIIRState32f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIROne32f_16s_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsIIROne32fc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsIIRState32fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIROne32fc_16sc_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsIIROne(src:Ipp64f;pDstVal:PIpp64f;pState:PIppsIIRState_64f):IppStatus;
begin
result:=ippsIIROne_64f(src,pDstVal,pState);
end;
function ippsIIROne(src:Ipp64fc;pDstVal:PIpp64fc;pState:PIppsIIRState_64fc):IppStatus;
begin
result:=ippsIIROne_64fc(src,pDstVal,pState);
end;
function ippsIIROne64f(src:Ipp32f;pDstVal:PIpp32f;pState:PIppsIIRState64f_32f):IppStatus;
begin
result:=ippsIIROne64f_32f(src,pDstVal,pState);
end;
function ippsIIROne64fc(src:Ipp32fc;pDstVal:PIpp32fc;pState:PIppsIIRState64fc_32fc):IppStatus;
begin
result:=ippsIIROne64fc_32fc(src,pDstVal,pState);
end;
function ippsIIROne64f(src:Ipp32s;pDstVal:PIpp32s;pState:PIppsIIRState64f_32s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIROne64f_32s_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsIIROne64fc(src:Ipp32sc;pDstVal:PIpp32sc;pState:PIppsIIRState64fc_32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIROne64fc_32sc_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsIIROne64f(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsIIRState64f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIROne64f_16s_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsIIROne64fc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsIIRState64fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIROne64fc_16sc_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsIIR(pSrc:PIpp32f;pDst:PIpp32f;len:longint;pState:PIppsIIRState_32f):IppStatus;
begin
result:=ippsIIR_32f(pSrc,pDst,len,pState);
end;
function ippsIIR(pSrcDst:PIpp32f;len:longint;pState:PIppsIIRState_32f):IppStatus;
begin
result:=ippsIIR_32f_I(pSrcDst,len,pState);
end;
function ippsIIR(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;pState:PIppsIIRState_32fc):IppStatus;
begin
result:=ippsIIR_32fc(pSrc,pDst,len,pState);
end;
function ippsIIR(pSrcDst:PIpp32fc;len:longint;pState:PIppsIIRState_32fc):IppStatus;
begin
result:=ippsIIR_32fc_I(pSrcDst,len,pState);
end;
function ippsIIR32f(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pState:PIppsIIRState32f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR32f_16s_Sfs(pSrc,pDst,len,pState,scaleFactor);
end;
function ippsIIR32f(pSrcDst:PIpp16s;len:longint;pState:PIppsIIRState32f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR32f_16s_ISfs(pSrcDst,len,pState,scaleFactor);
end;
function ippsIIR32fc(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;pState:PIppsIIRState32fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR32fc_16sc_Sfs(pSrc,pDst,len,pState,scaleFactor);
end;
function ippsIIR32fc(pSrcDst:PIpp16sc;len:longint;pState:PIppsIIRState32fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR32fc_16sc_ISfs(pSrcDst,len,pState,scaleFactor);
end;
function ippsIIR(pSrc:PIpp64f;pDst:PIpp64f;len:longint;pState:PIppsIIRState_64f):IppStatus;
begin
result:=ippsIIR_64f(pSrc,pDst,len,pState);
end;
function ippsIIR(pSrcDst:PIpp64f;len:longint;pState:PIppsIIRState_64f):IppStatus;
begin
result:=ippsIIR_64f_I(pSrcDst,len,pState);
end;
function ippsIIR(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;pState:PIppsIIRState_64fc):IppStatus;
begin
result:=ippsIIR_64fc(pSrc,pDst,len,pState);
end;
function ippsIIR(pSrcDst:PIpp64fc;len:longint;pState:PIppsIIRState_64fc):IppStatus;
begin
result:=ippsIIR_64fc_I(pSrcDst,len,pState);
end;
function ippsIIR64f(pSrc:PIpp32f;pDst:PIpp32f;len:longint;pState:PIppsIIRState64f_32f):IppStatus;
begin
result:=ippsIIR64f_32f(pSrc,pDst,len,pState);
end;
function ippsIIR64f(pSrcDst:PIpp32f;len:longint;pState:PIppsIIRState64f_32f):IppStatus;
begin
result:=ippsIIR64f_32f_I(pSrcDst,len,pState);
end;
function ippsIIR64fc(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;pState:PIppsIIRState64fc_32fc):IppStatus;
begin
result:=ippsIIR64fc_32fc(pSrc,pDst,len,pState);
end;
function ippsIIR64fc(pSrcDst:PIpp32fc;len:longint;pState:PIppsIIRState64fc_32fc):IppStatus;
begin
result:=ippsIIR64fc_32fc_I(pSrcDst,len,pState);
end;
function ippsIIR64f(pSrc:PIpp32s;pDst:PIpp32s;len:longint;pState:PIppsIIRState64f_32s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR64f_32s_Sfs(pSrc,pDst,len,pState,scaleFactor);
end;
function ippsIIR64f(pSrcDst:PIpp32s;len:longint;pState:PIppsIIRState64f_32s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR64f_32s_ISfs(pSrcDst,len,pState,scaleFactor);
end;
function ippsIIR64fc(pSrc:PIpp32sc;pDst:PIpp32sc;len:longint;pState:PIppsIIRState64fc_32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR64fc_32sc_Sfs(pSrc,pDst,len,pState,scaleFactor);
end;
function ippsIIR64fc(pSrcDst:PIpp32sc;len:longint;pState:PIppsIIRState64fc_32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR64fc_32sc_ISfs(pSrcDst,len,pState,scaleFactor);
end;
function ippsIIR64f(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pState:PIppsIIRState64f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR64f_16s_Sfs(pSrc,pDst,len,pState,scaleFactor);
end;
function ippsIIR64f(pSrcDst:PIpp16s;len:longint;pState:PIppsIIRState64f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR64f_16s_ISfs(pSrcDst,len,pState,scaleFactor);
end;
function ippsIIR64fc(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;pState:PIppsIIRState64fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR64fc_16sc_Sfs(pSrc,pDst,len,pState,scaleFactor);
end;
function ippsIIR64fc(pSrcDst:PIpp16sc;len:longint;pState:PIppsIIRState64fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR64fc_16sc_ISfs(pSrcDst,len,pState,scaleFactor);
end;
function ippsIIRInitAlloc32s(var pState:PIppsIIRState32s_16s;pTaps:PIpp32s;order:longint;tapsFactor:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIRInitAlloc32s_16s(pState,pTaps,order,tapsFactor,pDlyLine);
end;
function ippsIIRInitAlloc32s(var pState:PIppsIIRState32s_16s;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIRInitAlloc32s_16s32f(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc32sc(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32sc;order:longint;tapsFactor:longint;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsIIRInitAlloc32sc_16sc(pState,pTaps,order,tapsFactor,pDlyLine);
end;
function ippsIIRInitAlloc32sc(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsIIRInitAlloc32sc_16sc32fc(pState,pTaps,order,pDlyLine);
end;
function ippsIIRInitAlloc32s_BiQuad(var pState:PIppsIIRState32s_16s;pTaps:PIpp32s;numBq:longint;tapsFactor:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIRInitAlloc32s_BiQuad_16s(pState,pTaps,numBq,tapsFactor,pDlyLine);
end;
function ippsIIRInitAlloc32s_BiQuad(var pState:PIppsIIRState32s_16s;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIRInitAlloc32s_BiQuad_16s32f(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRInitAlloc32sc_BiQuad(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32sc;numBq:longint;tapsFactor:longint;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsIIRInitAlloc32sc_BiQuad_16sc(pState,pTaps,numBq,tapsFactor,pDlyLine);
end;
function ippsIIRInitAlloc32sc_BiQuad(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsIIRInitAlloc32sc_BiQuad_16sc32fc(pState,pTaps,numBq,pDlyLine);
end;
function ippsIIRFree32s(pState:PIppsIIRState32s_16s):IppStatus;
begin
result:=ippsIIRFree32s_16s(pState);
end;
function ippsIIRFree32sc(pState:PIppsIIRState32sc_16sc):IppStatus;
begin
result:=ippsIIRFree32sc_16sc(pState);
end;
function ippsIIRGetDlyLine32s(pState:PIppsIIRState32s_16s;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIRGetDlyLine32s_16s(pState,pDlyLine);
end;
function ippsIIRSetDlyLine32s(pState:PIppsIIRState32s_16s;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIRSetDlyLine32s_16s(pState,pDlyLine);
end;
function ippsIIRGetDlyLine32sc(pState:PIppsIIRState32sc_16sc;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsIIRGetDlyLine32sc_16sc(pState,pDlyLine);
end;
function ippsIIRSetDlyLine32sc(pState:PIppsIIRState32sc_16sc;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsIIRSetDlyLine32sc_16sc(pState,pDlyLine);
end;
function ippsIIROne32s(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsIIRState32s_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIROne32s_16s_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsIIROne32sc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsIIRState32sc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIROne32sc_16sc_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsIIR32s(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pState:PIppsIIRState32s_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR32s_16s_Sfs(pSrc,pDst,len,pState,scaleFactor);
end;
function ippsIIR32sc(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;pState:PIppsIIRState32sc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR32sc_16sc_Sfs(pSrc,pDst,len,pState,scaleFactor);
end;
function ippsIIR32s(pSrcDst:PIpp16s;len:longint;pState:PIppsIIRState32s_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR32s_16s_ISfs(pSrcDst,len,pState,scaleFactor);
end;
function ippsIIR32sc(pSrcDst:PIpp16sc;len:longint;pState:PIppsIIRState32sc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsIIR32sc_16sc_ISfs(pSrcDst,len,pState,scaleFactor);
end;
function ippsIIR_Direct(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pTaps:PIpp16s;order:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIR_Direct_16s(pSrc,pDst,len,pTaps,order,pDlyLine);
end;
function ippsIIR_Direct(pSrcDst:PIpp16s;len:longint;pTaps:PIpp16s;order:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIR_Direct_16s_I(pSrcDst,len,pTaps,order,pDlyLine);
end;
function ippsIIROne_Direct(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp16s;order:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIROne_Direct_16s(src,pDstVal,pTaps,order,pDlyLine);
end;
function ippsIIROne_Direct(pSrcDst:PIpp16s;pTaps:PIpp16s;order:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIROne_Direct_16s_I(pSrcDst,pTaps,order,pDlyLine);
end;
function ippsIIR_BiQuadDirect(pSrc:PIpp16s;pDst:PIpp16s;len:longint;pTaps:PIpp16s;numBq:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIR_BiQuadDirect_16s(pSrc,pDst,len,pTaps,numBq,pDlyLine);
end;
function ippsIIR_BiQuadDirect(pSrcDst:PIpp16s;len:longint;pTaps:PIpp16s;numBq:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIR_BiQuadDirect_16s_I(pSrcDst,len,pTaps,numBq,pDlyLine);
end;
function ippsIIROne_BiQuadDirect(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp16s;numBq:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIROne_BiQuadDirect_16s(src,pDstVal,pTaps,numBq,pDlyLine);
end;
function ippsIIROne_BiQuadDirect(pSrcDstVal:PIpp16s;pTaps:PIpp16s;numBq:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsIIROne_BiQuadDirect_16s_I(pSrcDstVal,pTaps,numBq,pDlyLine);
end;
function ippsIIRGetStateSize32s(order:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize32s_16s(order,pBufferSize);
end;
function ippsIIRGetStateSize32sc(order:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize32sc_16sc(order,pBufferSize);
end;
function ippsIIRGetStateSize32s_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize32s_BiQuad_16s(numBq,pBufferSize);
end;
function ippsIIRGetStateSize32sc_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize32sc_BiQuad_16sc(numBq,pBufferSize);
end;
function ippsIIRInit32s(var pState:PIppsIIRState32s_16s;pTaps:PIpp32s;order:longint;tapsFactor:longint;pDlyLine:PIpp32s;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32s_16s(pState,pTaps,order,tapsFactor,pDlyLine,pBuf);
end;
function ippsIIRInit32sc(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32sc;order:longint;tapsFactor:longint;pDlyLine:PIpp32sc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32sc_16sc(pState,pTaps,order,tapsFactor,pDlyLine,pBuf);
end;
function ippsIIRInit32s_BiQuad(var pState:PIppsIIRState32s_16s;pTaps:PIpp32s;numBq:longint;tapsFactor:longint;pDlyLine:PIpp32s;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32s_BiQuad_16s(pState,pTaps,numBq,tapsFactor,pDlyLine,pBuf);
end;
function ippsIIRInit32sc_BiQuad(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32sc;numBq:longint;tapsFactor:longint;pDlyLine:PIpp32sc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32sc_BiQuad_16sc(pState,pTaps,numBq,tapsFactor,pDlyLine,pBuf);
end;
function ippsIIRInit32s(var pState:PIppsIIRState32s_16s;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32s;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32s_16s32f(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit32sc(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32sc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32sc_16sc32fc(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit32s_BiQuad(var pState:PIppsIIRState32s_16s;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32s;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32s_BiQuad_16s32f(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit32sc_BiQuad(var pState:PIppsIIRState32sc_16sc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32sc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32sc_BiQuad_16sc32fc(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRGetStateSize(order:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize_32f(order,pBufferSize);
end;
function ippsIIRGetStateSize_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize_BiQuad_32f(numBq,pBufferSize);
end;
function ippsIIRInit(var pState:PIppsIIRState_32f;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit_32f(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit(var pState:PIppsIIRState_32fc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit_32fc(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit_BiQuad(var pState:PIppsIIRState_32f;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit_BiQuad_32f(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit_BiQuad(var pState:PIppsIIRState_32fc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit_BiQuad_32fc(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRGetStateSize32f(order:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize32f_16s(order,pBufferSize);
end;
function ippsIIRGetStateSize32fc(order:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize32fc_16sc(order,pBufferSize);
end;
function ippsIIRGetStateSize32f_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize32f_BiQuad_16s(numBq,pBufferSize);
end;
function ippsIIRGetStateSize32fc_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize32fc_BiQuad_16sc(numBq,pBufferSize);
end;
function ippsIIRInit32f(var pState:PIppsIIRState32f_16s;pTaps:PIpp32f;order:longint;pDlyLine:PIpp32f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32f_16s(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit32fc(var pState:PIppsIIRState32fc_16sc;pTaps:PIpp32fc;order:longint;pDlyLine:PIpp32fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32fc_16sc(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit32f_BiQuad(var pState:PIppsIIRState32f_16s;pTaps:PIpp32f;numBq:longint;pDlyLine:PIpp32f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32f_BiQuad_16s(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit32fc_BiQuad(var pState:PIppsIIRState32fc_16sc;pTaps:PIpp32fc;numBq:longint;pDlyLine:PIpp32fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit32fc_BiQuad_16sc(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit(var pState:PIppsIIRState_64f;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit_64f(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit(var pState:PIppsIIRState_64fc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit_64fc(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit_BiQuad(var pState:PIppsIIRState_64f;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit_BiQuad_64f(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit_BiQuad(var pState:PIppsIIRState_64fc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit_BiQuad_64fc(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRGetStateSize64f(order:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize64f_16s(order,pBufferSize);
end;
function ippsIIRGetStateSize64fc(order:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize64fc_16sc(order,pBufferSize);
end;
function ippsIIRGetStateSize64f_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize64f_BiQuad_16s(numBq,pBufferSize);
end;
function ippsIIRGetStateSize64fc_BiQuad(numBq:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsIIRGetStateSize64fc_BiQuad_16sc(numBq,pBufferSize);
end;
function ippsIIRInit64f(var pState:PIppsIIRState64f_16s;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64f_16s(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit64fc(var pState:PIppsIIRState64fc_16sc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64fc_16sc(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit64f_BiQuad(var pState:PIppsIIRState64f_16s;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64f_BiQuad_16s(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit64fc_BiQuad(var pState:PIppsIIRState64fc_16sc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64fc_BiQuad_16sc(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit64f(var pState:PIppsIIRState64f_32s;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64f_32s(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit64fc(var pState:PIppsIIRState64fc_32sc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64fc_32sc(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit64f_BiQuad(var pState:PIppsIIRState64f_32s;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64f_BiQuad_32s(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit64fc_BiQuad(var pState:PIppsIIRState64fc_32sc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64fc_BiQuad_32sc(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit64f(var pState:PIppsIIRState64f_32f;pTaps:PIpp64f;order:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64f_32f(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit64fc(var pState:PIppsIIRState64fc_32fc;pTaps:PIpp64fc;order:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64fc_32fc(pState,pTaps,order,pDlyLine,pBuf);
end;
function ippsIIRInit64f_BiQuad(var pState:PIppsIIRState64f_32f;pTaps:PIpp64f;numBq:longint;pDlyLine:PIpp64f;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64f_BiQuad_32f(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRInit64fc_BiQuad(var pState:PIppsIIRState64fc_32fc;pTaps:PIpp64fc;numBq:longint;pDlyLine:PIpp64fc;pBuf:PIpp8u):IppStatus;
begin
result:=ippsIIRInit64fc_BiQuad_32fc(pState,pTaps,numBq,pDlyLine,pBuf);
end;
function ippsIIRSetTaps(pTaps:PIpp32f;pState:PIppsIIRState_32f):IppStatus;
begin
result:=ippsIIRSetTaps_32f(pTaps,pState);
end;
function ippsIIRSetTaps(pTaps:PIpp32fc;pState:PIppsIIRState_32fc):IppStatus;
begin
result:=ippsIIRSetTaps_32fc(pTaps,pState);
end;
function ippsIIRSetTaps32f(pTaps:PIpp32f;pState:PIppsIIRState32f_16s):IppStatus;
begin
result:=ippsIIRSetTaps32f_16s(pTaps,pState);
end;
function ippsIIRSetTaps32fc(pTaps:PIpp32fc;pState:PIppsIIRState32fc_16sc):IppStatus;
begin
result:=ippsIIRSetTaps32fc_16sc(pTaps,pState);
end;
function ippsIIRSetTaps32s(pTaps:PIpp32s;pState:PIppsIIRState32s_16s;tapsFactor:longint):IppStatus;
begin
result:=ippsIIRSetTaps32s_16s(pTaps,pState,tapsFactor);
end;
function ippsIIRSetTaps32sc(pTaps:PIpp32sc;pState:PIppsIIRState32sc_16sc;tapsFactor:longint):IppStatus;
begin
result:=ippsIIRSetTaps32sc_16sc(pTaps,pState,tapsFactor);
end;
function ippsIIRSetTaps32s(pTaps:PIpp32f;pState:PIppsIIRState32s_16s):IppStatus;
begin
result:=ippsIIRSetTaps32s_16s32f(pTaps,pState);
end;
function ippsIIRSetTaps32sc(pTaps:PIpp32fc;pState:PIppsIIRState32sc_16sc):IppStatus;
begin
result:=ippsIIRSetTaps32sc_16sc32fc(pTaps,pState);
end;
function ippsIIRSetTaps(pTaps:PIpp64f;pState:PIppsIIRState_64f):IppStatus;
begin
result:=ippsIIRSetTaps_64f(pTaps,pState);
end;
function ippsIIRSetTaps(pTaps:PIpp64fc;pState:PIppsIIRState_64fc):IppStatus;
begin
result:=ippsIIRSetTaps_64fc(pTaps,pState);
end;
function ippsIIRSetTaps64f(pTaps:PIpp64f;pState:PIppsIIRState64f_32f):IppStatus;
begin
result:=ippsIIRSetTaps64f_32f(pTaps,pState);
end;
function ippsIIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsIIRState64fc_32fc):IppStatus;
begin
result:=ippsIIRSetTaps64fc_32fc(pTaps,pState);
end;
function ippsIIRSetTaps64f(pTaps:PIpp64f;pState:PIppsIIRState64f_32s):IppStatus;
begin
result:=ippsIIRSetTaps64f_32s(pTaps,pState);
end;
function ippsIIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsIIRState64fc_32sc):IppStatus;
begin
result:=ippsIIRSetTaps64fc_32sc(pTaps,pState);
end;
function ippsIIRSetTaps64f(pTaps:PIpp64f;pState:PIppsIIRState64f_16s):IppStatus;
begin
result:=ippsIIRSetTaps64f_16s(pTaps,pState);
end;
function ippsIIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsIIRState64fc_16sc):IppStatus;
begin
result:=ippsIIRSetTaps64fc_16sc(pTaps,pState);
end;
function ippsFIRInitAlloc(var pState:PIppsFIRState_32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRInitAlloc_32f(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc(var pState:PIppsFIRState_32f;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRMRInitAlloc_32f(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc(var pState:PIppsFIRState_32fc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRInitAlloc_32fc(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc(var pState:PIppsFIRState_32fc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRMRInitAlloc_32fc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc32f(var pState:PIppsFIRState32f_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRInitAlloc32f_16s(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc32f(var pState:PIppsFIRState32f_16s;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRMRInitAlloc32f_16s(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc32fc(var pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRInitAlloc32fc_16sc(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc32fc(var pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRMRInitAlloc32fc_16sc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc(var pState:PIppsFIRState_64f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsFIRInitAlloc_64f(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc(var pState:PIppsFIRState_64f;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsFIRMRInitAlloc_64f(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc(var pState:PIppsFIRState_64fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsFIRInitAlloc_64fc(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc(var pState:PIppsFIRState_64fc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsFIRMRInitAlloc_64fc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc64f(var pState:PIppsFIRState64f_32f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRInitAlloc64f_32f(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc64f(var pState:PIppsFIRState64f_32f;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRMRInitAlloc64f_32f(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc64fc(var pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRInitAlloc64fc_32fc(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc64fc(var pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRMRInitAlloc64fc_32fc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc64f(var pState:PIppsFIRState64f_32s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsFIRInitAlloc64f_32s(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc64f(var pState:PIppsFIRState64f_32s;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsFIRMRInitAlloc64f_32s(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc64fc(var pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsFIRInitAlloc64fc_32sc(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc64fc(var pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsFIRMRInitAlloc64fc_32sc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc64f(var pState:PIppsFIRState64f_16s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRInitAlloc64f_16s(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc64f(var pState:PIppsFIRState64f_16s;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRMRInitAlloc64f_16s(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc64fc(var pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRInitAlloc64fc_16sc(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc64fc(var pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRMRInitAlloc64fc_16sc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRFree(pState:PIppsFIRState_32f):IppStatus;
begin
result:=ippsFIRFree_32f(pState);
end;
function ippsFIRFree(pState:PIppsFIRState_32fc):IppStatus;
begin
result:=ippsFIRFree_32fc(pState);
end;
function ippsFIRFree32f(pState:PIppsFIRState32f_16s):IppStatus;
begin
result:=ippsFIRFree32f_16s(pState);
end;
function ippsFIRFree32fc(pState:PIppsFIRState32fc_16sc):IppStatus;
begin
result:=ippsFIRFree32fc_16sc(pState);
end;
function ippsFIRFree(pState:PIppsFIRState_64f):IppStatus;
begin
result:=ippsFIRFree_64f(pState);
end;
function ippsFIRFree(pState:PIppsFIRState_64fc):IppStatus;
begin
result:=ippsFIRFree_64fc(pState);
end;
function ippsFIRFree64f(pState:PIppsFIRState64f_32f):IppStatus;
begin
result:=ippsFIRFree64f_32f(pState);
end;
function ippsFIRFree64fc(pState:PIppsFIRState64fc_32fc):IppStatus;
begin
result:=ippsFIRFree64fc_32fc(pState);
end;
function ippsFIRFree64f(pState:PIppsFIRState64f_32s):IppStatus;
begin
result:=ippsFIRFree64f_32s(pState);
end;
function ippsFIRFree64fc(pState:PIppsFIRState64fc_32sc):IppStatus;
begin
result:=ippsFIRFree64fc_32sc(pState);
end;
function ippsFIRFree64f(pState:PIppsFIRState64f_16s):IppStatus;
begin
result:=ippsFIRFree64f_16s(pState);
end;
function ippsFIRFree64fc(pState:PIppsFIRState64fc_16sc):IppStatus;
begin
result:=ippsFIRFree64fc_16sc(pState);
end;
function ippsFIRGetStateSize32s(tapsLen:longint;pStateSize:Plongint):IppStatus;
begin
result:=ippsFIRGetStateSize32s_16s(tapsLen,pStateSize);
end;
function ippsFIRInit32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit32s_16s(pState,pTaps,tapsLen,tapsFactor,pDlyLine,pBuffer);
end;
function ippsFIRMRGetStateSize32s(tapsLen:longint;upFactor:longint;downFactor:longint;pStateSize:Plongint):IppStatus;
begin
result:=ippsFIRMRGetStateSize32s_16s(tapsLen,upFactor,downFactor,pStateSize);
end;
function ippsFIRMRInit32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit32s_16s(pState,pTaps,tapsLen,tapsFactor,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRInit32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit32sc_16sc(pState,pTaps,tapsLen,tapsFactor,pDlyLine,pBuffer);
end;
function ippsFIRMRGetStateSize32sc(tapsLen:longint;upFactor:longint;downFactor:longint;pStateSize:Plongint):IppStatus;
begin
result:=ippsFIRMRGetStateSize32sc_16sc(tapsLen,upFactor,downFactor,pStateSize);
end;
function ippsFIRMRInit32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit32sc_16sc(pState,pTaps,tapsLen,tapsFactor,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRGetStateSize32sc(tapsLen:longint;pStateSize:Plongint):IppStatus;
begin
result:=ippsFIRGetStateSize32sc_16sc32fc(tapsLen,pStateSize);
end;
function ippsFIRInit32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit32s_16s32f(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRMRInit32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit32s_16s32f(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRInit32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit32sc_16sc32fc(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRMRInit32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit32sc_16sc32fc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRInit(var pState:PIppsFIRState_32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit_32f(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRInit(var pState:PIppsFIRState_32fc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit_32fc(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRGetStateSize(tapsLen:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRGetStateSize_32f(tapsLen,pBufferSize);
end;
function ippsFIRMRInit(var pState:PIppsFIRState_32f;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit_32f(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRMRGetStateSize(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRMRGetStateSize_32f(tapsLen,upFactor,downFactor,pBufferSize);
end;
function ippsFIRMRInit(var pState:PIppsFIRState_32fc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit_32fc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRGetStateSize32f(tapsLen:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRGetStateSize32f_16s(tapsLen,pBufferSize);
end;
function ippsFIRInit32f(var pState:PIppsFIRState32f_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit32f_16s(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRGetStateSize32fc(tapsLen:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRGetStateSize32fc_16sc(tapsLen,pBufferSize);
end;
function ippsFIRInit32fc(var pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit32fc_16sc(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRMRGetStateSize32f(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRMRGetStateSize32f_16s(tapsLen,upFactor,downFactor,pBufferSize);
end;
function ippsFIRMRInit32f(var pState:PIppsFIRState32f_16s;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit32f_16s(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRMRGetStateSize32fc(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRMRGetStateSize32fc_16sc(tapsLen,upFactor,downFactor,pBufferSize);
end;
function ippsFIRMRInit32fc(var pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit32fc_16sc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRInit(var pState:PIppsFIRState_64f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit_64f(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRInit(var pState:PIppsFIRState_64fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit_64fc(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRMRInit(var pState:PIppsFIRState_64f;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit_64f(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRMRInit(var pState:PIppsFIRState_64fc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit_64fc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRGetStateSize64f(tapsLen:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRGetStateSize64f_16s(tapsLen,pBufferSize);
end;
function ippsFIRInit64f(var pState:PIppsFIRState64f_16s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit64f_16s(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRGetStateSize64fc(tapsLen:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRGetStateSize64fc_16sc(tapsLen,pBufferSize);
end;
function ippsFIRInit64fc(var pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit64fc_16sc(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRMRGetStateSize64f(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRMRGetStateSize64f_16s(tapsLen,upFactor,downFactor,pBufferSize);
end;
function ippsFIRMRInit64f(var pState:PIppsFIRState64f_16s;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit64f_16s(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRMRGetStateSize64fc(tapsLen:longint;upFactor:longint;downFactor:longint;pBufferSize:Plongint):IppStatus;
begin
result:=ippsFIRMRGetStateSize64fc_16sc(tapsLen,upFactor,downFactor,pBufferSize);
end;
function ippsFIRMRInit64fc(var pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit64fc_16sc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRInit64f(var pState:PIppsFIRState64f_32s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit64f_32s(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRInit64fc(var pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit64fc_32sc(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRMRInit64f(var pState:PIppsFIRState64f_32s;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32s;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit64f_32s(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRMRInit64fc(var pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32sc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit64fc_32sc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRInit64f(var pState:PIppsFIRState64f_32f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit64f_32f(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRInit64fc(var pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRInit64fc_32fc(pState,pTaps,tapsLen,pDlyLine,pBuffer);
end;
function ippsFIRMRInit64f(var pState:PIppsFIRState64f_32f;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit64f_32f(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRMRInit64fc(var pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc;pBuffer:PIpp8u):IppStatus;
begin
result:=ippsFIRMRInit64fc_32fc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,pBuffer);
end;
function ippsFIRGetTaps(pState:PIppsFIRState_32f;pTaps:PIpp32f):IppStatus;
begin
result:=ippsFIRGetTaps_32f(pState,pTaps);
end;
function ippsFIRGetTaps(pState:PIppsFIRState_32fc;pTaps:PIpp32fc):IppStatus;
begin
result:=ippsFIRGetTaps_32fc(pState,pTaps);
end;
function ippsFIRGetTaps32f(pState:PIppsFIRState32f_16s;pTaps:PIpp32f):IppStatus;
begin
result:=ippsFIRGetTaps32f_16s(pState,pTaps);
end;
function ippsFIRGetTaps32fc(pState:PIppsFIRState32fc_16sc;pTaps:PIpp32fc):IppStatus;
begin
result:=ippsFIRGetTaps32fc_16sc(pState,pTaps);
end;
function ippsFIRGetTaps(pState:PIppsFIRState_64f;pTaps:PIpp64f):IppStatus;
begin
result:=ippsFIRGetTaps_64f(pState,pTaps);
end;
function ippsFIRGetTaps(pState:PIppsFIRState_64fc;pTaps:PIpp64fc):IppStatus;
begin
result:=ippsFIRGetTaps_64fc(pState,pTaps);
end;
function ippsFIRGetTaps64f(pState:PIppsFIRState64f_32f;pTaps:PIpp64f):IppStatus;
begin
result:=ippsFIRGetTaps64f_32f(pState,pTaps);
end;
function ippsFIRGetTaps64fc(pState:PIppsFIRState64fc_32fc;pTaps:PIpp64fc):IppStatus;
begin
result:=ippsFIRGetTaps64fc_32fc(pState,pTaps);
end;
function ippsFIRGetTaps64f(pState:PIppsFIRState64f_32s;pTaps:PIpp64f):IppStatus;
begin
result:=ippsFIRGetTaps64f_32s(pState,pTaps);
end;
function ippsFIRGetTaps64fc(pState:PIppsFIRState64fc_32sc;pTaps:PIpp64fc):IppStatus;
begin
result:=ippsFIRGetTaps64fc_32sc(pState,pTaps);
end;
function ippsFIRGetTaps64f(pState:PIppsFIRState64f_16s;pTaps:PIpp64f):IppStatus;
begin
result:=ippsFIRGetTaps64f_16s(pState,pTaps);
end;
function ippsFIRGetTaps64fc(pState:PIppsFIRState64fc_16sc;pTaps:PIpp64fc):IppStatus;
begin
result:=ippsFIRGetTaps64fc_16sc(pState,pTaps);
end;
function ippsFIRSetTaps(pTaps:PIpp32f;pState:PIppsFIRState_32f):IppStatus;
begin
result:=ippsFIRSetTaps_32f(pTaps,pState);
end;
function ippsFIRSetTaps(pTaps:PIpp32fc;pState:PIppsFIRState_32fc):IppStatus;
begin
result:=ippsFIRSetTaps_32fc(pTaps,pState);
end;
function ippsFIRSetTaps32f(pTaps:PIpp32f;pState:PIppsFIRState32f_16s):IppStatus;
begin
result:=ippsFIRSetTaps32f_16s(pTaps,pState);
end;
function ippsFIRSetTaps32fc(pTaps:PIpp32fc;pState:PIppsFIRState32fc_16sc):IppStatus;
begin
result:=ippsFIRSetTaps32fc_16sc(pTaps,pState);
end;
function ippsFIRSetTaps32s(pTaps:PIpp32s;pState:PIppsFIRState32s_16s;tapsFactor:longint):IppStatus;
begin
result:=ippsFIRSetTaps32s_16s(pTaps,pState,tapsFactor);
end;
function ippsFIRSetTaps32sc(pTaps:PIpp32sc;pState:PIppsFIRState32sc_16sc;tapsFactor:longint):IppStatus;
begin
result:=ippsFIRSetTaps32sc_16sc(pTaps,pState,tapsFactor);
end;
function ippsFIRSetTaps32s(pTaps:PIpp32f;pState:PIppsFIRState32s_16s):IppStatus;
begin
result:=ippsFIRSetTaps32s_16s32f(pTaps,pState);
end;
function ippsFIRSetTaps32sc(pTaps:PIpp32fc;pState:PIppsFIRState32sc_16sc):IppStatus;
begin
result:=ippsFIRSetTaps32sc_16sc32fc(pTaps,pState);
end;
function ippsFIRSetTaps(pTaps:PIpp64f;pState:PIppsFIRState_64f):IppStatus;
begin
result:=ippsFIRSetTaps_64f(pTaps,pState);
end;
function ippsFIRSetTaps(pTaps:PIpp64fc;pState:PIppsFIRState_64fc):IppStatus;
begin
result:=ippsFIRSetTaps_64fc(pTaps,pState);
end;
function ippsFIRSetTaps64f(pTaps:PIpp64f;pState:PIppsFIRState64f_32f):IppStatus;
begin
result:=ippsFIRSetTaps64f_32f(pTaps,pState);
end;
function ippsFIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsFIRState64fc_32fc):IppStatus;
begin
result:=ippsFIRSetTaps64fc_32fc(pTaps,pState);
end;
function ippsFIRSetTaps64f(pTaps:PIpp64f;pState:PIppsFIRState64f_32s):IppStatus;
begin
result:=ippsFIRSetTaps64f_32s(pTaps,pState);
end;
function ippsFIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsFIRState64fc_32sc):IppStatus;
begin
result:=ippsFIRSetTaps64fc_32sc(pTaps,pState);
end;
function ippsFIRSetTaps64f(pTaps:PIpp64f;pState:PIppsFIRState64f_16s):IppStatus;
begin
result:=ippsFIRSetTaps64f_16s(pTaps,pState);
end;
function ippsFIRSetTaps64fc(pTaps:PIpp64fc;pState:PIppsFIRState64fc_16sc):IppStatus;
begin
result:=ippsFIRSetTaps64fc_16sc(pTaps,pState);
end;
function ippsFIRGetDlyLine(pState:PIppsFIRState_32f;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRGetDlyLine_32f(pState,pDlyLine);
end;
function ippsFIRSetDlyLine(pState:PIppsFIRState_32f;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRSetDlyLine_32f(pState,pDlyLine);
end;
function ippsFIRGetDlyLine(pState:PIppsFIRState_32fc;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRGetDlyLine_32fc(pState,pDlyLine);
end;
function ippsFIRSetDlyLine(pState:PIppsFIRState_32fc;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRSetDlyLine_32fc(pState,pDlyLine);
end;
function ippsFIRGetDlyLine32f(pState:PIppsFIRState32f_16s;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRGetDlyLine32f_16s(pState,pDlyLine);
end;
function ippsFIRSetDlyLine32f(pState:PIppsFIRState32f_16s;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRSetDlyLine32f_16s(pState,pDlyLine);
end;
function ippsFIRGetDlyLine32fc(pState:PIppsFIRState32fc_16sc;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRGetDlyLine32fc_16sc(pState,pDlyLine);
end;
function ippsFIRSetDlyLine32fc(pState:PIppsFIRState32fc_16sc;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRSetDlyLine32fc_16sc(pState,pDlyLine);
end;
function ippsFIRGetDlyLine(pState:PIppsFIRState_64f;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsFIRGetDlyLine_64f(pState,pDlyLine);
end;
function ippsFIRSetDlyLine(pState:PIppsFIRState_64f;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsFIRSetDlyLine_64f(pState,pDlyLine);
end;
function ippsFIRGetDlyLine(pState:PIppsFIRState_64fc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsFIRGetDlyLine_64fc(pState,pDlyLine);
end;
function ippsFIRSetDlyLine(pState:PIppsFIRState_64fc;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsFIRSetDlyLine_64fc(pState,pDlyLine);
end;
function ippsFIRGetDlyLine64f(pState:PIppsFIRState64f_32f;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRGetDlyLine64f_32f(pState,pDlyLine);
end;
function ippsFIRSetDlyLine64f(pState:PIppsFIRState64f_32f;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRSetDlyLine64f_32f(pState,pDlyLine);
end;
function ippsFIRGetDlyLine64fc(pState:PIppsFIRState64fc_32fc;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRGetDlyLine64fc_32fc(pState,pDlyLine);
end;
function ippsFIRSetDlyLine64fc(pState:PIppsFIRState64fc_32fc;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRSetDlyLine64fc_32fc(pState,pDlyLine);
end;
function ippsFIRGetDlyLine64f(pState:PIppsFIRState64f_32s;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsFIRGetDlyLine64f_32s(pState,pDlyLine);
end;
function ippsFIRSetDlyLine64f(pState:PIppsFIRState64f_32s;pDlyLine:PIpp32s):IppStatus;
begin
result:=ippsFIRSetDlyLine64f_32s(pState,pDlyLine);
end;
function ippsFIRGetDlyLine64fc(pState:PIppsFIRState64fc_32sc;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsFIRGetDlyLine64fc_32sc(pState,pDlyLine);
end;
function ippsFIRSetDlyLine64fc(pState:PIppsFIRState64fc_32sc;pDlyLine:PIpp32sc):IppStatus;
begin
result:=ippsFIRSetDlyLine64fc_32sc(pState,pDlyLine);
end;
function ippsFIRGetDlyLine64f(pState:PIppsFIRState64f_16s;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRGetDlyLine64f_16s(pState,pDlyLine);
end;
function ippsFIRSetDlyLine64f(pState:PIppsFIRState64f_16s;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRSetDlyLine64f_16s(pState,pDlyLine);
end;
function ippsFIRGetDlyLine64fc(pState:PIppsFIRState64fc_16sc;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRGetDlyLine64fc_16sc(pState,pDlyLine);
end;
function ippsFIRSetDlyLine64fc(pState:PIppsFIRState64fc_16sc;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRSetDlyLine64fc_16sc(pState,pDlyLine);
end;
function ippsFIROne(src:Ipp32f;pDstVal:PIpp32f;pState:PIppsFIRState_32f):IppStatus;
begin
result:=ippsFIROne_32f(src,pDstVal,pState);
end;
function ippsFIROne(src:Ipp32fc;pDstVal:PIpp32fc;pState:PIppsFIRState_32fc):IppStatus;
begin
result:=ippsFIROne_32fc(src,pDstVal,pState);
end;
function ippsFIROne32f(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsFIRState32f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32f_16s_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsFIROne32fc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsFIRState32fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32fc_16sc_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsFIROne(src:Ipp64f;pDstVal:PIpp64f;pState:PIppsFIRState_64f):IppStatus;
begin
result:=ippsFIROne_64f(src,pDstVal,pState);
end;
function ippsFIROne(src:Ipp64fc;pDstVal:PIpp64fc;pState:PIppsFIRState_64fc):IppStatus;
begin
result:=ippsFIROne_64fc(src,pDstVal,pState);
end;
function ippsFIROne64f(src:Ipp32f;pDstVal:PIpp32f;pState:PIppsFIRState64f_32f):IppStatus;
begin
result:=ippsFIROne64f_32f(src,pDstVal,pState);
end;
function ippsFIROne64fc(src:Ipp32fc;pDstVal:PIpp32fc;pState:PIppsFIRState64fc_32fc):IppStatus;
begin
result:=ippsFIROne64fc_32fc(src,pDstVal,pState);
end;
function ippsFIROne64f(src:Ipp32s;pDstVal:PIpp32s;pState:PIppsFIRState64f_32s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64f_32s_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsFIROne64fc(src:Ipp32sc;pDstVal:PIpp32sc;pState:PIppsFIRState64fc_32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64fc_32sc_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsFIROne64f(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsFIRState64f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64f_16s_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsFIROne64fc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsFIRState64fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64fc_16sc_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsFIR(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pState:PIppsFIRState_32f):IppStatus;
begin
result:=ippsFIR_32f(pSrc,pDst,numIters,pState);
end;
function ippsFIR(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pState:PIppsFIRState_32fc):IppStatus;
begin
result:=ippsFIR_32fc(pSrc,pDst,numIters,pState);
end;
function ippsFIR32f(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pState:PIppsFIRState32f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32f_16s_Sfs(pSrc,pDst,numIters,pState,scaleFactor);
end;
function ippsFIR32fc(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pState:PIppsFIRState32fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32fc_16sc_Sfs(pSrc,pDst,numIters,pState,scaleFactor);
end;
function ippsFIR(pSrcDst:PIpp32f;numIters:longint;pState:PIppsFIRState_32f):IppStatus;
begin
result:=ippsFIR_32f_I(pSrcDst,numIters,pState);
end;
function ippsFIR(pSrcDst:PIpp32fc;numIters:longint;pState:PIppsFIRState_32fc):IppStatus;
begin
result:=ippsFIR_32fc_I(pSrcDst,numIters,pState);
end;
function ippsFIR32f(pSrcDst:PIpp16s;numIters:longint;pState:PIppsFIRState32f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32f_16s_ISfs(pSrcDst,numIters,pState,scaleFactor);
end;
function ippsFIR32fc(pSrcDst:PIpp16sc;numIters:longint;pState:PIppsFIRState32fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32fc_16sc_ISfs(pSrcDst,numIters,pState,scaleFactor);
end;
function ippsFIR(pSrc:PIpp64f;pDst:PIpp64f;numIters:longint;pState:PIppsFIRState_64f):IppStatus;
begin
result:=ippsFIR_64f(pSrc,pDst,numIters,pState);
end;
function ippsFIR(pSrc:PIpp64fc;pDst:PIpp64fc;numIters:longint;pState:PIppsFIRState_64fc):IppStatus;
begin
result:=ippsFIR_64fc(pSrc,pDst,numIters,pState);
end;
function ippsFIR(pSrcDst:PIpp64f;numIters:longint;pState:PIppsFIRState_64f):IppStatus;
begin
result:=ippsFIR_64f_I(pSrcDst,numIters,pState);
end;
function ippsFIR(pSrcDst:PIpp64fc;numIters:longint;pState:PIppsFIRState_64fc):IppStatus;
begin
result:=ippsFIR_64fc_I(pSrcDst,numIters,pState);
end;
function ippsFIR64f(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pState:PIppsFIRState64f_32f):IppStatus;
begin
result:=ippsFIR64f_32f(pSrc,pDst,numIters,pState);
end;
function ippsFIR64fc(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pState:PIppsFIRState64fc_32fc):IppStatus;
begin
result:=ippsFIR64fc_32fc(pSrc,pDst,numIters,pState);
end;
function ippsFIR64f(pSrcDst:PIpp32f;numIters:longint;pState:PIppsFIRState64f_32f):IppStatus;
begin
result:=ippsFIR64f_32f_I(pSrcDst,numIters,pState);
end;
function ippsFIR64fc(pSrcDst:PIpp32fc;numIters:longint;pState:PIppsFIRState64fc_32fc):IppStatus;
begin
result:=ippsFIR64fc_32fc_I(pSrcDst,numIters,pState);
end;
function ippsFIR64f(pSrc:PIpp32s;pDst:PIpp32s;numIters:longint;pState:PIppsFIRState64f_32s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64f_32s_Sfs(pSrc,pDst,numIters,pState,scaleFactor);
end;
function ippsFIR64fc(pSrc:PIpp32sc;pDst:PIpp32sc;numIters:longint;pState:PIppsFIRState64fc_32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64fc_32sc_Sfs(pSrc,pDst,numIters,pState,scaleFactor);
end;
function ippsFIR64f(pSrcDst:PIpp32s;numIters:longint;pState:PIppsFIRState64f_32s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64f_32s_ISfs(pSrcDst,numIters,pState,scaleFactor);
end;
function ippsFIR64fc(pSrcDst:PIpp32sc;numIters:longint;pState:PIppsFIRState64fc_32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64fc_32sc_ISfs(pSrcDst,numIters,pState,scaleFactor);
end;
function ippsFIR64f(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pState:PIppsFIRState64f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64f_16s_Sfs(pSrc,pDst,numIters,pState,scaleFactor);
end;
function ippsFIR64fc(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pState:PIppsFIRState64fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64fc_16sc_Sfs(pSrc,pDst,numIters,pState,scaleFactor);
end;
function ippsFIR64f(pSrcDst:PIpp16s;numIters:longint;pState:PIppsFIRState64f_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64f_16s_ISfs(pSrcDst,numIters,pState,scaleFactor);
end;
function ippsFIR64fc(pSrcDst:PIpp16sc;numIters:longint;pState:PIppsFIRState64fc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64fc_16sc_ISfs(pSrcDst,numIters,pState,scaleFactor);
end;
function ippsFIRInitAlloc32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRInitAlloc32s_16s(pState,pTaps,tapsLen,tapsFactor,pDlyLine);
end;
function ippsFIRMRInitAlloc32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRMRInitAlloc32s_16s(pState,pTaps,tapsLen,tapsFactor,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRInitAlloc32s_16s32f(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc32s(var pState:PIppsFIRState32s_16s;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRMRInitAlloc32s_16s32f(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRInitAlloc32sc_16sc(pState,pTaps,tapsLen,tapsFactor,pDlyLine);
end;
function ippsFIRMRInitAlloc32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRMRInitAlloc32sc_16sc(pState,pTaps,tapsLen,tapsFactor,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRInitAlloc32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRInitAlloc32sc_16sc32fc(pState,pTaps,tapsLen,pDlyLine);
end;
function ippsFIRMRInitAlloc32sc(var pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRMRInitAlloc32sc_16sc32fc(pState,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRFree32s(pState:PIppsFIRState32s_16s):IppStatus;
begin
result:=ippsFIRFree32s_16s(pState);
end;
function ippsFIRFree32sc(pState:PIppsFIRState32sc_16sc):IppStatus;
begin
result:=ippsFIRFree32sc_16sc(pState);
end;
function ippsFIRGetTaps32s(pState:PIppsFIRState32s_16s;pTaps:PIpp32s;tapsFactor:Plongint):IppStatus;
begin
result:=ippsFIRGetTaps32s_16s(pState,pTaps,tapsFactor);
end;
function ippsFIRGetTaps32sc(pState:PIppsFIRState32sc_16sc;pTaps:PIpp32sc;tapsFactor:Plongint):IppStatus;
begin
result:=ippsFIRGetTaps32sc_16sc(pState,pTaps,tapsFactor);
end;
function ippsFIRGetTaps32s(pState:PIppsFIRState32s_16s;pTaps:PIpp32f):IppStatus;
begin
result:=ippsFIRGetTaps32s_16s32f(pState,pTaps);
end;
function ippsFIRGetTaps32sc(pState:PIppsFIRState32sc_16sc;pTaps:PIpp32fc):IppStatus;
begin
result:=ippsFIRGetTaps32sc_16sc32fc(pState,pTaps);
end;
function ippsFIRGetDlyLine32s(pState:PIppsFIRState32s_16s;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRGetDlyLine32s_16s(pState,pDlyLine);
end;
function ippsFIRSetDlyLine32s(pState:PIppsFIRState32s_16s;pDlyLine:PIpp16s):IppStatus;
begin
result:=ippsFIRSetDlyLine32s_16s(pState,pDlyLine);
end;
function ippsFIRGetDlyLine32sc(pState:PIppsFIRState32sc_16sc;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRGetDlyLine32sc_16sc(pState,pDlyLine);
end;
function ippsFIRSetDlyLine32sc(pState:PIppsFIRState32sc_16sc;pDlyLine:PIpp16sc):IppStatus;
begin
result:=ippsFIRSetDlyLine32sc_16sc(pState,pDlyLine);
end;
function ippsFIROne32s(src:Ipp16s;pDstVal:PIpp16s;pState:PIppsFIRState32s_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32s_16s_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsFIROne32sc(src:Ipp16sc;pDstVal:PIpp16sc;pState:PIppsFIRState32sc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32sc_16sc_Sfs(src,pDstVal,pState,scaleFactor);
end;
function ippsFIR32s(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pState:PIppsFIRState32s_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32s_16s_Sfs(pSrc,pDst,numIters,pState,scaleFactor);
end;
function ippsFIR32sc(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pState:PIppsFIRState32sc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32sc_16sc_Sfs(pSrc,pDst,numIters,pState,scaleFactor);
end;
function ippsFIR32s(pSrcDst:PIpp16s;numIters:longint;pState:PIppsFIRState32s_16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32s_16s_ISfs(pSrcDst,numIters,pState,scaleFactor);
end;
function ippsFIR32sc(pSrcDst:PIpp16sc;numIters:longint;pState:PIppsFIRState32sc_16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32sc_16sc_ISfs(pSrcDst,numIters,pState,scaleFactor);
end;
function ippsFIRLMSOne_Direct(src:Ipp32f;refval:Ipp32f;pDstVal:PIpp32f;pTapsInv:PIpp32f;tapsLen:longint;mu:single;pDlyLine:PIpp32f;pDlyIndex:Plongint):IppStatus;
begin
result:=ippsFIRLMSOne_Direct_32f(src,refval,pDstVal,pTapsInv,tapsLen,mu,pDlyLine,pDlyIndex);
end;
function ippsFIRLMSOne_Direct32f(src:Ipp16s;refval:Ipp16s;pDstVal:PIpp16s;pTapsInv:PIpp32f;tapsLen:longint;mu:single;pDlyLine:PIpp16s;pDlyIndex:Plongint):IppStatus;
begin
result:=ippsFIRLMSOne_Direct32f_16s(src,refval,pDstVal,pTapsInv,tapsLen,mu,pDlyLine,pDlyIndex);
end;
function ippsFIRLMSOne_DirectQ15(src:Ipp16s;refval:Ipp16s;pDstVal:PIpp16s;pTapsInv:PIpp32s;tapsLen:longint;muQ15:longint;pDlyLine:PIpp16s;pDlyIndex:Plongint):IppStatus;
begin
result:=ippsFIRLMSOne_DirectQ15_16s(src,refval,pDstVal,pTapsInv,tapsLen,muQ15,pDlyLine,pDlyIndex);
end;
function ippsFIRLMS(pSrc:PIpp32f;pRef:PIpp32f;pDst:PIpp32f;len:longint;mu:single;pState:PIppsFIRLMSState_32f):IppStatus;
begin
result:=ippsFIRLMS_32f(pSrc,pRef,pDst,len,mu,pState);
end;
function ippsFIRLMS32f(pSrc:PIpp16s;pRef:PIpp16s;pDst:PIpp16s;len:longint;mu:single;pStatel:PIppsFIRLMSState32f_16s):IppStatus;
begin
result:=ippsFIRLMS32f_16s(pSrc,pRef,pDst,len,mu,pStatel);
end;
function ippsFIRLMSInitAlloc(var pState:PIppsFIRLMSState_32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;dlyLineIndex:longint):IppStatus;
begin
result:=ippsFIRLMSInitAlloc_32f(pState,pTaps,tapsLen,pDlyLine,dlyLineIndex);
end;
function ippsFIRLMSInitAlloc32f(var pState:PIppsFIRLMSState32f_16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;dlyLineIndex:longint):IppStatus;
begin
result:=ippsFIRLMSInitAlloc32f_16s(pState,pTaps,tapsLen,pDlyLine,dlyLineIndex);
end;
function ippsFIRLMSFree(pState:PIppsFIRLMSState_32f):IppStatus;
begin
result:=ippsFIRLMSFree_32f(pState);
end;
function ippsFIRLMSFree32f(pState:PIppsFIRLMSState32f_16s):IppStatus;
begin
result:=ippsFIRLMSFree32f_16s(pState);
end;
function ippsFIRLMSGetTaps(pState:PIppsFIRLMSState_32f;pOutTaps:PIpp32f):IppStatus;
begin
result:=ippsFIRLMSGetTaps_32f(pState,pOutTaps);
end;
function ippsFIRLMSGetTaps32f(pState:PIppsFIRLMSState32f_16s;pOutTaps:PIpp32f):IppStatus;
begin
result:=ippsFIRLMSGetTaps32f_16s(pState,pOutTaps);
end;
function ippsFIRLMSGetDlyLine(pState:PIppsFIRLMSState_32f;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIRLMSGetDlyLine_32f(pState,pDlyLine,pDlyLineIndex);
end;
function ippsFIRLMSGetDlyLine32f(pState:PIppsFIRLMSState32f_16s;pDlyLine:PIpp16s;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIRLMSGetDlyLine32f_16s(pState,pDlyLine,pDlyLineIndex);
end;
function ippsFIRLMSSetDlyLine(pState:PIppsFIRLMSState_32f;pDlyLine:PIpp32f;dlyLineIndex:longint):IppStatus;
begin
result:=ippsFIRLMSSetDlyLine_32f(pState,pDlyLine,dlyLineIndex);
end;
function ippsFIRLMSSetDlyLine32f(pState:PIppsFIRLMSState32f_16s;pDlyLine:PIpp16s;dlyLineIndex:longint):IppStatus;
begin
result:=ippsFIRLMSSetDlyLine32f_16s(pState,pDlyLine,dlyLineIndex);
end;
function ippsFIRLMSMROne32s(pDstVal:PIpp32s;pState:PIppsFIRLMSMRState32s_16s):IppStatus;
begin
result:=ippsFIRLMSMROne32s_16s(pDstVal,pState);
end;
function ippsFIRLMSMROneVal32s(val:Ipp16s;pDstVal:PIpp32s;pState:PIppsFIRLMSMRState32s_16s):IppStatus;
begin
result:=ippsFIRLMSMROneVal32s_16s(val,pDstVal,pState);
end;
function ippsFIRLMSMROne32sc(pDstVal:PIpp32sc;pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;
begin
result:=ippsFIRLMSMROne32sc_16sc(pDstVal,pState);
end;
function ippsFIRLMSMROneVal32sc(val:Ipp16sc;pDstVal:PIpp32sc;pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;
begin
result:=ippsFIRLMSMROneVal32sc_16sc(val,pDstVal,pState);
end;
function ippsFIRLMSMRInitAlloc32s(var pState:PIppsFIRLMSMRState32s_16s;pTaps:PIpp32s;tapsLen:longint;pDlyLine:PIpp16s;dlyLineIndex:longint;dlyStep:longint;updateDly:longint;mu:longint):IppStatus;
begin
result:=ippsFIRLMSMRInitAlloc32s_16s(pState,pTaps,tapsLen,pDlyLine,dlyLineIndex,dlyStep,updateDly,mu);
end;
function ippsFIRLMSMRFree32s(pState:PIppsFIRLMSMRState32s_16s):IppStatus;
begin
result:=ippsFIRLMSMRFree32s_16s(pState);
end;
function ippsFIRLMSMRInitAlloc32sc(var pState:PIppsFIRLMSMRState32sc_16sc;pTaps:PIpp32sc;tapsLen:longint;pDlyLine:PIpp16sc;dlyLineIndex:longint;dlyStep:longint;updateDly:longint;mu:longint):IppStatus;
begin
result:=ippsFIRLMSMRInitAlloc32sc_16sc(pState,pTaps,tapsLen,pDlyLine,dlyLineIndex,dlyStep,updateDly,mu);
end;
function ippsFIRLMSMRFree32sc(pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;
begin
result:=ippsFIRLMSMRFree32sc_16sc(pState);
end;
function ippsFIRLMSMRSetTaps32s(pState:PIppsFIRLMSMRState32s_16s;pInTaps:PIpp32s):IppStatus;
begin
result:=ippsFIRLMSMRSetTaps32s_16s(pState,pInTaps);
end;
function ippsFIRLMSMRGetTaps32s(pState:PIppsFIRLMSMRState32s_16s;pOutTaps:PIpp32s):IppStatus;
begin
result:=ippsFIRLMSMRGetTaps32s_16s(pState,pOutTaps);
end;
function ippsFIRLMSMRGetTapsPointer32s(pState:PIppsFIRLMSMRState32s_16s;var pTaps:PIpp32s):IppStatus;
begin
result:=ippsFIRLMSMRGetTapsPointer32s_16s(pState,pTaps);
end;
function ippsFIRLMSMRSetTaps32sc(pState:PIppsFIRLMSMRState32sc_16sc;pInTaps:PIpp32sc):IppStatus;
begin
result:=ippsFIRLMSMRSetTaps32sc_16sc(pState,pInTaps);
end;
function ippsFIRLMSMRGetTaps32sc(pState:PIppsFIRLMSMRState32sc_16sc;pOutTaps:PIpp32sc):IppStatus;
begin
result:=ippsFIRLMSMRGetTaps32sc_16sc(pState,pOutTaps);
end;
function ippsFIRLMSMRGetTapsPointer32sc(pState:PIppsFIRLMSMRState32sc_16sc;var pTaps:PIpp32sc):IppStatus;
begin
result:=ippsFIRLMSMRGetTapsPointer32sc_16sc(pState,pTaps);
end;
function ippsFIRLMSMRSetDlyLine32s(pState:PIppsFIRLMSMRState32s_16s;pInDlyLine:PIpp16s;dlyLineIndex:longint):IppStatus;
begin
result:=ippsFIRLMSMRSetDlyLine32s_16s(pState,pInDlyLine,dlyLineIndex);
end;
function ippsFIRLMSMRGetDlyLine32s(pState:PIppsFIRLMSMRState32s_16s;pOutDlyLine:PIpp16s;pOutDlyIndex:Plongint):IppStatus;
begin
result:=ippsFIRLMSMRGetDlyLine32s_16s(pState,pOutDlyLine,pOutDlyIndex);
end;
function ippsFIRLMSMRGetDlyVal32s(pState:PIppsFIRLMSMRState32s_16s;pOutVal:PIpp16s;index:longint):IppStatus;
begin
result:=ippsFIRLMSMRGetDlyVal32s_16s(pState,pOutVal,index);
end;
function ippsFIRLMSMRSetDlyLine32sc(pState:PIppsFIRLMSMRState32sc_16sc;pInDlyLine:PIpp16sc;dlyLineIndex:longint):IppStatus;
begin
result:=ippsFIRLMSMRSetDlyLine32sc_16sc(pState,pInDlyLine,dlyLineIndex);
end;
function ippsFIRLMSMRGetDlyLine32sc(pState:PIppsFIRLMSMRState32sc_16sc;pOutDlyLine:PIpp16sc;pOutDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIRLMSMRGetDlyLine32sc_16sc(pState,pOutDlyLine,pOutDlyLineIndex);
end;
function ippsFIRLMSMRGetDlyVal32sc(pState:PIppsFIRLMSMRState32sc_16sc;pOutVal:PIpp16sc;index:longint):IppStatus;
begin
result:=ippsFIRLMSMRGetDlyVal32sc_16sc(pState,pOutVal,index);
end;
function ippsFIRLMSMRPutVal32s(val:Ipp16s;pState:PIppsFIRLMSMRState32s_16s):IppStatus;
begin
result:=ippsFIRLMSMRPutVal32s_16s(val,pState);
end;
function ippsFIRLMSMRPutVal32sc(val:Ipp16sc;pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;
begin
result:=ippsFIRLMSMRPutVal32sc_16sc(val,pState);
end;
function ippsFIRLMSMRSetMu32s(pState:PIppsFIRLMSMRState32s_16s;mu:longint):IppStatus;
begin
result:=ippsFIRLMSMRSetMu32s_16s(pState,mu);
end;
function ippsFIRLMSMRSetMu32sc(pState:PIppsFIRLMSMRState32sc_16sc;mu:longint):IppStatus;
begin
result:=ippsFIRLMSMRSetMu32sc_16sc(pState,mu);
end;
function ippsFIRLMSMRUpdateTaps32s(ErrVal:Ipp32s;pState:PIppsFIRLMSMRState32s_16s):IppStatus;
begin
result:=ippsFIRLMSMRUpdateTaps32s_16s(ErrVal,pState);
end;
function ippsFIRLMSMRUpdateTaps32sc(ErrVal:Ipp32sc;pState:PIppsFIRLMSMRState32sc_16sc):IppStatus;
begin
result:=ippsFIRLMSMRUpdateTaps32sc_16sc(ErrVal,pState);
end;
function ippsFIROne_Direct(src:Ipp32f;pDstVal:PIpp32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne_Direct_32f(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne_Direct(src:Ipp32fc;pDstVal:PIpp32fc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne_Direct_32fc(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne_Direct(pSrcDstVal:PIpp32f;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne_Direct_32f_I(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne_Direct(pSrcDstVal:PIpp32fc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne_Direct_32fc_I(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne32f_Direct(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32f_Direct_16s_Sfs(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne32fc_Direct(src:Ipp16sc;pDstVal:PIpp16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32fc_Direct_16sc_Sfs(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne32f_Direct(pSrcDstVal:PIpp16s;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32f_Direct_16s_ISfs(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne32fc_Direct(pSrcDstVal:PIpp16sc;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32fc_Direct_16sc_ISfs(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne_Direct(src:Ipp64f;pDstVal:PIpp64f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne_Direct_64f(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne_Direct(src:Ipp64fc;pDstVal:PIpp64fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne_Direct_64fc(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne_Direct(pSrcDstVal:PIpp64f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne_Direct_64f_I(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne_Direct(pSrcDstVal:PIpp64fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne_Direct_64fc_I(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne64f_Direct(src:Ipp32f;pDstVal:PIpp32f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne64f_Direct_32f(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne64fc_Direct(src:Ipp32fc;pDstVal:PIpp32fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne64fc_Direct_32fc(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne64f_Direct(pSrcDstVal:PIpp32f;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne64f_Direct_32f_I(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne64fc_Direct(pSrcDstVal:PIpp32fc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIROne64fc_Direct_32fc_I(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIROne64f_Direct(src:Ipp32s;pDstVal:PIpp32s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64f_Direct_32s_Sfs(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne64fc_Direct(src:Ipp32sc;pDstVal:PIpp32sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64fc_Direct_32sc_Sfs(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne64f_Direct(pSrcDstVal:PIpp32s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64f_Direct_32s_ISfs(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne64fc_Direct(pSrcDstVal:PIpp32sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64fc_Direct_32sc_ISfs(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne64f_Direct(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64f_Direct_16s_Sfs(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne64fc_Direct(src:Ipp16sc;pDstVal:PIpp16sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64fc_Direct_16sc_Sfs(src,pDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne64f_Direct(pSrcDstVal:PIpp16s;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64f_Direct_16s_ISfs(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne64fc_Direct(pSrcDstVal:PIpp16sc;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne64fc_Direct_16sc_ISfs(pSrcDstVal,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne32s_Direct(src:Ipp16s;pDstVal:PIpp16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32s_Direct_16s_Sfs(src,pDstVal,pTaps,tapsLen,tapsFactor,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne32sc_Direct(src:Ipp16sc;pDstVal:PIpp16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32sc_Direct_16sc_Sfs(src,pDstVal,pTaps,tapsLen,tapsFactor,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne32s_Direct(pSrcDstVal:PIpp16s;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32s_Direct_16s_ISfs(pSrcDstVal,pTaps,tapsLen,tapsFactor,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne32sc_Direct(pSrcDstVal:PIpp16sc;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne32sc_Direct_16sc_ISfs(pSrcDstVal,pTaps,tapsLen,tapsFactor,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR_Direct(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR_Direct_32f(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR_Direct(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR_Direct_32fc(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR_Direct(pSrcDst:PIpp32f;numIters:longint;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR_Direct_32f_I(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR_Direct(pSrcDst:PIpp32fc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR_Direct_32fc_I(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR32f_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32f_Direct_16s_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR32fc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32fc_Direct_16sc_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR32f_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp32f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32f_Direct_16s_ISfs(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR32fc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32fc_Direct_16sc_ISfs(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR_Direct(pSrc:PIpp64f;pDst:PIpp64f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR_Direct_64f(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR_Direct(pSrc:PIpp64fc;pDst:PIpp64fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR_Direct_64fc(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR_Direct(pSrcDst:PIpp64f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp64f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR_Direct_64f_I(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR_Direct(pSrcDst:PIpp64fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp64fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR_Direct_64fc_I(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR64f_Direct(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR64f_Direct_32f(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR64fc_Direct(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR64fc_Direct_32fc(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR64f_Direct(pSrcDst:PIpp32f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32f;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR64f_Direct_32f_I(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR64fc_Direct(pSrcDst:PIpp32fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32fc;pDlyLineIndex:Plongint):IppStatus;
begin
result:=ippsFIR64fc_Direct_32fc_I(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex);
end;
function ippsFIR64f_Direct(pSrc:PIpp32s;pDst:PIpp32s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64f_Direct_32s_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR64fc_Direct(pSrc:PIpp32sc;pDst:PIpp32sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64fc_Direct_32sc_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR64f_Direct(pSrcDst:PIpp32s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp32s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64f_Direct_32s_ISfs(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR64fc_Direct(pSrcDst:PIpp32sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp32sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64fc_Direct_32sc_ISfs(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR64f_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64f_Direct_16s_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR64fc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64fc_Direct_16sc_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR64f_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64f_Direct_16s_ISfs(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR64fc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR64fc_Direct_16sc_ISfs(pSrcDst,numIters,pTaps,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR32s_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32s_Direct_16s_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,tapsFactor,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR32sc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32sc_Direct_16sc_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,tapsFactor,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR32s_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32s_Direct_16s_ISfs(pSrcDst,numIters,pTaps,tapsLen,tapsFactor,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR32sc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;pDlyLine:PIpp16sc;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR32sc_Direct_16sc_ISfs(pSrcDst,numIters,pTaps,tapsLen,tapsFactor,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIRMR_Direct(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRMR_Direct_32f(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR_Direct(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRMR_Direct_32fc(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR_Direct(pSrcDst:PIpp32f;numIters:longint;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRMR_Direct_32f_I(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR_Direct(pSrcDst:PIpp32fc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRMR_Direct_32fc_I(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR32f_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR32f_Direct_16s_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR32fc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR32fc_Direct_16sc_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR32f_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp32f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR32f_Direct_16s_ISfs(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR32fc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp32fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR32fc_Direct_16sc_ISfs(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR_Direct(pSrc:PIpp64f;pDst:PIpp64f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsFIRMR_Direct_64f(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR_Direct(pSrc:PIpp64fc;pDst:PIpp64fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsFIRMR_Direct_64fc(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR_Direct(pSrcDst:PIpp64f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64f):IppStatus;
begin
result:=ippsFIRMR_Direct_64f_I(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR_Direct(pSrcDst:PIpp64fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp64fc):IppStatus;
begin
result:=ippsFIRMR_Direct_64fc_I(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR64f_Direct(pSrc:PIpp32f;pDst:PIpp32f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRMR64f_Direct_32f(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR64fc_Direct(pSrc:PIpp32fc;pDst:PIpp32fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRMR64fc_Direct_32fc(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR64f_Direct(pSrcDst:PIpp32f;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32f):IppStatus;
begin
result:=ippsFIRMR64f_Direct_32f_I(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR64fc_Direct(pSrcDst:PIpp32fc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32fc):IppStatus;
begin
result:=ippsFIRMR64fc_Direct_32fc_I(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine);
end;
function ippsFIRMR64f_Direct(pSrc:PIpp32s;pDst:PIpp32s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR64f_Direct_32s_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR64fc_Direct(pSrc:PIpp32sc;pDst:PIpp32sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR64fc_Direct_32sc_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR64f_Direct(pSrcDst:PIpp32s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR64f_Direct_32s_ISfs(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR64fc_Direct(pSrcDst:PIpp32sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp32sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR64fc_Direct_32sc_ISfs(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR64f_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR64f_Direct_16s_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR64fc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR64fc_Direct_16sc_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR64f_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp64f;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR64f_Direct_16s_ISfs(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR64fc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp64fc;tapsLen:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR64fc_Direct_16sc_ISfs(pSrcDst,numIters,pTaps,tapsLen,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR32s_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR32s_Direct_16s_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,tapsFactor,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR32sc_Direct(pSrc:PIpp16sc;pDst:PIpp16sc;numIters:longint;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR32sc_Direct_16sc_Sfs(pSrc,pDst,numIters,pTaps,tapsLen,tapsFactor,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR32s_Direct(pSrcDst:PIpp16s;numIters:longint;pTaps:PIpp32s;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16s;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR32s_Direct_16s_ISfs(pSrcDst,numIters,pTaps,tapsLen,tapsFactor,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIRMR32sc_Direct(pSrcDst:PIpp16sc;numIters:longint;pTaps:PIpp32sc;tapsLen:longint;tapsFactor:longint;upFactor:longint;upPhase:longint;downFactor:longint;downPhase:longint;pDlyLine:PIpp16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsFIRMR32sc_Direct_16sc_ISfs(pSrcDst,numIters,pTaps,tapsLen,tapsFactor,upFactor,upPhase,downFactor,downPhase,pDlyLine,scaleFactor);
end;
function ippsFIR_Direct(pSrc:PIpp16s;pDst:PIpp16s;numIters:longint;pTapsQ15:PIpp16s;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR_Direct_16s_Sfs(pSrc,pDst,numIters,pTapsQ15,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIR_Direct(pSrcDst:PIpp16s;numIters:longint;pTapsQ15:PIpp16s;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIR_Direct_16s_ISfs(pSrcDst,numIters,pTapsQ15,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne_Direct(src:Ipp16s;pDstVal:PIpp16s;pTapsQ15:PIpp16s;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne_Direct_16s_Sfs(src,pDstVal,pTapsQ15,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIROne_Direct(pSrcDstVal:PIpp16s;pTapsQ15:PIpp16s;tapsLen:longint;pDlyLine:PIpp16s;pDlyLineIndex:Plongint;scaleFactor:longint):IppStatus;
begin
result:=ippsFIROne_Direct_16s_ISfs(pSrcDstVal,pTapsQ15,tapsLen,pDlyLine,pDlyLineIndex,scaleFactor);
end;
function ippsFIRGenLowpass(rfreq:Ipp64f;taps:PIpp64f;tapsLen:longint;winType:IppWinType;doNormal:IppBool):IppStatus;
begin
result:=ippsFIRGenLowpass_64f(rfreq,taps,tapsLen,winType,doNormal);
end;
function ippsFIRGenHighpass(rfreq:Ipp64f;taps:PIpp64f;tapsLen:longint;winType:IppWinType;doNormal:IppBool):IppStatus;
begin
result:=ippsFIRGenHighpass_64f(rfreq,taps,tapsLen,winType,doNormal);
end;
function ippsFIRGenBandpass(rLowFreq:Ipp64f;rHighFreq:Ipp64f;taps:PIpp64f;tapsLen:longint;winType:IppWinType;doNormal:IppBool):IppStatus;
begin
result:=ippsFIRGenBandpass_64f(rLowFreq,rHighFreq,taps,tapsLen,winType,doNormal);
end;
function ippsFIRGenBandstop(rLowFreq:Ipp64f;rHighFreq:Ipp64f;taps:PIpp64f;tapsLen:longint;winType:IppWinType;doNormal:IppBool):IppStatus;
begin
result:=ippsFIRGenBandstop_64f(rLowFreq,rHighFreq,taps,tapsLen,winType,doNormal);
end;
function ippsWinBartlett(pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinBartlett_16s_I(pSrcDst,len);
end;
function ippsWinBartlett(pSrcDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinBartlett_16sc_I(pSrcDst,len);
end;
function ippsWinBartlett(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinBartlett_32f_I(pSrcDst,len);
end;
function ippsWinBartlett(pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinBartlett_32fc_I(pSrcDst,len);
end;
function ippsWinBartlett(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinBartlett_16s(pSrc,pDst,len);
end;
function ippsWinBartlett(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinBartlett_16sc(pSrc,pDst,len);
end;
function ippsWinBartlett(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinBartlett_32f(pSrc,pDst,len);
end;
function ippsWinBartlett(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinBartlett_32fc(pSrc,pDst,len);
end;
function ippsWinBartlett(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinBartlett_64f(pSrc,pDst,len);
end;
function ippsWinBartlett(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinBartlett_64fc(pSrc,pDst,len);
end;
function ippsWinBartlett(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinBartlett_64f_I(pSrcDst,len);
end;
function ippsWinBartlett(pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinBartlett_64fc_I(pSrcDst,len);
end;
function ippsWinHann(pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinHann_16s_I(pSrcDst,len);
end;
function ippsWinHann(pSrcDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinHann_16sc_I(pSrcDst,len);
end;
function ippsWinHann(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinHann_32f_I(pSrcDst,len);
end;
function ippsWinHann(pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinHann_32fc_I(pSrcDst,len);
end;
function ippsWinHann(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinHann_16s(pSrc,pDst,len);
end;
function ippsWinHann(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinHann_16sc(pSrc,pDst,len);
end;
function ippsWinHann(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinHann_32f(pSrc,pDst,len);
end;
function ippsWinHann(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinHann_32fc(pSrc,pDst,len);
end;
function ippsWinHann(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinHann_64f_I(pSrcDst,len);
end;
function ippsWinHann(pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinHann_64fc_I(pSrcDst,len);
end;
function ippsWinHann(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinHann_64f(pSrc,pDst,len);
end;
function ippsWinHann(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinHann_64fc(pSrc,pDst,len);
end;
function ippsWinHamming(pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinHamming_16s_I(pSrcDst,len);
end;
function ippsWinHamming(pSrcDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinHamming_16sc_I(pSrcDst,len);
end;
function ippsWinHamming(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinHamming_32f_I(pSrcDst,len);
end;
function ippsWinHamming(pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinHamming_32fc_I(pSrcDst,len);
end;
function ippsWinHamming(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinHamming_16s(pSrc,pDst,len);
end;
function ippsWinHamming(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinHamming_16sc(pSrc,pDst,len);
end;
function ippsWinHamming(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinHamming_32f(pSrc,pDst,len);
end;
function ippsWinHamming(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinHamming_32fc(pSrc,pDst,len);
end;
function ippsWinHamming(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinHamming_64f(pSrc,pDst,len);
end;
function ippsWinHamming(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinHamming_64fc(pSrc,pDst,len);
end;
function ippsWinHamming(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinHamming_64f_I(pSrcDst,len);
end;
function ippsWinHamming(pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinHamming_64fc_I(pSrcDst,len);
end;
function ippsWinBlackmanQ15(pSrcDst:PIpp16s;len:longint;alphaQ15:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsWinBlackmanQ15_16s_ISfs(pSrcDst,len,alphaQ15,scaleFactor);
end;
function ippsWinBlackmanQ15(pSrcDst:PIpp16s;len:longint;alphaQ15:longint):IppStatus;
begin
result:=ippsWinBlackmanQ15_16s_I(pSrcDst,len,alphaQ15);
end;
function ippsWinBlackmanQ15(pSrcDst:PIpp16sc;len:longint;alphaQ15:longint):IppStatus;
begin
result:=ippsWinBlackmanQ15_16sc_I(pSrcDst,len,alphaQ15);
end;
function ippsWinBlackman(pSrcDst:PIpp16s;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinBlackman_16s_I(pSrcDst,len,alpha);
end;
function ippsWinBlackman(pSrcDst:PIpp16sc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinBlackman_16sc_I(pSrcDst,len,alpha);
end;
function ippsWinBlackman(pSrcDst:PIpp32f;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinBlackman_32f_I(pSrcDst,len,alpha);
end;
function ippsWinBlackman(pSrcDst:PIpp32fc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinBlackman_32fc_I(pSrcDst,len,alpha);
end;
function ippsWinBlackmanQ15(pSrc:PIpp16s;pDst:PIpp16s;len:longint;alphaQ15:longint):IppStatus;
begin
result:=ippsWinBlackmanQ15_16s(pSrc,pDst,len,alphaQ15);
end;
function ippsWinBlackmanQ15(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;alphaQ15:longint):IppStatus;
begin
result:=ippsWinBlackmanQ15_16sc(pSrc,pDst,len,alphaQ15);
end;
function ippsWinBlackman(pSrc:PIpp16s;pDst:PIpp16s;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinBlackman_16s(pSrc,pDst,len,alpha);
end;
function ippsWinBlackman(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinBlackman_16sc(pSrc,pDst,len,alpha);
end;
function ippsWinBlackman(pSrc:PIpp32f;pDst:PIpp32f;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinBlackman_32f(pSrc,pDst,len,alpha);
end;
function ippsWinBlackman(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinBlackman_32fc(pSrc,pDst,len,alpha);
end;
function ippsWinBlackmanStd(pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_16s_I(pSrcDst,len);
end;
function ippsWinBlackmanStd(pSrcDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_16sc_I(pSrcDst,len);
end;
function ippsWinBlackmanStd(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_32f_I(pSrcDst,len);
end;
function ippsWinBlackmanStd(pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_32fc_I(pSrcDst,len);
end;
function ippsWinBlackmanOpt(pSrcDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_16s_I(pSrcDst,len);
end;
function ippsWinBlackmanOpt(pSrcDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_16sc_I(pSrcDst,len);
end;
function ippsWinBlackmanOpt(pSrcDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_32f_I(pSrcDst,len);
end;
function ippsWinBlackmanOpt(pSrcDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_32fc_I(pSrcDst,len);
end;
function ippsWinBlackmanStd(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_16s(pSrc,pDst,len);
end;
function ippsWinBlackmanStd(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_16sc(pSrc,pDst,len);
end;
function ippsWinBlackmanStd(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_32f(pSrc,pDst,len);
end;
function ippsWinBlackmanStd(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_32fc(pSrc,pDst,len);
end;
function ippsWinBlackmanOpt(pSrc:PIpp16s;pDst:PIpp16s;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_16s(pSrc,pDst,len);
end;
function ippsWinBlackmanOpt(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_16sc(pSrc,pDst,len);
end;
function ippsWinBlackmanOpt(pSrc:PIpp32f;pDst:PIpp32f;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_32f(pSrc,pDst,len);
end;
function ippsWinBlackmanOpt(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_32fc(pSrc,pDst,len);
end;
function ippsWinBlackman(pSrcDst:PIpp64f;len:longint;alpha:double):IppStatus;
begin
result:=ippsWinBlackman_64f_I(pSrcDst,len,alpha);
end;
function ippsWinBlackman(pSrcDst:PIpp64fc;len:longint;alpha:double):IppStatus;
begin
result:=ippsWinBlackman_64fc_I(pSrcDst,len,alpha);
end;
function ippsWinBlackman(pSrc:PIpp64f;pDst:PIpp64f;len:longint;alpha:double):IppStatus;
begin
result:=ippsWinBlackman_64f(pSrc,pDst,len,alpha);
end;
function ippsWinBlackman(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;alpha:double):IppStatus;
begin
result:=ippsWinBlackman_64fc(pSrc,pDst,len,alpha);
end;
function ippsWinBlackmanStd(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_64f_I(pSrcDst,len);
end;
function ippsWinBlackmanStd(pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_64fc_I(pSrcDst,len);
end;
function ippsWinBlackmanStd(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_64f(pSrc,pDst,len);
end;
function ippsWinBlackmanStd(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanStd_64fc(pSrc,pDst,len);
end;
function ippsWinBlackmanOpt(pSrcDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_64f_I(pSrcDst,len);
end;
function ippsWinBlackmanOpt(pSrcDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_64fc_I(pSrcDst,len);
end;
function ippsWinBlackmanOpt(pSrc:PIpp64f;pDst:PIpp64f;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_64f(pSrc,pDst,len);
end;
function ippsWinBlackmanOpt(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint):IppStatus;
begin
result:=ippsWinBlackmanOpt_64fc(pSrc,pDst,len);
end;
function ippsWinKaiser(pSrc:PIpp16s;pDst:PIpp16s;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_16s(pSrc,pDst,len,alpha);
end;
function ippsWinKaiser(pSrcDst:PIpp16s;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_16s_I(pSrcDst,len,alpha);
end;
function ippsWinKaiserQ15(pSrc:PIpp16s;pDst:PIpp16s;len:longint;alphaQ15:longint):IppStatus;
begin
result:=ippsWinKaiserQ15_16s(pSrc,pDst,len,alphaQ15);
end;
function ippsWinKaiserQ15(pSrcDst:PIpp16s;len:longint;alphaQ15:longint):IppStatus;
begin
result:=ippsWinKaiserQ15_16s_I(pSrcDst,len,alphaQ15);
end;
function ippsWinKaiser(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_16sc(pSrc,pDst,len,alpha);
end;
function ippsWinKaiser(pSrcDst:PIpp16sc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_16sc_I(pSrcDst,len,alpha);
end;
function ippsWinKaiserQ15(pSrc:PIpp16sc;pDst:PIpp16sc;len:longint;alphaQ15:longint):IppStatus;
begin
result:=ippsWinKaiserQ15_16sc(pSrc,pDst,len,alphaQ15);
end;
function ippsWinKaiserQ15(pSrcDst:PIpp16sc;len:longint;alphaQ15:longint):IppStatus;
begin
result:=ippsWinKaiserQ15_16sc_I(pSrcDst,len,alphaQ15);
end;
function ippsWinKaiser(pSrc:PIpp32f;pDst:PIpp32f;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_32f(pSrc,pDst,len,alpha);
end;
function ippsWinKaiser(pSrcDst:PIpp32f;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_32f_I(pSrcDst,len,alpha);
end;
function ippsWinKaiser(pSrc:PIpp32fc;pDst:PIpp32fc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_32fc(pSrc,pDst,len,alpha);
end;
function ippsWinKaiser(pSrcDst:PIpp32fc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_32fc_I(pSrcDst,len,alpha);
end;
function ippsWinKaiser(pSrc:PIpp64f;pDst:PIpp64f;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_64f(pSrc,pDst,len,alpha);
end;
function ippsWinKaiser(pSrcDst:PIpp64f;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_64f_I(pSrcDst,len,alpha);
end;
function ippsWinKaiser(pSrcDst:PIpp64fc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_64fc_I(pSrcDst,len,alpha);
end;
function ippsWinKaiser(pSrc:PIpp64fc;pDst:PIpp64fc;len:longint;alpha:single):IppStatus;
begin
result:=ippsWinKaiser_64fc(pSrc,pDst,len,alpha);
end;
function ippsFilterMedian(pSrcDst:PIpp32f;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_32f_I(pSrcDst,len,maskSize);
end;
function ippsFilterMedian(pSrcDst:PIpp64f;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_64f_I(pSrcDst,len,maskSize);
end;
function ippsFilterMedian(pSrcDst:PIpp16s;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_16s_I(pSrcDst,len,maskSize);
end;
function ippsFilterMedian(pSrcDst:PIpp8u;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_8u_I(pSrcDst,len,maskSize);
end;
function ippsFilterMedian(pSrc:PIpp32f;pDst:PIpp32f;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_32f(pSrc,pDst,len,maskSize);
end;
function ippsFilterMedian(pSrc:PIpp64f;pDst:PIpp64f;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_64f(pSrc,pDst,len,maskSize);
end;
function ippsFilterMedian(pSrc:PIpp16s;pDst:PIpp16s;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_16s(pSrc,pDst,len,maskSize);
end;
function ippsFilterMedian(pSrc:PIpp8u;pDst:PIpp8u;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_8u(pSrc,pDst,len,maskSize);
end;
function ippsFilterMedian(pSrcDst:PIpp32s;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_32s_I(pSrcDst,len,maskSize);
end;
function ippsFilterMedian(pSrc:PIpp32s;pDst:PIpp32s;len:longint;maskSize:longint):IppStatus;
begin
result:=ippsFilterMedian_32s(pSrc,pDst,len,maskSize);
end;
function ippsNorm_Inf(pSrc:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNorm_Inf_16s32f(pSrc,len,pNorm);
end;
function ippsNorm_Inf(pSrc:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsNorm_Inf_16s32s_Sfs(pSrc,len,pNorm,scaleFactor);
end;
function ippsNorm_Inf(pSrc:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNorm_Inf_32f(pSrc,len,pNorm);
end;
function ippsNorm_Inf(pSrc:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNorm_Inf_64f(pSrc,len,pNorm);
end;
function ippsNorm_L1(pSrc:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNorm_L1_16s32f(pSrc,len,pNorm);
end;
function ippsNorm_L1(pSrc:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsNorm_L1_16s32s_Sfs(pSrc,len,pNorm,scaleFactor);
end;
function ippsNorm_L1(pSrc:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNorm_L1_32f(pSrc,len,pNorm);
end;
function ippsNorm_L1(pSrc:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNorm_L1_64f(pSrc,len,pNorm);
end;
function ippsNorm_L2(pSrc:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNorm_L2_16s32f(pSrc,len,pNorm);
end;
function ippsNorm_L2(pSrc:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsNorm_L2_16s32s_Sfs(pSrc,len,pNorm,scaleFactor);
end;
function ippsNorm_L2(pSrc:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNorm_L2_32f(pSrc,len,pNorm);
end;
function ippsNorm_L2(pSrc:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNorm_L2_64f(pSrc,len,pNorm);
end;
function ippsNormDiff_Inf(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNormDiff_Inf_16s32f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_Inf(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsNormDiff_Inf_16s32s_Sfs(pSrc1,pSrc2,len,pNorm,scaleFactor);
end;
function ippsNormDiff_Inf(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNormDiff_Inf_32f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_Inf(pSrc1:PIpp64f;pSrc2:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNormDiff_Inf_64f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L1(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNormDiff_L1_16s32f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L1(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsNormDiff_L1_16s32s_Sfs(pSrc1,pSrc2,len,pNorm,scaleFactor);
end;
function ippsNormDiff_L1(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNormDiff_L1_32f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L1(pSrc1:PIpp64f;pSrc2:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNormDiff_L1_64f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L2(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNormDiff_L2_16s32f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L2(pSrc1:PIpp16s;pSrc2:PIpp16s;len:longint;pNorm:PIpp32s;scaleFactor:longint):IppStatus;
begin
result:=ippsNormDiff_L2_16s32s_Sfs(pSrc1,pSrc2,len,pNorm,scaleFactor);
end;
function ippsNormDiff_L2(pSrc1:PIpp32f;pSrc2:PIpp32f;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNormDiff_L2_32f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L2(pSrc1:PIpp64f;pSrc2:PIpp64f;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNormDiff_L2_64f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNorm_Inf(pSrc:PIpp32fc;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNorm_Inf_32fc32f(pSrc,len,pNorm);
end;
function ippsNorm_L1(pSrc:PIpp32fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNorm_L1_32fc64f(pSrc,len,pNorm);
end;
function ippsNorm_L2(pSrc:PIpp32fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNorm_L2_32fc64f(pSrc,len,pNorm);
end;
function ippsNormDiff_Inf(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pNorm:PIpp32f):IppStatus;
begin
result:=ippsNormDiff_Inf_32fc32f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L1(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNormDiff_L1_32fc64f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L2(pSrc1:PIpp32fc;pSrc2:PIpp32fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNormDiff_L2_32fc64f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNorm_Inf(pSrc:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNorm_Inf_64fc64f(pSrc,len,pNorm);
end;
function ippsNorm_L1(pSrc:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNorm_L1_64fc64f(pSrc,len,pNorm);
end;
function ippsNorm_L2(pSrc:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNorm_L2_64fc64f(pSrc,len,pNorm);
end;
function ippsNormDiff_Inf(pSrc1:PIpp64fc;pSrc2:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNormDiff_Inf_64fc64f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L1(pSrc1:PIpp64fc;pSrc2:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNormDiff_L1_64fc64f(pSrc1,pSrc2,len,pNorm);
end;
function ippsNormDiff_L2(pSrc1:PIpp64fc;pSrc2:PIpp64fc;len:longint;pNorm:PIpp64f):IppStatus;
begin
result:=ippsNormDiff_L2_64fc64f(pSrc1,pSrc2,len,pNorm);
end;
function ippsCrossCorr(pSrc1:PIpp32f;len1:longint;pSrc2:PIpp32f;len2:longint;pDst:PIpp32f;dstLen:longint;lowLag:longint):IppStatus;
begin
result:=ippsCrossCorr_32f(pSrc1,len1,pSrc2,len2,pDst,dstLen,lowLag);
end;
function ippsCrossCorr(pSrc1:PIpp64f;len1:longint;pSrc2:PIpp64f;len2:longint;pDst:PIpp64f;dstLen:longint;lowLag:longint):IppStatus;
begin
result:=ippsCrossCorr_64f(pSrc1,len1,pSrc2,len2,pDst,dstLen,lowLag);
end;
function ippsCrossCorr(pSrc1:PIpp32fc;len1:longint;pSrc2:PIpp32fc;len2:longint;pDst:PIpp32fc;dstLen:longint;lowLag:longint):IppStatus;
begin
result:=ippsCrossCorr_32fc(pSrc1,len1,pSrc2,len2,pDst,dstLen,lowLag);
end;
function ippsCrossCorr(pSrc1:PIpp64fc;len1:longint;pSrc2:PIpp64fc;len2:longint;pDst:PIpp64fc;dstLen:longint;lowLag:longint):IppStatus;
begin
result:=ippsCrossCorr_64fc(pSrc1,len1,pSrc2,len2,pDst,dstLen,lowLag);
end;
function ippsCrossCorr(pSrc1:PIpp16s;len1:longint;pSrc2:PIpp16s;len2:longint;pDst:PIpp16s;dstLen:longint;lowLag:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsCrossCorr_16s_Sfs(pSrc1,len1,pSrc2,len2,pDst,dstLen,lowLag,scaleFactor);
end;
function ippsAutoCorr(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_32f(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr_NormA(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_NormA_32f(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr_NormB(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_NormB_32f(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_64f(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr_NormA(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_NormA_64f(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr_NormB(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_NormB_64f(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_32fc(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr_NormA(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_NormA_32fc(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr_NormB(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_NormB_32fc(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_64fc(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr_NormA(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_NormA_64fc(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr_NormB(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:longint):IppStatus;
begin
result:=ippsAutoCorr_NormB_64fc(pSrc,srcLen,pDst,dstLen);
end;
function ippsAutoCorr(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAutoCorr_16s_Sfs(pSrc,srcLen,pDst,dstLen,scaleFactor);
end;
function ippsAutoCorr_NormA(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAutoCorr_NormA_16s_Sfs(pSrc,srcLen,pDst,dstLen,scaleFactor);
end;
function ippsAutoCorr_NormB(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:longint;scaleFactor:longint):IppStatus;
begin
result:=ippsAutoCorr_NormB_16s_Sfs(pSrc,srcLen,pDst,dstLen,scaleFactor);
end;
function ippsSampleUp(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleUp_32f(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleUp(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleUp_32fc(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleUp(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleUp_64f(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleUp(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleUp_64fc(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleUp(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleUp_16s(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleUp(pSrc:PIpp16sc;srcLen:longint;pDst:PIpp16sc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleUp_16sc(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleDown(pSrc:PIpp32f;srcLen:longint;pDst:PIpp32f;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleDown_32f(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleDown(pSrc:PIpp32fc;srcLen:longint;pDst:PIpp32fc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleDown_32fc(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleDown(pSrc:PIpp64f;srcLen:longint;pDst:PIpp64f;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleDown_64f(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleDown(pSrc:PIpp64fc;srcLen:longint;pDst:PIpp64fc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleDown_64fc(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleDown(pSrc:PIpp16s;srcLen:longint;pDst:PIpp16s;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleDown_16s(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsSampleDown(pSrc:PIpp16sc;srcLen:longint;pDst:PIpp16sc;dstLen:Plongint;factor:longint;phase:Plongint):IppStatus;
begin
result:=ippsSampleDown_16sc(pSrc,srcLen,pDst,dstLen,factor,phase);
end;
function ippsGetVarPointDV(pSrc:PIpp16sc;pDst:PIpp16sc;pVariantPoint:PIpp16sc;pLabel:PIpp8u;state:longint):IppStatus;
begin
result:=ippsGetVarPointDV_16sc(pSrc,pDst,pVariantPoint,pLabel,state);
end;
function ippsCalcStatesDV(pathError:PIpp16u;pNextState:PIpp8u;pBranchError:PIpp16u;pCurrentSubsetPoint:PIpp16s;pPathTable:PIpp16s;state:longint;presentIndex:longint):IppStatus;
begin
result:=ippsCalcStatesDV_16sc(pathError,pNextState,pBranchError,pCurrentSubsetPoint,pPathTable,state,presentIndex);
end;
function ippsBuildSymblTableDV4D(pVariantPoint:PIpp16sc;pCurrentSubsetPoint:PIpp16sc;state:longint;bitInversion:longint):IppStatus;
begin
result:=ippsBuildSymblTableDV4D_16sc(pVariantPoint,pCurrentSubsetPoint,state,bitInversion);
end;
function ippsUpdatePathMetricsDV(pBranchError:PIpp16u;pMinPathError:PIpp16u;pMinSost:PIpp8u;pPathError:PIpp16u;state:longint):IppStatus;
begin
result:=ippsUpdatePathMetricsDV_16u(pBranchError,pMinPathError,pMinSost,pPathError,state);
end;
function ippsHilbertInitAlloc(var pSpec:PIppsHilbertSpec_32f32fc;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsHilbertInitAlloc_32f32fc(pSpec,length,hint);
end;
function ippsHilbertInitAlloc(var pSpec:PIppsHilbertSpec_16s32fc;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsHilbertInitAlloc_16s32fc(pSpec,length,hint);
end;
function ippsHilbertInitAlloc(var pSpec:PIppsHilbertSpec_16s16sc;length:longint;hint:IppHintAlgorithm):IppStatus;
begin
result:=ippsHilbertInitAlloc_16s16sc(pSpec,length,hint);
end;
function ippsHilbertFree(pSpec:PIppsHilbertSpec_32f32fc):IppStatus;
begin
result:=ippsHilbertFree_32f32fc(pSpec);
end;
function ippsHilbertFree(pSpec:PIppsHilbertSpec_16s32fc):IppStatus;
begin
result:=ippsHilbertFree_16s32fc(pSpec);
end;
function ippsHilbertFree(pSpec:PIppsHilbertSpec_16s16sc):IppStatus;
begin
result:=ippsHilbertFree_16s16sc(pSpec);
end;
function ippsHilbert(pSrc:PIpp32f;pDst:PIpp32fc;pSpec:PIppsHilbertSpec_32f32fc):IppStatus;
begin
result:=ippsHilbert_32f32fc(pSrc,pDst,pSpec);
end;
function ippsHilbert(pSrc:PIpp16s;pDst:PIpp32fc;pSpec:PIppsHilbertSpec_16s32fc):IppStatus;
begin
result:=ippsHilbert_16s32fc(pSrc,pDst,pSpec);
end;
function ippsHilbert(pSrc:PIpp16s;pDst:PIpp16sc;pSpec:PIppsHilbertSpec_16s16sc;scaleFactor:longint):IppStatus;
begin
result:=ippsHilbert_16s16sc_Sfs(pSrc,pDst,pSpec,scaleFactor);
end;
end.
|
unit FDbInfo;
(*====================================================================
Dialog box displaying information about the database.
======================================================================*)
interface
uses
SysUtils,
{$ifdef mswindows}
WinTypes,WinProcs,
{$ELSE}
LCLIntf, LCLType, LMessages,
{$ENDIF}
Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls,
UTypes, UApiTypes;
type
TFormDBaseInfo = class(TForm)
ButtonOK: TButton;
LabelDBaseName: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
LabelSize: TLabel;
LabelRecords: TLabel;
LabelRecordsDeleted: TLabel;
LabelReindex: TLabel;
Label6: TLabel;
LabelReadOnly: TLabel;
procedure ButtonOKClick(Sender: TObject);
private
{ Private declarations }
public
procedure SetValues(var DBaseInfo: TDBaseInfo; DBaseName: ShortString);
procedure DefaultHandler(var Message); override;
end;
var
FormDBaseInfo: TFormDBaseInfo;
implementation
uses UBaseUtils, ULang, FSettings;
{$R *.dfm}
//-----------------------------------------------------------------------------
procedure TFormDBaseInfo.ButtonOKClick(Sender: TObject);
begin
ModalResult := mrOK;
end;
//-----------------------------------------------------------------------------
procedure TFormDBaseInfo.SetValues(var DBaseInfo: TDBaseInfo; DBaseName: ShortString);
begin
LabelRecords.Caption := IntToStr(DBaseInfo.Count);
LabelRecordsDeleted.Caption := IntToStr(DBaseInfo.Count-DBaseInfo.CountValid);
LabelSize.Caption := FormatSize(DBaseInfo.DBaseSize, true);
if (DBaseInfo.Count > 0) and ((DBaseInfo.CountValid/DBaseInfo.Count) < 0.8) or
((DBaseInfo.Count-DBaseInfo.CountValid) > 100)
then LabelReindex.Caption := lsYes
else LabelReindex.Caption := lsNo;
if DBaseInfo.ReadOnly
then LabelReadOnly.Caption := lsYes
else LabelReadOnly.Caption := lsNo;
LabelDBaseName.Caption := DbaseName;
end;
//-----------------------------------------------------------------------------
// Disables CD AutoRun feature - Windows send the message QueryCancelAutoPlay
// to the top window, so we must have this handler in all forms.
procedure TFormDBaseInfo.DefaultHandler(var Message);
begin
with TMessage(Message) do
if (Msg = g_CommonOptions.dwQueryCancelAutoPlay) and
g_CommonOptions.bDisableCdAutorun
then
Result := 1
else
inherited DefaultHandler(Message)
end;
//-----------------------------------------------------------------------------
end.
|
(*
Category: SWAG Title: OOP/TURBO VISION ROUTINES
Original name: 0043.PAS
Description: Defining array sizes
Author: KEN.BURROWS@TELOS.ORG
Date: 08-25-94 09:10
*)
{
RJS> Just a quick question... In the variable declaration field, you define
RJS> an array with array [0..9] of foo, But let's say I didn't know exactly
RJS> how big the array was going to be... How would I declare an array with
RJS> a variable endpoint?
There are a couple of ways around this, and they employ the use of pointers,
which in turn, require a little additional code to maintain. If you are useing
Borlands Pascal 6 or 7, the tCollection objects work quite well, or else make
use of linked lists. There is still the option of using a variable lengthed
array too.
As an example,
}
{$A+,B-,D-,E-,F+,G-,I-,L-,N-,O-,P-,Q-,R-,S-,T-,V-,X+,Y-}
{$M 16384,0,655360}
Program VariableArrayETC;
uses objects;
Type
Data = Record
name : string[80];
age : integer;
end;
VArray = array[0..0] of Data; {variable sized array}
VAPtr = ^Varray;
VLPtr = ^VList; {linked list}
VList = Record
rec : Data;
next,
prev: VLPtr;
end;
DataPtr = ^data; {OOP types from the objects unit}
VObj = Object(tCollection)
procedure FreeItem(item:pointer); virtual;
end;
VObjPtr = ^VObj;
Procedure VObj.FreeItem(item:pointer);
begin
dispose(DataPtr(item));
end;
procedure MakeTestFile;
var i:integer;
f:file of Data;
d:data;
Begin
writeln;
writeln('blank name will exit');
assign(f,'test.dat');
rewrite(f);
fillchar(d,sizeof(d),0);
repeat
write('name : '); readln(d.name);
if d.name <> ''
then begin
repeat
write('age : '); readln(d.age);
until ioresult = 0;
write(f,d);
end;
until d.name = '';
close(f);
End;
Procedure VariableArrayExample; {turn Range Checking off...}
var f:file;
v:VAPtr;
i,res:integer;
d:data;
m:longint;
Begin
writeln;
Writeln('output of variable array ... ');
{m := memavail;}
assign(f,'test.dat');
reset(f,sizeof(data));
getmem(v,filesize(f)*SizeOf(Data));
blockRead(f,v^,filesize(f),res);
for i := 0 to res - 1 do
begin
writeln(v^[i].name);
writeln(v^[i].age);
end;
freemem(v,filesize(f)*SizeOf(Data));
close(f);
{if m <> memavail then writeln('heap ''a trouble...');}
End;
Procedure LinkedListExample;
var f:file of Data;
curr,hold : VLPtr;
m:longint;
Begin
curr := nil; hold := nil;
writeln;
writeln('Linked List example ... ');
{m := memavail;}
assign(f,'test.dat');
reset(f);
while not eof(f) do
begin
new(curr);
curr^.prev := hold;
read(f,curr^.rec);
curr^.next := nil;
if hold <> nil then hold^.next := curr;
hold := curr;
end;
close(f);
hold := curr;
if hold <> nil
then begin
while hold^.prev <> nil do hold := hold^.prev;
while hold <> nil do
begin
writeln(hold^.rec.name);
writeln(hold^.rec.age);
hold := hold^.next;
end;
hold := curr;
while hold <> nil do
begin
hold := curr^.prev;
dispose(curr);
curr := hold;
end;
end;
{if m <> memavail then writeln('heap ''a trouble...');}
End;
Procedure tCollectionExample; {requires the object unit}
var p:VObjPtr;
d:DataPtr;
f:file of Data;
m:longint;
procedure WriteEm(dp:DataPtr); far;
begin
writeln(dp^.name);
writeln(dp^.age);
end;
begin
writeln;
writeln('object tCollection example ... ');
{m := memavail;}
assign(f,'test.dat');
new(p,init(5,2));
reset(f);
while not eof(f) do
begin
new(d);
system.read(f,d^);
p^.insert(d);
end;
close(f);
p^.forEach(@WriteEm);
dispose(p,done);
{if m <> memavail then writeln('heap ''a trouble...');}
end;
Begin
maketestfile;
variablearrayexample;
linkedListExample;
tcollectionExample;
End.
|
unit MainUnit;
{$mode objfpc}{$H+}
(*
Olimex WPC 50
Find the centre of a circle with a 50 pixel diameter in a 100 x 100 window.
*)
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
Arrow, ExtCtrls, StdCtrls, Buttons;
type
{ TMainForm }
TMainForm = class(TForm)
DiameterRadioGroup: TRadioGroup;
AlgoRadioGroup: TRadioGroup;
RunBitBtn: TBitBtn;
ExitBitBtn: TBitBtn;
MainImage: TShape;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
DiameterRadioGroupPanel6: TPanel;
Panel7: TPanel;
StatusBar: TStatusBar;
procedure ExitBitBtnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure MainImagePaint(Sender: TObject);
procedure RunBitBtnClick(Sender: TObject);
private
{ private declarations }
radius: Integer;
circle_x, circle_y: Integer;
centre_x, centre_y: Integer;
procedure FindCentre;
procedure SearchCentre;
public
{ public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R *.lfm}
{ TMainForm }
// Find the centre by simply calculating
// the average coordinates of the blue pixels
procedure TMainForm.FindCentre;
var x,y: Integer;
cx, cy: LongInt;
cnt: Integer;
begin
cnt := 0;
cx := 0;
cy := 0;
for x := 0 to MainImage.Width - 1 do
begin
for y := 0 to MainImage.Height - 1 do
begin
if MainImage.Canvas.Pixels[x,y] = clBlue then
begin
cx := cx + x;
cy := cy + y;
Inc(cnt);
end;
end;
end;
centre_x := round(cx / cnt);
centre_y := round(cy / cnt);
end;
// Find the centre by sending rays in four directions
procedure TMainForm.SearchCentre;
var tx,ty,
lx,ly,
bx,by,
rx,ry: Integer;
x,y: Integer;
px,py: Integer;
step: Integer;
tf, bf, rf, lf: Boolean;
found: Boolean;
begin
found := false;
centre_x := 0;
centre_y := 0;
// Examine the image in a grid of size "step"
step := MainImage.Width div 2;
while not found do
begin
x := 1;
while (x < MainImage.Width) and (not found) do
begin
y := 1;
while (y < MainImage.Height) and (not found) do
begin
// Send rays in four directions, starting from
// the current x,y location
// If the ray detects a transition from blue to non-blue
// then we have found a point on the circumference of
// the circle
tx := -1; ty := -1; lx := -1; ly := -1;
rx := -1; ry := -1; bx := -1; by := -1;
tf := false; bf := false; rf := false; lf := false;
// Probe the top
for py := y downto 1 do
if (MainImage.Canvas.Pixels[x,py] = clBlue) and
(MainImage.Canvas.Pixels[x,py-1] <> clBlue) then
begin
tx :=x; ty := py;
tf := true;
end;
// Probe the bottom
for py := y to MainImage.Height - 1 do
if (MainImage.Canvas.Pixels[x,py] = clBlue) and
(MainImage.Canvas.Pixels[x,py+1] <> clBlue) then
begin
bx := x; by := py;
bf := true;
end;
// Probe left
for px := x downto 1 do
if (MainImage.Canvas.Pixels[px,y] = clBlue) and
(MainImage.Canvas.Pixels[px-1,y] <> clBlue) then
begin
lx := px; ly := y;
lf := true;
end;
// Probe right
for px := x to MainImage.Width - 1 do
if (MainImage.Canvas.Pixels[px,y] = clBlue) and
(MainImage.Canvas.Pixels[px+1,y] <> clBlue) then
begin
rx := px; ry := y;
rf := true;
end;
// If all four rays detected an edge
// then calculate the centre coordinate
if tf and rf and lf and bf then
begin
found := true;
centre_x := lx + (rx - lx) div 2;
centre_y := ty + (by - ty) div 2;
break;
end;
y := y+step;
end;
x:=x+step;
end;
if (step = 1) and (not found) then
raise Exception.Create('No centre could be found');
step := step div 2;
end;
end;
procedure TMainForm.RunBitBtnClick(Sender: TObject);
begin
// Generate circle radius
if DiameterRadioGroup.ItemIndex = 0 then
radius := 25
else
radius := 5 + random(40);
// Generate random centre
circle_x := radius + random(MainImage.Width - 2*radius);
circle_y := radius + random(MainImage.Height - 2*radius);
// Repaint
MainImage.Invalidate;
end;
procedure TMainForm.MainImagePaint(Sender: TObject);
var R: TRect;
begin
with MainImage.Canvas do
begin
// Fill background
Brush.Color := clWhite;
R.Left:=0;
R.Top:=0;
R.Right:=Height-1;
R.Bottom:=Height-1;
FillRect(R);
// Draw circle
Brush.Color := clBlue;
Ellipse(circle_x-radius,circle_y-radius,
circle_x+radius,circle_y+radius);
// Calculate centre
if AlgoRadioGroup.ItemIndex = 0 then
FindCentre
else
SearchCentre;
// Draw crosshair
Pen.Color := clRed;
Pen.Width := 1;
Pen.Style := psSolid;
Line(centre_x, 0, centre_x, Height-1);
Line(0, centre_y, Width-1, centre_y);
end;
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
Randomize;
RunBitBtnClick(self);
end;
procedure TMainForm.ExitBitBtnClick(Sender: TObject);
begin
Application.Terminate;
end;
end.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.