3 This file is part of the Free Pascal run time library.
4 Copyright (c) 1999-2000 by the Free Pascal development team
6 This unit makes Free Pascal as much as possible Delphi compatible
8 See the file COPYING.FPC, included in this distribution,
9 for details about the copyright.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 **********************************************************************}
17 {*****************************************************************************
19 *****************************************************************************}
25 { These were negative value's, but are now positive, else classes
26 couldn't be used with shared linking which copies only all data from
27 the .global directive and not the data before the directive (PFV) }
39 vmtDestroy = vmtMethodStart;
40 vmtNewInstance = vmtMethodStart+4;
41 vmtFreeInstance = vmtMethodStart+8;
42 vmtSafeCallException = vmtMethodStart+12;
43 vmtDefaultHandler = vmtMethodStart+16;
44 vmtAfterConstruction = vmtMethodStart+20;
45 vmtBeforeDestruction = vmtMethodStart+24;
46 vmtDefaultHandlerStr = vmtMethodStart+28;
62 vmtSafeCallException = 24;
63 vmtDefaultHandler = 28;
64 vmtAfterConstruction = 32;
65 vmtBeforeDestruction = 36;
66 vmtDefaultHandlerStr = 40;
70 { some pointer definitions }
71 pshortstring = ^shortstring;
72 plongstring = ^longstring;
73 pansistring = ^ansistring;
74 pwidestring = ^widestring;
75 // pstring = pansistring;
76 pextended = ^extended;
79 { now the let's declare the base classes for the class object }
82 tclass = class of tobject;
86 { to access the message table from outside }
92 pmsgstrtable = ^tmsgstrtable;
94 tstringmessagetable = record
96 msgstrtable : array[0..0] of tmsgstrtable;
99 pstringmessagetable = ^tstringmessagetable;
103 { please don't change the order of virtual methods, because }
104 { their vmt offsets are used by some assembler code which uses }
105 { hard coded addresses (FK) }
107 { the virtual procedures must be in THAT order }
108 destructor destroy;virtual;
109 class function newinstance : tobject;virtual;
110 procedure freeinstance;virtual;
111 function safecallexception(exceptobject : tobject;
112 exceptaddr : pointer) : longint;virtual;
113 procedure defaulthandler(var message);virtual;
116 class function initinstance(instance : pointer) : tobject;
117 procedure cleanupinstance;
118 function classtype : tclass;
119 class function classinfo : pointer;
120 class function classname : shortstring;
121 class function classnameis(const name : string) : boolean;
122 class function classparent : tclass;
123 class function instancesize : longint;
124 class function inheritsfrom(aclass : tclass) : boolean;
125 class function stringmessagetable : pstringmessagetable;
126 { message handling routines }
127 procedure dispatch(var message);
128 procedure dispatchstr(var message);
130 class function methodaddress(const name : shortstring) : pointer;
131 class function methodname(address : pointer) : shortstring;
132 function fieldaddress(const name : shortstring) : pointer;
134 { new since Delphi 4 }
135 procedure AfterConstruction;virtual;
136 procedure BeforeDestruction;virtual;
138 { new for gtk, default handler for text based messages }
139 procedure DefaultHandlerStr(var message);virtual;
141 { interface functions, I don't know if we need this }
143 function getinterface(const iid : tguid;out obj) : boolean;
144 class function getinterfaceentry(const iid : tguid) : pinterfaceentry;
145 class function getinterfacetable : pinterfacetable;
149 TExceptProc = Procedure (Obj : TObject; Addr,Frame: Pointer);
151 { Exception object stack }
152 PExceptObject = ^TExceptObject;
153 TExceptObject = record
157 Next : PExceptObject;
161 ExceptProc : TExceptProc = Nil;
163 Function RaiseList : PExceptObject;
166 {*****************************************************************************
168 *****************************************************************************}
214 case VType : Longint of
215 vtInteger : (VInteger: Longint);
216 vtBoolean : (VBoolean: Boolean);
217 vtChar : (VChar: Char);
218 vtExtended : (VExtended: PExtended);
219 vtString : (VString: PShortString);
220 vtPointer : (VPointer: Pointer);
221 vtPChar : (VPChar: PChar);
222 vtObject : (VObject: TObject);
223 vtClass : (VClass: TClass);
224 // vtWideChar : (VWideChar: WideChar);
225 // vtPWideChar : (VPWideChar: PWideChar);
226 vtAnsiString : (VAnsiString: Pointer);
227 // vtCurrency : (VCurrency: PCurrency);
228 // vtVariant : (VVariant: PVariant);
229 // vtInterface : (VInterface: Pointer);
230 vtWideString : (VWideString: Pointer);
231 vtInt64 : (VInt64: PInt64);
232 vtQWord : (VQWord: PQWord);
236 Revision 1.1 2002/02/19 08:25:27 sasu
239 Revision 1.1 2000/07/13 06:30:48 michael
242 Revision 1.11 2000/06/22 18:05:56 michael
243 + Modifications for exception support in sysutils. Mainly added
246 Revision 1.10 2000/05/14 18:47:53 florian
247 * TVarRec with Int64/QWord stuff extended
249 Revision 1.9 2000/04/24 11:11:50 peter
250 * backtraces for exceptions are now only generated from the place of the
252 * frame is also pushed for exceptions
253 * raise statement enhanced with [,<frame>]
255 Revision 1.8 2000/02/09 16:59:31 peter
258 Revision 1.7 2000/01/07 16:41:36 daniel
261 Revision 1.6 2000/01/07 16:32:25 daniel
262 * copyright 2000 added
264 Revision 1.5 1999/12/02 19:28:53 peter
265 * public added to TObject
267 Revision 1.4 1999/08/09 22:20:03 peter
268 * classes vmt changed to only positive addresses
269 * sharedlib creation is working