-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathCAPI_DSSElement.pas
71 lines (61 loc) · 2.08 KB
/
CAPI_DSSElement.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
unit CAPI_DSSElement;
interface
uses
CAPI_Utils,
CAPI_Types;
procedure DSSElement_Get_AllPropertyNames(var ResultPtr: PPAnsiChar; ResultCount: PAPISize); CDECL;
procedure DSSElement_Get_AllPropertyNames_GR(); CDECL;
function DSSElement_Get_Name(): PAnsiChar; CDECL;
function DSSElement_Get_NumProperties(): Integer; CDECL;
implementation
uses
CAPI_Constants,
DSSGlobals,
Sysutils,
DSSClass,
DSSHelper;
procedure DSSElement_Get_AllPropertyNames(var ResultPtr: PPAnsiChar; ResultCount: PAPISize); CDECL;
var
Result: PPAnsiCharArray0;
k: Integer;
begin
if (InvalidCircuit(DSSPrime)) or (DSSPrime.ActiveDSSObject = NIL) then
begin
DefaultResult(ResultPtr, ResultCount, '');
Exit;
end;
with DSSPrime.ActiveDSSObject do
with ParentClass do
begin
Result := DSS_RecreateArray_PPAnsiChar(ResultPtr, ResultCount, NumProperties);
for k := 1 to NumProperties do
begin
Result[k - 1] := DSS_CopyStringAsPChar(PropertyName^[k]);
end;
end;
end;
procedure DSSElement_Get_AllPropertyNames_GR(); CDECL;
// Same as DSSElement_Get_AllPropertyNames but uses global result (GR) pointers
begin
DSSElement_Get_AllPropertyNames(DSSPrime.GR_DataPtr_PPAnsiChar, @DSSPrime.GR_Counts_PPAnsiChar[0])
end;
//------------------------------------------------------------------------------
function DSSElement_Get_Name(): PAnsiChar; CDECL;
begin
Result := NIL;
if (InvalidCircuit(DSSPrime)) or (DSSPrime.ActiveDSSObject = NIL) then
Exit;
with DSSPrime.ActiveDSSObject do
Result := DSS_GetAsPAnsiChar(DSSPrime, FullName);
end;
//------------------------------------------------------------------------------
function DSSElement_Get_NumProperties(): Integer; CDECL;
begin
Result := 0;
if (InvalidCircuit(DSSPrime)) or (DSSPrime.ActiveDSSObject = NIL) then
Exit;
with DSSPrime.ActiveDSSObject do
Result := ParentClass.NumProperties;
end;
//------------------------------------------------------------------------------
end.