* procedure GetOrdProp added

This commit is contained in:
florian 1998-09-19 15:25:45 +00:00
parent dc3bc0cd43
commit e6f7c229d0

View File

@ -183,6 +183,26 @@ unit typinfo;
implementation implementation
{$ASMMODE INTEL}
function CallMethod_Integer(s : Pointer;Address : Pointer) : Integer;assembler;
asm
mov ESI,s
mov EDI,Address
call [EDI]
// now the result should be in EAX, untested yet (FK)
end;
function CallMethod_Boolean(s : Pointer;Address : Pointer) : Boolean;assembler;
asm
mov ESI,s
mov EDI,Address
call [EDI]
// now the result should be in EAX, untested yet (FK)
end;
function GetTypeData(TypeInfo : PTypeInfo) : PTypeData; function GetTypeData(TypeInfo : PTypeInfo) : PTypeData;
begin begin
@ -221,36 +241,16 @@ unit typinfo;
function IsStoredProp(Instance : TObject;PropInfo : PPropInfo) : Boolean; function IsStoredProp(Instance : TObject;PropInfo : PPropInfo) : Boolean;
type
tbfunction = function : boolean of object;
var
caller : packed record
Instance : Pointer;
Address : Pointer;
end;
begin begin
caller.Instance:=Instance;
case (PropInfo^.PropProcs shr 4) and 3 of case (PropInfo^.PropProcs shr 4) and 3 of
0: 0:
IsStoredProp:= IsStoredProp:=PBoolean(Pointer(Instance)+Longint(PropInfo^.StoredProc))^;
PBoolean(Pointer(Instance)+Longint(PropInfo^.StoredProc))^;
1: 1:
begin IsStoredProp:=CallMethod(Instance,PropInfo^.StoredProc);
caller.Address:=PropInfo^.StoredProc;
// IsStoredProp:=tbfunction(caller);
end;
2: 2:
begin IsStoredProp:=CallMethod(Instance,(PPointer(Instance.ClassType)+Longint(PropInfo^.StoredProc)^);
caller.Address:=PPointer(PPointer(Instance.ClassType)+Longint(PropInfo^.StoredProc))^; 3:
// IsStoredProp:=tbfunction(caller); IsStoredProp:=LongBool(PropInfo^.StoredProc);
end;
4:
begin
IsStoredProp:=
LongBool(PropInfo^.StoredProc);
end;
end; end;
end; end;
@ -269,8 +269,26 @@ unit typinfo;
function GetOrdProp(Instance : TObject;PropInfo : PPropInfo) : Longint; function GetOrdProp(Instance : TObject;PropInfo : PPropInfo) : Longint;
var
value : longint;
begin begin
{!!!!!!!!!!!} case (PropInfo^.PropProcs) and 3 of
0:
Value:=PLongint(Pointer(Instance)+Longint(PropInfo^.GetProc))^;
1:
Value:=CallMethod(Instance,PropInfo^.GetProc);
2:
Value:=CallMethod(Instance,(PPointer(Instance.ClassType)+Longint(PropInfo^.GetProc)^);
end;
{ cut off unnecessary stuff }
case GetTypeData(PropInfo^.PropType)^.OrdType of
otSWord,otUWord:
Value:=Value and $ffff;
otSByte,otUByte:
Value:=Value and $ff;
end;
GetOrdProp:=Value;
end; end;
procedure SetOrdProp(Instance : TObject;PropInfo : PPropInfo; procedure SetOrdProp(Instance : TObject;PropInfo : PPropInfo;
@ -348,7 +366,10 @@ end.
{ {
$Log$ $Log$
Revision 1.8 1998-09-19 08:33:53 florian Revision 1.9 1998-09-19 15:25:45 florian
* procedure GetOrdProp added
Revision 1.8 1998/09/19 08:33:53 florian
+ some procedures added + some procedures added
Revision 1.7 1998/09/08 09:52:31 florian Revision 1.7 1998/09/08 09:52:31 florian