| 1 |
unit CastleInternalTDxInput_TLB; |
| 2 |
|
| 3 |
// ************************************************************************ // |
| 4 |
// WARNING |
| 5 |
// ------- |
| 6 |
// The types declared in this file were generated from data read from a |
| 7 |
// Type Library. If this type library is explicitly or indirectly (via |
| 8 |
// another type library referring to this type library) re-imported, or the |
| 9 |
// 'Refresh' command of the Type Library Editor activated while editing the |
| 10 |
// Type Library, the contents of this file will be regenerated and all |
| 11 |
// manual modifications will be lost. |
| 12 |
// ************************************************************************ // |
| 13 |
|
| 14 |
// PASTLWTR : 1.2 |
| 15 |
// File generated on 30.05.2007 18:27:57 from Type Library described below. |
| 16 |
|
| 17 |
// ************************************************************************ // |
| 18 |
// Type Lib: C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\win32\TDxInput.dll (1) |
| 19 |
// LIBID: {7858B9E0-5793-4BE4-9B53-661D922790D2} |
| 20 |
// LCID: 0 |
| 21 |
// Helpfile: |
| 22 |
// HelpString: 3Dconnexion TDxInput 1.0 Type Library |
| 23 |
// DepndLst: |
| 24 |
// (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb) |
| 25 |
// Errors: |
| 26 |
// Hint: Parameter 'label' of IKeyboard.GetKeyLabel changed to 'label_' |
| 27 |
// Hint: Symbol 'Type' renamed to 'type_' |
| 28 |
// Error creating palette bitmap of (TAngleAxis) : Server C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\win32\TDxInput.dll contains no icons |
| 29 |
// Error creating palette bitmap of (TVector3D) : Server C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\win32\TDxInput.dll contains no icons |
| 30 |
// Error creating palette bitmap of (TSensor) : Server C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\win32\TDxInput.dll contains no icons |
| 31 |
// Error creating palette bitmap of (TKeyboard) : Server C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\win32\TDxInput.dll contains no icons |
| 32 |
// Error creating palette bitmap of (TDevice) : Server C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\win32\TDxInput.dll contains no icons |
| 33 |
// Error creating palette bitmap of (TTDxInfo) : Server C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\win32\TDxInput.dll contains no icons |
| 34 |
// ************************************************************************ // |
| 35 |
// *************************************************************************// |
| 36 |
// NOTE: |
| 37 |
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties |
| 38 |
// which return objects that may need to be explicitly created via a function |
| 39 |
// call prior to any access via the property. These items have been disabled |
| 40 |
// in order to prevent accidental use from within the object inspector. You |
| 41 |
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively |
| 42 |
// removing them from the $IFDEF blocks. However, such items must still be |
| 43 |
// programmatically created via a method of the appropriate CoClass before |
| 44 |
// they can be used. |
| 45 |
{$I castleconf.inc} |
| 46 |
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. |
| 47 |
{$WARN SYMBOL_PLATFORM OFF} |
| 48 |
{$WRITEABLECONST ON} |
| 49 |
{$VARPROPSETTER ON} |
| 50 |
interface |
| 51 |
|
| 52 |
{$ifdef CASTLE_DELPHI_PACKAGE} |
| 53 |
{$message fatal 'This unit should not be included in CGE Delphi package, as it is only for VCL.'} |
| 54 |
{$endif} |
| 55 |
|
| 56 |
uses Windows, ActiveX, Classes, {Graphics, }{$ifdef FPC}OleServer,{$else}Vcl.OleServer,{$endif} {StdVCL, }Variants; |
| 57 |
|
| 58 |
|
| 59 |
// *********************************************************************// |
| 60 |
// GUIDS declared in the TypeLibrary. Following prefixes are used: |
| 61 |
// Type Libraries : LIBID_xxxx |
| 62 |
// CoClasses : CLASS_xxxx |
| 63 |
// DISPInterfaces : DIID_xxxx |
| 64 |
// Non-DISP interfaces: IID_xxxx |
| 65 |
// *********************************************************************// |
| 66 |
const |
| 67 |
// TypeLibrary Major and minor versions |
| 68 |
TDxInputMajorVersion = 1; |
| 69 |
TDxInputMinorVersion = 0; |
| 70 |
|
| 71 |
LIBID_TDxInput: TGUID = '{7858B9E0-5793-4BE4-9B53-661D922790D2}'; |
| 72 |
|
| 73 |
IID_IAngleAxis: TGUID = '{1EF2BAFF-54E9-4706-9F61-078F7134FD35}'; |
| 74 |
CLASS_AngleAxis: TGUID = '{512A6C3E-3010-401B-8623-E413E2ACC138}'; |
| 75 |
IID_IVector3D: TGUID = '{8C2AA71D-2B23-43F5-A6ED-4DF57E9CD8D5}'; |
| 76 |
CLASS_Vector3D: TGUID = '{740A7479-C7C1-44DA-8A84-B5DE63C78B32}'; |
| 77 |
DIID__ISensorEvents: TGUID = '{E6929A4A-6F41-46C6-9252-A8CC53472CB1}'; |
| 78 |
IID_ISensor: TGUID = '{F3A6775E-6FA1-4829-BF32-5B045C29078F}'; |
| 79 |
CLASS_Sensor: TGUID = '{85004B00-1AA7-4777-B1CE-8427301B942D}'; |
| 80 |
DIID__IKeyboardEvents: TGUID = '{6B6BB0A8-4491-40CF-B1A9-C15A801FE151}'; |
| 81 |
IID_IKeyboard: TGUID = '{D6F968E7-2993-48D7-AF24-8B602D925B2C}'; |
| 82 |
CLASS_Keyboard: TGUID = '{25BBE090-583A-4903-A61B-D0EC629AC4EC}'; |
| 83 |
DIID__ISimpleDeviceEvents: TGUID = '{8FE3A216-E235-49A6-9136-F9D81FDADEF5}'; |
| 84 |
IID_ISimpleDevice: TGUID = '{CB3BF65E-0816-482A-BB11-64AF1E837812}'; |
| 85 |
CLASS_Device: TGUID = '{82C5AB54-C92C-4D52-AAC5-27E25E22604C}'; |
| 86 |
IID_ITDxInfo: TGUID = '{00612962-8FB6-47B2-BF98-4E8C0FF5F559}'; |
| 87 |
CLASS_TDxInfo: TGUID = '{1A960ECE-0E57-4A68-B694-8373114F1FF4}'; |
| 88 |
type |
| 89 |
|
| 90 |
// *********************************************************************// |
| 91 |
// Forward declaration of types defined in TypeLibrary |
| 92 |
// *********************************************************************// |
| 93 |
IAngleAxis = interface; |
| 94 |
IAngleAxisDisp = dispinterface; |
| 95 |
IVector3D = interface; |
| 96 |
IVector3DDisp = dispinterface; |
| 97 |
_ISensorEvents = dispinterface; |
| 98 |
ISensor = interface; |
| 99 |
ISensorDisp = dispinterface; |
| 100 |
_IKeyboardEvents = dispinterface; |
| 101 |
IKeyboard = interface; |
| 102 |
IKeyboardDisp = dispinterface; |
| 103 |
_ISimpleDeviceEvents = dispinterface; |
| 104 |
ISimpleDevice = interface; |
| 105 |
ISimpleDeviceDisp = dispinterface; |
| 106 |
ITDxInfo = interface; |
| 107 |
ITDxInfoDisp = dispinterface; |
| 108 |
|
| 109 |
// *********************************************************************// |
| 110 |
// Declaration of CoClasses defined in Type Library |
| 111 |
// (NOTE: Here we map each CoClass to its Default Interface) |
| 112 |
// *********************************************************************// |
| 113 |
AngleAxis = IAngleAxis; |
| 114 |
Vector3D = IVector3D; |
| 115 |
Sensor = ISensor; |
| 116 |
Keyboard = IKeyboard; |
| 117 |
Device = ISimpleDevice; |
| 118 |
TDxInfo = ITDxInfo; |
| 119 |
|
| 120 |
|
| 121 |
// *********************************************************************// |
| 122 |
// Interface: IAngleAxis |
| 123 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 124 |
// GUID: {1EF2BAFF-54E9-4706-9F61-078F7134FD35} |
| 125 |
// *********************************************************************// |
| 126 |
IAngleAxis = interface(IDispatch) |
| 127 |
['{1EF2BAFF-54E9-4706-9F61-078F7134FD35}'] |
| 128 |
function Get_X: Double; safecall; |
| 129 |
procedure Set_X(pVal: Double); safecall; |
| 130 |
function Get_Y: Double; safecall; |
| 131 |
procedure Set_Y(pVal: Double); safecall; |
| 132 |
function Get_Z: Double; safecall; |
| 133 |
procedure Set_Z(pVal: Double); safecall; |
| 134 |
function Get_Angle: Double; safecall; |
| 135 |
procedure Set_Angle(pVal: Double); safecall; |
| 136 |
property X: Double read Get_X write Set_X; |
| 137 |
property Y: Double read Get_Y write Set_Y; |
| 138 |
property Z: Double read Get_Z write Set_Z; |
| 139 |
property Angle: Double read Get_Angle write Set_Angle; |
| 140 |
end; |
| 141 |
|
| 142 |
// *********************************************************************// |
| 143 |
// DispIntf: IAngleAxisDisp |
| 144 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 145 |
// GUID: {1EF2BAFF-54E9-4706-9F61-078F7134FD35} |
| 146 |
// *********************************************************************// |
| 147 |
IAngleAxisDisp = dispinterface |
| 148 |
['{1EF2BAFF-54E9-4706-9F61-078F7134FD35}'] |
| 149 |
property X: Double dispid 1; |
| 150 |
property Y: Double dispid 2; |
| 151 |
property Z: Double dispid 3; |
| 152 |
property Angle: Double dispid 4; |
| 153 |
end; |
| 154 |
|
| 155 |
// *********************************************************************// |
| 156 |
// Interface: IVector3D |
| 157 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 158 |
// GUID: {8C2AA71D-2B23-43F5-A6ED-4DF57E9CD8D5} |
| 159 |
// *********************************************************************// |
| 160 |
IVector3D = interface(IDispatch) |
| 161 |
['{8C2AA71D-2B23-43F5-A6ED-4DF57E9CD8D5}'] |
| 162 |
function Get_X: Double; safecall; |
| 163 |
procedure Set_X(pVal: Double); safecall; |
| 164 |
function Get_Y: Double; safecall; |
| 165 |
procedure Set_Y(pVal: Double); safecall; |
| 166 |
function Get_Z: Double; safecall; |
| 167 |
procedure Set_Z(pVal: Double); safecall; |
| 168 |
function Get_Length: Double; safecall; |
| 169 |
procedure Set_Length(pVal: Double); safecall; |
| 170 |
property X: Double read Get_X write Set_X; |
| 171 |
property Y: Double read Get_Y write Set_Y; |
| 172 |
property Z: Double read Get_Z write Set_Z; |
| 173 |
property Length: Double read Get_Length write Set_Length; |
| 174 |
end; |
| 175 |
|
| 176 |
// *********************************************************************// |
| 177 |
// DispIntf: IVector3DDisp |
| 178 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 179 |
// GUID: {8C2AA71D-2B23-43F5-A6ED-4DF57E9CD8D5} |
| 180 |
// *********************************************************************// |
| 181 |
IVector3DDisp = dispinterface |
| 182 |
['{8C2AA71D-2B23-43F5-A6ED-4DF57E9CD8D5}'] |
| 183 |
property X: Double dispid 1; |
| 184 |
property Y: Double dispid 2; |
| 185 |
property Z: Double dispid 3; |
| 186 |
property Length: Double dispid 4; |
| 187 |
end; |
| 188 |
|
| 189 |
// *********************************************************************// |
| 190 |
// DispIntf: _ISensorEvents |
| 191 |
// Flags: (4096) Dispatchable |
| 192 |
// GUID: {E6929A4A-6F41-46C6-9252-A8CC53472CB1} |
| 193 |
// *********************************************************************// |
| 194 |
_ISensorEvents = dispinterface |
| 195 |
['{E6929A4A-6F41-46C6-9252-A8CC53472CB1}'] |
| 196 |
procedure SensorInput; dispid 1; |
| 197 |
end; |
| 198 |
|
| 199 |
// *********************************************************************// |
| 200 |
// Interface: ISensor |
| 201 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 202 |
// GUID: {F3A6775E-6FA1-4829-BF32-5B045C29078F} |
| 203 |
// *********************************************************************// |
| 204 |
ISensor = interface(IDispatch) |
| 205 |
['{F3A6775E-6FA1-4829-BF32-5B045C29078F}'] |
| 206 |
function Get_Translation: IVector3D; safecall; |
| 207 |
function Get_Rotation: IAngleAxis; safecall; |
| 208 |
function Get_Device: IDispatch; safecall; |
| 209 |
function Get_Period: Double; safecall; |
| 210 |
property Translation: IVector3D read Get_Translation; |
| 211 |
property Rotation: IAngleAxis read Get_Rotation; |
| 212 |
property Device: IDispatch read Get_Device; |
| 213 |
property Period: Double read Get_Period; |
| 214 |
end; |
| 215 |
|
| 216 |
// *********************************************************************// |
| 217 |
// DispIntf: ISensorDisp |
| 218 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 219 |
// GUID: {F3A6775E-6FA1-4829-BF32-5B045C29078F} |
| 220 |
// *********************************************************************// |
| 221 |
ISensorDisp = dispinterface |
| 222 |
['{F3A6775E-6FA1-4829-BF32-5B045C29078F}'] |
| 223 |
property Translation: IVector3D readonly dispid 1; |
| 224 |
property Rotation: IAngleAxis readonly dispid 2; |
| 225 |
property Device: IDispatch readonly dispid 3; |
| 226 |
property Period: Double readonly dispid 4; |
| 227 |
end; |
| 228 |
|
| 229 |
// *********************************************************************// |
| 230 |
// DispIntf: _IKeyboardEvents |
| 231 |
// Flags: (4096) Dispatchable |
| 232 |
// GUID: {6B6BB0A8-4491-40CF-B1A9-C15A801FE151} |
| 233 |
// *********************************************************************// |
| 234 |
_IKeyboardEvents = dispinterface |
| 235 |
['{6B6BB0A8-4491-40CF-B1A9-C15A801FE151}'] |
| 236 |
procedure KeyDown(keyCode: SYSINT); dispid 1; |
| 237 |
procedure KeyUp(keyCode: SYSINT); dispid 2; |
| 238 |
end; |
| 239 |
|
| 240 |
// *********************************************************************// |
| 241 |
// Interface: IKeyboard |
| 242 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 243 |
// GUID: {D6F968E7-2993-48D7-AF24-8B602D925B2C} |
| 244 |
// *********************************************************************// |
| 245 |
IKeyboard = interface(IDispatch) |
| 246 |
['{D6F968E7-2993-48D7-AF24-8B602D925B2C}'] |
| 247 |
function Get_Keys: Integer; safecall; |
| 248 |
function Get_ProgrammableKeys: Integer; safecall; |
| 249 |
function GetKeyLabel(key: Integer): WideString; safecall; |
| 250 |
function GetKeyName(key: Integer): WideString; safecall; |
| 251 |
function Get_Device: IDispatch; safecall; |
| 252 |
function IsKeyDown(key: Integer): WordBool; safecall; |
| 253 |
function IsKeyUp(key: Integer): WordBool; safecall; |
| 254 |
property Keys: Integer read Get_Keys; |
| 255 |
property ProgrammableKeys: Integer read Get_ProgrammableKeys; |
| 256 |
property Device: IDispatch read Get_Device; |
| 257 |
end; |
| 258 |
|
| 259 |
// *********************************************************************// |
| 260 |
// DispIntf: IKeyboardDisp |
| 261 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 262 |
// GUID: {D6F968E7-2993-48D7-AF24-8B602D925B2C} |
| 263 |
// *********************************************************************// |
| 264 |
IKeyboardDisp = dispinterface |
| 265 |
['{D6F968E7-2993-48D7-AF24-8B602D925B2C}'] |
| 266 |
property Keys: Integer readonly dispid 1; |
| 267 |
property ProgrammableKeys: Integer readonly dispid 2; |
| 268 |
function GetKeyLabel(key: Integer): WideString; dispid 3; |
| 269 |
function GetKeyName(key: Integer): WideString; dispid 4; |
| 270 |
property Device: IDispatch readonly dispid 5; |
| 271 |
function IsKeyDown(key: Integer): WordBool; dispid 6; |
| 272 |
function IsKeyUp(key: Integer): WordBool; dispid 7; |
| 273 |
end; |
| 274 |
|
| 275 |
// *********************************************************************// |
| 276 |
// DispIntf: _ISimpleDeviceEvents |
| 277 |
// Flags: (4096) Dispatchable |
| 278 |
// GUID: {8FE3A216-E235-49A6-9136-F9D81FDADEF5} |
| 279 |
// *********************************************************************// |
| 280 |
_ISimpleDeviceEvents = dispinterface |
| 281 |
['{8FE3A216-E235-49A6-9136-F9D81FDADEF5}'] |
| 282 |
procedure DeviceChange(reserved: Integer); dispid 1; |
| 283 |
end; |
| 284 |
|
| 285 |
// *********************************************************************// |
| 286 |
// Interface: ISimpleDevice |
| 287 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 288 |
// GUID: {CB3BF65E-0816-482A-BB11-64AF1E837812} |
| 289 |
// *********************************************************************// |
| 290 |
ISimpleDevice = interface(IDispatch) |
| 291 |
['{CB3BF65E-0816-482A-BB11-64AF1E837812}'] |
| 292 |
procedure Connect; safecall; |
| 293 |
procedure Disconnect; safecall; |
| 294 |
function Get_Sensor: ISensor; safecall; |
| 295 |
function Get_Keyboard: IKeyboard; safecall; |
| 296 |
function Get_type_: Integer; safecall; |
| 297 |
function Get_IsConnected: WordBool; safecall; |
| 298 |
procedure LoadPreferences(const PreferencesName: WideString); safecall; |
| 299 |
property Sensor: ISensor read Get_Sensor; |
| 300 |
property Keyboard: IKeyboard read Get_Keyboard; |
| 301 |
property type_: Integer read Get_type_; |
| 302 |
property IsConnected: WordBool read Get_IsConnected; |
| 303 |
end; |
| 304 |
|
| 305 |
// *********************************************************************// |
| 306 |
// DispIntf: ISimpleDeviceDisp |
| 307 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 308 |
// GUID: {CB3BF65E-0816-482A-BB11-64AF1E837812} |
| 309 |
// *********************************************************************// |
| 310 |
ISimpleDeviceDisp = dispinterface |
| 311 |
['{CB3BF65E-0816-482A-BB11-64AF1E837812}'] |
| 312 |
procedure Connect; dispid 1; |
| 313 |
procedure Disconnect; dispid 2; |
| 314 |
property Sensor: ISensor readonly dispid 3; |
| 315 |
property Keyboard: IKeyboard readonly dispid 4; |
| 316 |
property type_: Integer readonly dispid 5; |
| 317 |
property IsConnected: WordBool readonly dispid 6; |
| 318 |
procedure LoadPreferences(const PreferencesName: WideString); dispid 7; |
| 319 |
end; |
| 320 |
|
| 321 |
// *********************************************************************// |
| 322 |
// Interface: ITDxInfo |
| 323 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 324 |
// GUID: {00612962-8FB6-47B2-BF98-4E8C0FF5F559} |
| 325 |
// *********************************************************************// |
| 326 |
ITDxInfo = interface(IDispatch) |
| 327 |
['{00612962-8FB6-47B2-BF98-4E8C0FF5F559}'] |
| 328 |
function RevisionNumber: WideString; safecall; |
| 329 |
end; |
| 330 |
|
| 331 |
// *********************************************************************// |
| 332 |
// DispIntf: ITDxInfoDisp |
| 333 |
// Flags: (4416) Dual OleAutomation Dispatchable |
| 334 |
// GUID: {00612962-8FB6-47B2-BF98-4E8C0FF5F559} |
| 335 |
// *********************************************************************// |
| 336 |
ITDxInfoDisp = dispinterface |
| 337 |
['{00612962-8FB6-47B2-BF98-4E8C0FF5F559}'] |
| 338 |
function RevisionNumber: WideString; dispid 1; |
| 339 |
end; |
| 340 |
|
| 341 |
// *********************************************************************// |
| 342 |
// The Class CoAngleAxis provides a Create and CreateRemote method to |
| 343 |
// create instances of the default interface IAngleAxis exposed by |
| 344 |
// the CoClass AngleAxis. The functions are intended to be used by |
| 345 |
// clients wishing to automate the CoClass objects exposed by the |
| 346 |
// server of this typelibrary. |
| 347 |
// *********************************************************************// |
| 348 |
CoAngleAxis = class |
| 349 |
class function Create: IAngleAxis; |
| 350 |
class function CreateRemote(const MachineName: string): IAngleAxis; |
| 351 |
end; |
| 352 |
|
| 353 |
|
| 354 |
// *********************************************************************// |
| 355 |
// OLE Server Proxy class declaration |
| 356 |
// Server Object : TAngleAxis |
| 357 |
// Help String : AngleAxis Class |
| 358 |
// Default Interface: IAngleAxis |
| 359 |
// Def. Intf. DISP? : No |
| 360 |
// Event Interface: |
| 361 |
// TypeFlags : (1026) CanCreate Aggregatable |
| 362 |
// *********************************************************************// |
| 363 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 364 |
TAngleAxisProperties= class; |
| 365 |
{$ENDIF} |
| 366 |
TAngleAxis = class(TOleServer) |
| 367 |
private |
| 368 |
FIntf: IAngleAxis; |
| 369 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 370 |
FProps: TAngleAxisProperties; |
| 371 |
function GetServerProperties: TAngleAxisProperties; |
| 372 |
{$ENDIF} |
| 373 |
function GetDefaultInterface: IAngleAxis; |
| 374 |
protected |
| 375 |
procedure InitServerData; override; |
| 376 |
function Get_X: Double; |
| 377 |
procedure Set_X(pVal: Double); |
| 378 |
function Get_Y: Double; |
| 379 |
procedure Set_Y(pVal: Double); |
| 380 |
function Get_Z: Double; |
| 381 |
procedure Set_Z(pVal: Double); |
| 382 |
function Get_Angle: Double; |
| 383 |
procedure Set_Angle(pVal: Double); |
| 384 |
public |
| 385 |
constructor Create(AOwner: TComponent); override; |
| 386 |
destructor Destroy; override; |
| 387 |
procedure Connect; override; |
| 388 |
procedure ConnectTo(svrIntf: IAngleAxis); |
| 389 |
procedure Disconnect; override; |
| 390 |
property DefaultInterface: IAngleAxis read GetDefaultInterface; |
| 391 |
property X: Double read Get_X write Set_X; |
| 392 |
property Y: Double read Get_Y write Set_Y; |
| 393 |
property Z: Double read Get_Z write Set_Z; |
| 394 |
property Angle: Double read Get_Angle write Set_Angle; |
| 395 |
published |
| 396 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 397 |
property Server: TAngleAxisProperties read GetServerProperties; |
| 398 |
{$ENDIF} |
| 399 |
end; |
| 400 |
|
| 401 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 402 |
// *********************************************************************// |
| 403 |
// OLE Server Properties Proxy Class |
| 404 |
// Server Object : TAngleAxis |
| 405 |
// (This object is used by the IDE's Property Inspector to allow editing |
| 406 |
// of the properties of this server) |
| 407 |
// *********************************************************************// |
| 408 |
TAngleAxisProperties = class(TPersistent) |
| 409 |
private |
| 410 |
FServer: TAngleAxis; |
| 411 |
function GetDefaultInterface: IAngleAxis; |
| 412 |
constructor Create(AServer: TAngleAxis); |
| 413 |
protected |
| 414 |
function Get_X: Double; |
| 415 |
procedure Set_X(pVal: Double); |
| 416 |
function Get_Y: Double; |
| 417 |
procedure Set_Y(pVal: Double); |
| 418 |
function Get_Z: Double; |
| 419 |
procedure Set_Z(pVal: Double); |
| 420 |
function Get_Angle: Double; |
| 421 |
procedure Set_Angle(pVal: Double); |
| 422 |
public |
| 423 |
property DefaultInterface: IAngleAxis read GetDefaultInterface; |
| 424 |
published |
| 425 |
property X: Double read Get_X write Set_X; |
| 426 |
property Y: Double read Get_Y write Set_Y; |
| 427 |
property Z: Double read Get_Z write Set_Z; |
| 428 |
property Angle: Double read Get_Angle write Set_Angle; |
| 429 |
end; |
| 430 |
{$ENDIF} |
| 431 |
|
| 432 |
|
| 433 |
// *********************************************************************// |
| 434 |
// The Class CoVector3D provides a Create and CreateRemote method to |
| 435 |
// create instances of the default interface IVector3D exposed by |
| 436 |
// the CoClass Vector3D. The functions are intended to be used by |
| 437 |
// clients wishing to automate the CoClass objects exposed by the |
| 438 |
// server of this typelibrary. |
| 439 |
// *********************************************************************// |
| 440 |
CoVector3D = class |
| 441 |
class function Create: IVector3D; |
| 442 |
class function CreateRemote(const MachineName: string): IVector3D; |
| 443 |
end; |
| 444 |
|
| 445 |
|
| 446 |
// *********************************************************************// |
| 447 |
// OLE Server Proxy class declaration |
| 448 |
// Server Object : TVector3D |
| 449 |
// Help String : Vector3D Class |
| 450 |
// Default Interface: IVector3D |
| 451 |
// Def. Intf. DISP? : No |
| 452 |
// Event Interface: |
| 453 |
// TypeFlags : (1026) CanCreate Aggregatable |
| 454 |
// *********************************************************************// |
| 455 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 456 |
TVector3DProperties= class; |
| 457 |
{$ENDIF} |
| 458 |
TVector3D = class(TOleServer) |
| 459 |
private |
| 460 |
FIntf: IVector3D; |
| 461 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 462 |
FProps: TVector3DProperties; |
| 463 |
function GetServerProperties: TVector3DProperties; |
| 464 |
{$ENDIF} |
| 465 |
function GetDefaultInterface: IVector3D; |
| 466 |
protected |
| 467 |
procedure InitServerData; override; |
| 468 |
function Get_X: Double; |
| 469 |
procedure Set_X(pVal: Double); |
| 470 |
function Get_Y: Double; |
| 471 |
procedure Set_Y(pVal: Double); |
| 472 |
function Get_Z: Double; |
| 473 |
procedure Set_Z(pVal: Double); |
| 474 |
function Get_Length: Double; |
| 475 |
procedure Set_Length(pVal: Double); |
| 476 |
public |
| 477 |
constructor Create(AOwner: TComponent); override; |
| 478 |
destructor Destroy; override; |
| 479 |
procedure Connect; override; |
| 480 |
procedure ConnectTo(svrIntf: IVector3D); |
| 481 |
procedure Disconnect; override; |
| 482 |
property DefaultInterface: IVector3D read GetDefaultInterface; |
| 483 |
property X: Double read Get_X write Set_X; |
| 484 |
property Y: Double read Get_Y write Set_Y; |
| 485 |
property Z: Double read Get_Z write Set_Z; |
| 486 |
property Length: Double read Get_Length write Set_Length; |
| 487 |
published |
| 488 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 489 |
property Server: TVector3DProperties read GetServerProperties; |
| 490 |
{$ENDIF} |
| 491 |
end; |
| 492 |
|
| 493 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 494 |
// *********************************************************************// |
| 495 |
// OLE Server Properties Proxy Class |
| 496 |
// Server Object : TVector3D |
| 497 |
// (This object is used by the IDE's Property Inspector to allow editing |
| 498 |
// of the properties of this server) |
| 499 |
// *********************************************************************// |
| 500 |
TVector3DProperties = class(TPersistent) |
| 501 |
private |
| 502 |
FServer: TVector3D; |
| 503 |
function GetDefaultInterface: IVector3D; |
| 504 |
constructor Create(AServer: TVector3D); |
| 505 |
protected |
| 506 |
function Get_X: Double; |
| 507 |
procedure Set_X(pVal: Double); |
| 508 |
function Get_Y: Double; |
| 509 |
procedure Set_Y(pVal: Double); |
| 510 |
function Get_Z: Double; |
| 511 |
procedure Set_Z(pVal: Double); |
| 512 |
function Get_Length: Double; |
| 513 |
procedure Set_Length(pVal: Double); |
| 514 |
public |
| 515 |
property DefaultInterface: IVector3D read GetDefaultInterface; |
| 516 |
published |
| 517 |
property X: Double read Get_X write Set_X; |
| 518 |
property Y: Double read Get_Y write Set_Y; |
| 519 |
property Z: Double read Get_Z write Set_Z; |
| 520 |
property Length: Double read Get_Length write Set_Length; |
| 521 |
end; |
| 522 |
{$ENDIF} |
| 523 |
|
| 524 |
|
| 525 |
// *********************************************************************// |
| 526 |
// The Class CoSensor provides a Create and CreateRemote method to |
| 527 |
// create instances of the default interface ISensor exposed by |
| 528 |
// the CoClass Sensor. The functions are intended to be used by |
| 529 |
// clients wishing to automate the CoClass objects exposed by the |
| 530 |
// server of this typelibrary. |
| 531 |
// *********************************************************************// |
| 532 |
CoSensor = class |
| 533 |
class function Create: ISensor; |
| 534 |
class function CreateRemote(const MachineName: string): ISensor; |
| 535 |
end; |
| 536 |
|
| 537 |
|
| 538 |
// *********************************************************************// |
| 539 |
// OLE Server Proxy class declaration |
| 540 |
// Server Object : TSensor |
| 541 |
// Help String : Sensor Class |
| 542 |
// Default Interface: ISensor |
| 543 |
// Def. Intf. DISP? : No |
| 544 |
// Event Interface: _ISensorEvents |
| 545 |
// TypeFlags : (1026) CanCreate Aggregatable |
| 546 |
// *********************************************************************// |
| 547 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 548 |
TSensorProperties= class; |
| 549 |
{$ENDIF} |
| 550 |
TSensor = class(TOleServer) |
| 551 |
private |
| 552 |
FOnSensorInput: TNotifyEvent; |
| 553 |
FIntf: ISensor; |
| 554 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 555 |
FProps: TSensorProperties; |
| 556 |
function GetServerProperties: TSensorProperties; |
| 557 |
{$ENDIF} |
| 558 |
function GetDefaultInterface: ISensor; |
| 559 |
protected |
| 560 |
procedure InitServerData; override; |
| 561 |
procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override; |
| 562 |
function Get_Translation: IVector3D; |
| 563 |
function Get_Rotation: IAngleAxis; |
| 564 |
function Get_Device: IDispatch; |
| 565 |
function Get_Period: Double; |
| 566 |
public |
| 567 |
constructor Create(AOwner: TComponent); override; |
| 568 |
destructor Destroy; override; |
| 569 |
procedure Connect; override; |
| 570 |
procedure ConnectTo(svrIntf: ISensor); |
| 571 |
procedure Disconnect; override; |
| 572 |
property DefaultInterface: ISensor read GetDefaultInterface; |
| 573 |
property Translation: IVector3D read Get_Translation; |
| 574 |
property Rotation: IAngleAxis read Get_Rotation; |
| 575 |
property Device: IDispatch read Get_Device; |
| 576 |
property Period: Double read Get_Period; |
| 577 |
published |
| 578 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 579 |
property Server: TSensorProperties read GetServerProperties; |
| 580 |
{$ENDIF} |
| 581 |
property OnSensorInput: TNotifyEvent read FOnSensorInput write FOnSensorInput; |
| 582 |
end; |
| 583 |
|
| 584 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 585 |
// *********************************************************************// |
| 586 |
// OLE Server Properties Proxy Class |
| 587 |
// Server Object : TSensor |
| 588 |
// (This object is used by the IDE's Property Inspector to allow editing |
| 589 |
// of the properties of this server) |
| 590 |
// *********************************************************************// |
| 591 |
TSensorProperties = class(TPersistent) |
| 592 |
private |
| 593 |
FServer: TSensor; |
| 594 |
function GetDefaultInterface: ISensor; |
| 595 |
constructor Create(AServer: TSensor); |
| 596 |
protected |
| 597 |
function Get_Translation: IVector3D; |
| 598 |
function Get_Rotation: IAngleAxis; |
| 599 |
function Get_Device: IDispatch; |
| 600 |
function Get_Period: Double; |
| 601 |
public |
| 602 |
property DefaultInterface: ISensor read GetDefaultInterface; |
| 603 |
published |
| 604 |
end; |
| 605 |
{$ENDIF} |
| 606 |
|
| 607 |
|
| 608 |
// *********************************************************************// |
| 609 |
// The Class CoKeyboard provides a Create and CreateRemote method to |
| 610 |
// create instances of the default interface IKeyboard exposed by |
| 611 |
// the CoClass Keyboard. The functions are intended to be used by |
| 612 |
// clients wishing to automate the CoClass objects exposed by the |
| 613 |
// server of this typelibrary. |
| 614 |
// *********************************************************************// |
| 615 |
CoKeyboard = class |
| 616 |
class function Create: IKeyboard; |
| 617 |
class function CreateRemote(const MachineName: string): IKeyboard; |
| 618 |
end; |
| 619 |
|
| 620 |
TKeyboardKeyDown = procedure(ASender: TObject; keyCode: SYSINT) of object; |
| 621 |
TKeyboardKeyUp = procedure(ASender: TObject; keyCode: SYSINT) of object; |
| 622 |
|
| 623 |
|
| 624 |
// *********************************************************************// |
| 625 |
// OLE Server Proxy class declaration |
| 626 |
// Server Object : TKeyboard |
| 627 |
// Help String : Keyboard Class |
| 628 |
// Default Interface: IKeyboard |
| 629 |
// Def. Intf. DISP? : No |
| 630 |
// Event Interface: _IKeyboardEvents |
| 631 |
// TypeFlags : (1026) CanCreate Aggregatable |
| 632 |
// *********************************************************************// |
| 633 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 634 |
TKeyboardProperties= class; |
| 635 |
{$ENDIF} |
| 636 |
TKeyboard = class(TOleServer) |
| 637 |
private |
| 638 |
FOnKeyDown: TKeyboardKeyDown; |
| 639 |
FOnKeyUp: TKeyboardKeyUp; |
| 640 |
FIntf: IKeyboard; |
| 641 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 642 |
FProps: TKeyboardProperties; |
| 643 |
function GetServerProperties: TKeyboardProperties; |
| 644 |
{$ENDIF} |
| 645 |
function GetDefaultInterface: IKeyboard; |
| 646 |
protected |
| 647 |
procedure InitServerData; override; |
| 648 |
procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override; |
| 649 |
function Get_Keys: Integer; |
| 650 |
function Get_ProgrammableKeys: Integer; |
| 651 |
function Get_Device: IDispatch; |
| 652 |
public |
| 653 |
constructor Create(AOwner: TComponent); override; |
| 654 |
destructor Destroy; override; |
| 655 |
procedure Connect; override; |
| 656 |
procedure ConnectTo(svrIntf: IKeyboard); |
| 657 |
procedure Disconnect; override; |
| 658 |
function GetKeyLabel(key: Integer): WideString; |
| 659 |
function GetKeyName(key: Integer): WideString; |
| 660 |
function IsKeyDown(key: Integer): WordBool; |
| 661 |
function IsKeyUp(key: Integer): WordBool; |
| 662 |
property DefaultInterface: IKeyboard read GetDefaultInterface; |
| 663 |
property Keys: Integer read Get_Keys; |
| 664 |
property ProgrammableKeys: Integer read Get_ProgrammableKeys; |
| 665 |
property Device: IDispatch read Get_Device; |
| 666 |
published |
| 667 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 668 |
property Server: TKeyboardProperties read GetServerProperties; |
| 669 |
{$ENDIF} |
| 670 |
property OnKeyDown: TKeyboardKeyDown read FOnKeyDown write FOnKeyDown; |
| 671 |
property OnKeyUp: TKeyboardKeyUp read FOnKeyUp write FOnKeyUp; |
| 672 |
end; |
| 673 |
|
| 674 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 675 |
// *********************************************************************// |
| 676 |
// OLE Server Properties Proxy Class |
| 677 |
// Server Object : TKeyboard |
| 678 |
// (This object is used by the IDE's Property Inspector to allow editing |
| 679 |
// of the properties of this server) |
| 680 |
// *********************************************************************// |
| 681 |
TKeyboardProperties = class(TPersistent) |
| 682 |
private |
| 683 |
FServer: TKeyboard; |
| 684 |
function GetDefaultInterface: IKeyboard; |
| 685 |
constructor Create(AServer: TKeyboard); |
| 686 |
protected |
| 687 |
function Get_Keys: Integer; |
| 688 |
function Get_ProgrammableKeys: Integer; |
| 689 |
function Get_Device: IDispatch; |
| 690 |
public |
| 691 |
property DefaultInterface: IKeyboard read GetDefaultInterface; |
| 692 |
published |
| 693 |
end; |
| 694 |
{$ENDIF} |
| 695 |
|
| 696 |
|
| 697 |
// *********************************************************************// |
| 698 |
// The Class CoDevice provides a Create and CreateRemote method to |
| 699 |
// create instances of the default interface ISimpleDevice exposed by |
| 700 |
// the CoClass Device. The functions are intended to be used by |
| 701 |
// clients wishing to automate the CoClass objects exposed by the |
| 702 |
// server of this typelibrary. |
| 703 |
// *********************************************************************// |
| 704 |
CoDevice = class |
| 705 |
class function Create: ISimpleDevice; |
| 706 |
class function CreateRemote(const MachineName: string): ISimpleDevice; |
| 707 |
end; |
| 708 |
|
| 709 |
TDeviceDeviceChange = procedure(ASender: TObject; reserved: Integer) of object; |
| 710 |
|
| 711 |
|
| 712 |
// *********************************************************************// |
| 713 |
// OLE Server Proxy class declaration |
| 714 |
// Server Object : TDevice |
| 715 |
// Help String : Device Class |
| 716 |
// Default Interface: ISimpleDevice |
| 717 |
// Def. Intf. DISP? : No |
| 718 |
// Event Interface: _ISimpleDeviceEvents |
| 719 |
// TypeFlags : (2) CanCreate |
| 720 |
// *********************************************************************// |
| 721 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 722 |
TDeviceProperties= class; |
| 723 |
{$ENDIF} |
| 724 |
TDevice = class(TOleServer) |
| 725 |
private |
| 726 |
FOnDeviceChange: TDeviceDeviceChange; |
| 727 |
FIntf: ISimpleDevice; |
| 728 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 729 |
FProps: TDeviceProperties; |
| 730 |
function GetServerProperties: TDeviceProperties; |
| 731 |
{$ENDIF} |
| 732 |
function GetDefaultInterface: ISimpleDevice; |
| 733 |
protected |
| 734 |
procedure InitServerData; override; |
| 735 |
procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override; |
| 736 |
function Get_Sensor: ISensor; |
| 737 |
function Get_Keyboard: IKeyboard; |
| 738 |
function Get_type_: Integer; |
| 739 |
function Get_IsConnected: WordBool; |
| 740 |
public |
| 741 |
constructor Create(AOwner: TComponent); override; |
| 742 |
destructor Destroy; override; |
| 743 |
procedure Connect; override; |
| 744 |
procedure ConnectTo(svrIntf: ISimpleDevice); |
| 745 |
procedure Disconnect; override; |
| 746 |
procedure Connect1; |
| 747 |
procedure Disconnect1; |
| 748 |
procedure LoadPreferences(const PreferencesName: WideString); |
| 749 |
property DefaultInterface: ISimpleDevice read GetDefaultInterface; |
| 750 |
property Sensor: ISensor read Get_Sensor; |
| 751 |
property Keyboard: IKeyboard read Get_Keyboard; |
| 752 |
property type_: Integer read Get_type_; |
| 753 |
property IsConnected: WordBool read Get_IsConnected; |
| 754 |
published |
| 755 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 756 |
property Server: TDeviceProperties read GetServerProperties; |
| 757 |
{$ENDIF} |
| 758 |
property OnDeviceChange: TDeviceDeviceChange read FOnDeviceChange write FOnDeviceChange; |
| 759 |
end; |
| 760 |
|
| 761 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 762 |
// *********************************************************************// |
| 763 |
// OLE Server Properties Proxy Class |
| 764 |
// Server Object : TDevice |
| 765 |
// (This object is used by the IDE's Property Inspector to allow editing |
| 766 |
// of the properties of this server) |
| 767 |
// *********************************************************************// |
| 768 |
TDeviceProperties = class(TPersistent) |
| 769 |
private |
| 770 |
FServer: TDevice; |
| 771 |
function GetDefaultInterface: ISimpleDevice; |
| 772 |
constructor Create(AServer: TDevice); |
| 773 |
protected |
| 774 |
function Get_Sensor: ISensor; |
| 775 |
function Get_Keyboard: IKeyboard; |
| 776 |
function Get_type_: Integer; |
| 777 |
function Get_IsConnected: WordBool; |
| 778 |
public |
| 779 |
property DefaultInterface: ISimpleDevice read GetDefaultInterface; |
| 780 |
published |
| 781 |
end; |
| 782 |
{$ENDIF} |
| 783 |
|
| 784 |
|
| 785 |
// *********************************************************************// |
| 786 |
// The Class CoTDxInfo provides a Create and CreateRemote method to |
| 787 |
// create instances of the default interface ITDxInfo exposed by |
| 788 |
// the CoClass TDxInfo. The functions are intended to be used by |
| 789 |
// clients wishing to automate the CoClass objects exposed by the |
| 790 |
// server of this typelibrary. |
| 791 |
// *********************************************************************// |
| 792 |
CoTDxInfo = class |
| 793 |
class function Create: ITDxInfo; |
| 794 |
class function CreateRemote(const MachineName: string): ITDxInfo; |
| 795 |
end; |
| 796 |
|
| 797 |
|
| 798 |
// *********************************************************************// |
| 799 |
// OLE Server Proxy class declaration |
| 800 |
// Server Object : TTDxInfo |
| 801 |
// Help String : TDxInfo Class |
| 802 |
// Default Interface: ITDxInfo |
| 803 |
// Def. Intf. DISP? : No |
| 804 |
// Event Interface: |
| 805 |
// TypeFlags : (2) CanCreate |
| 806 |
// *********************************************************************// |
| 807 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 808 |
TTDxInfoProperties= class; |
| 809 |
{$ENDIF} |
| 810 |
TTDxInfo = class(TOleServer) |
| 811 |
private |
| 812 |
FIntf: ITDxInfo; |
| 813 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 814 |
FProps: TTDxInfoProperties; |
| 815 |
function GetServerProperties: TTDxInfoProperties; |
| 816 |
{$ENDIF} |
| 817 |
function GetDefaultInterface: ITDxInfo; |
| 818 |
protected |
| 819 |
procedure InitServerData; override; |
| 820 |
public |
| 821 |
constructor Create(AOwner: TComponent); override; |
| 822 |
destructor Destroy; override; |
| 823 |
procedure Connect; override; |
| 824 |
procedure ConnectTo(svrIntf: ITDxInfo); |
| 825 |
procedure Disconnect; override; |
| 826 |
function RevisionNumber: WideString; |
| 827 |
property DefaultInterface: ITDxInfo read GetDefaultInterface; |
| 828 |
published |
| 829 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 830 |
property Server: TTDxInfoProperties read GetServerProperties; |
| 831 |
{$ENDIF} |
| 832 |
end; |
| 833 |
|
| 834 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 835 |
// *********************************************************************// |
| 836 |
// OLE Server Properties Proxy Class |
| 837 |
// Server Object : TTDxInfo |
| 838 |
// (This object is used by the IDE's Property Inspector to allow editing |
| 839 |
// of the properties of this server) |
| 840 |
// *********************************************************************// |
| 841 |
TTDxInfoProperties = class(TPersistent) |
| 842 |
private |
| 843 |
FServer: TTDxInfo; |
| 844 |
function GetDefaultInterface: ITDxInfo; |
| 845 |
constructor Create(AServer: TTDxInfo); |
| 846 |
protected |
| 847 |
public |
| 848 |
property DefaultInterface: ITDxInfo read GetDefaultInterface; |
| 849 |
published |
| 850 |
end; |
| 851 |
{$ENDIF} |
| 852 |
|
| 853 |
// CGE: Do not register any components |
| 854 |
//procedure Register; |
| 855 |
|
| 856 |
resourcestring |
| 857 |
dtlServerPage = 'ActiveX'; |
| 858 |
|
| 859 |
dtlOcxPage = 'ActiveX'; |
| 860 |
|
| 861 |
implementation |
| 862 |
|
| 863 |
uses ComObj; |
| 864 |
|
| 865 |
class function CoAngleAxis.Create: IAngleAxis; |
| 866 |
begin |
| 867 |
Result := CreateComObject(CLASS_AngleAxis) as IAngleAxis; |
| 868 |
end; |
| 869 |
|
| 870 |
class function CoAngleAxis.CreateRemote(const MachineName: string): IAngleAxis; |
| 871 |
begin |
| 872 |
Result := CreateRemoteComObject(UTF8Decode(MachineName), CLASS_AngleAxis) as IAngleAxis; |
| 873 |
end; |
| 874 |
|
| 875 |
procedure TAngleAxis.InitServerData; |
| 876 |
const |
| 877 |
CServerData: TServerData = ( |
| 878 |
ClassID: '{512A6C3E-3010-401B-8623-E413E2ACC138}'; |
| 879 |
IntfIID: '{1EF2BAFF-54E9-4706-9F61-078F7134FD35}'; |
| 880 |
EventIID: ''; |
| 881 |
LicenseKey: nil; |
| 882 |
Version: 500; |
| 883 |
InstanceCount: 0); |
| 884 |
begin |
| 885 |
ServerData := @CServerData; |
| 886 |
end; |
| 887 |
|
| 888 |
procedure TAngleAxis.Connect; |
| 889 |
var |
| 890 |
punk: IUnknown; |
| 891 |
begin |
| 892 |
if FIntf = nil then |
| 893 |
begin |
| 894 |
punk := GetServer; |
| 895 |
Fintf:= punk as IAngleAxis; |
| 896 |
end; |
| 897 |
end; |
| 898 |
|
| 899 |
procedure TAngleAxis.ConnectTo(svrIntf: IAngleAxis); |
| 900 |
begin |
| 901 |
Disconnect; |
| 902 |
FIntf := svrIntf; |
| 903 |
end; |
| 904 |
|
| 905 |
procedure TAngleAxis.DisConnect; |
| 906 |
begin |
| 907 |
if Fintf <> nil then |
| 908 |
begin |
| 909 |
FIntf := nil; |
| 910 |
end; |
| 911 |
end; |
| 912 |
|
| 913 |
function TAngleAxis.GetDefaultInterface: IAngleAxis; |
| 914 |
begin |
| 915 |
if FIntf = nil then |
| 916 |
Connect; |
| 917 |
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); |
| 918 |
Result := FIntf; |
| 919 |
end; |
| 920 |
|
| 921 |
constructor TAngleAxis.Create(AOwner: TComponent); |
| 922 |
begin |
| 923 |
inherited Create(AOwner); |
| 924 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 925 |
FProps := TAngleAxisProperties.Create(Self); |
| 926 |
{$ENDIF} |
| 927 |
end; |
| 928 |
|
| 929 |
destructor TAngleAxis.Destroy; |
| 930 |
begin |
| 931 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 932 |
FProps.Free; |
| 933 |
{$ENDIF} |
| 934 |
inherited Destroy; |
| 935 |
end; |
| 936 |
|
| 937 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 938 |
function TAngleAxis.GetServerProperties: TAngleAxisProperties; |
| 939 |
begin |
| 940 |
Result := FProps; |
| 941 |
end; |
| 942 |
{$ENDIF} |
| 943 |
|
| 944 |
function TAngleAxis.Get_X: Double; |
| 945 |
begin |
| 946 |
Result := DefaultInterface.X; |
| 947 |
end; |
| 948 |
|
| 949 |
procedure TAngleAxis.Set_X(pVal: Double); |
| 950 |
begin |
| 951 |
DefaultInterface.Set_X(pVal); |
| 952 |
end; |
| 953 |
|
| 954 |
function TAngleAxis.Get_Y: Double; |
| 955 |
begin |
| 956 |
Result := DefaultInterface.Y; |
| 957 |
end; |
| 958 |
|
| 959 |
procedure TAngleAxis.Set_Y(pVal: Double); |
| 960 |
begin |
| 961 |
DefaultInterface.Set_Y(pVal); |
| 962 |
end; |
| 963 |
|
| 964 |
function TAngleAxis.Get_Z: Double; |
| 965 |
begin |
| 966 |
Result := DefaultInterface.Z; |
| 967 |
end; |
| 968 |
|
| 969 |
procedure TAngleAxis.Set_Z(pVal: Double); |
| 970 |
begin |
| 971 |
DefaultInterface.Set_Z(pVal); |
| 972 |
end; |
| 973 |
|
| 974 |
function TAngleAxis.Get_Angle: Double; |
| 975 |
begin |
| 976 |
Result := DefaultInterface.Angle; |
| 977 |
end; |
| 978 |
|
| 979 |
procedure TAngleAxis.Set_Angle(pVal: Double); |
| 980 |
begin |
| 981 |
DefaultInterface.Set_Angle(pVal); |
| 982 |
end; |
| 983 |
|
| 984 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 985 |
constructor TAngleAxisProperties.Create(AServer: TAngleAxis); |
| 986 |
begin |
| 987 |
inherited Create; |
| 988 |
FServer := AServer; |
| 989 |
end; |
| 990 |
|
| 991 |
function TAngleAxisProperties.GetDefaultInterface: IAngleAxis; |
| 992 |
begin |
| 993 |
Result := FServer.DefaultInterface; |
| 994 |
end; |
| 995 |
|
| 996 |
function TAngleAxisProperties.Get_X: Double; |
| 997 |
begin |
| 998 |
Result := DefaultInterface.X; |
| 999 |
end; |
| 1000 |
|
| 1001 |
procedure TAngleAxisProperties.Set_X(pVal: Double); |
| 1002 |
begin |
| 1003 |
DefaultInterface.Set_X(pVal); |
| 1004 |
end; |
| 1005 |
|
| 1006 |
function TAngleAxisProperties.Get_Y: Double; |
| 1007 |
begin |
| 1008 |
Result := DefaultInterface.Y; |
| 1009 |
end; |
| 1010 |
|
| 1011 |
procedure TAngleAxisProperties.Set_Y(pVal: Double); |
| 1012 |
begin |
| 1013 |
DefaultInterface.Set_Y(pVal); |
| 1014 |
end; |
| 1015 |
|
| 1016 |
function TAngleAxisProperties.Get_Z: Double; |
| 1017 |
begin |
| 1018 |
Result := DefaultInterface.Z; |
| 1019 |
end; |
| 1020 |
|
| 1021 |
procedure TAngleAxisProperties.Set_Z(pVal: Double); |
| 1022 |
begin |
| 1023 |
DefaultInterface.Set_Z(pVal); |
| 1024 |
end; |
| 1025 |
|
| 1026 |
function TAngleAxisProperties.Get_Angle: Double; |
| 1027 |
begin |
| 1028 |
Result := DefaultInterface.Angle; |
| 1029 |
end; |
| 1030 |
|
| 1031 |
procedure TAngleAxisProperties.Set_Angle(pVal: Double); |
| 1032 |
begin |
| 1033 |
DefaultInterface.Set_Angle(pVal); |
| 1034 |
end; |
| 1035 |
|
| 1036 |
{$ENDIF} |
| 1037 |
|
| 1038 |
class function CoVector3D.Create: IVector3D; |
| 1039 |
begin |
| 1040 |
Result := CreateComObject(CLASS_Vector3D) as IVector3D; |
| 1041 |
end; |
| 1042 |
|
| 1043 |
class function CoVector3D.CreateRemote(const MachineName: string): IVector3D; |
| 1044 |
begin |
| 1045 |
Result := CreateRemoteComObject(UTF8Decode(MachineName), CLASS_Vector3D) as IVector3D; |
| 1046 |
end; |
| 1047 |
|
| 1048 |
procedure TVector3D.InitServerData; |
| 1049 |
const |
| 1050 |
CServerData: TServerData = ( |
| 1051 |
ClassID: '{740A7479-C7C1-44DA-8A84-B5DE63C78B32}'; |
| 1052 |
IntfIID: '{8C2AA71D-2B23-43F5-A6ED-4DF57E9CD8D5}'; |
| 1053 |
EventIID: ''; |
| 1054 |
LicenseKey: nil; |
| 1055 |
Version: 500; |
| 1056 |
InstanceCount: 0); |
| 1057 |
begin |
| 1058 |
ServerData := @CServerData; |
| 1059 |
end; |
| 1060 |
|
| 1061 |
procedure TVector3D.Connect; |
| 1062 |
var |
| 1063 |
punk: IUnknown; |
| 1064 |
begin |
| 1065 |
if FIntf = nil then |
| 1066 |
begin |
| 1067 |
punk := GetServer; |
| 1068 |
Fintf:= punk as IVector3D; |
| 1069 |
end; |
| 1070 |
end; |
| 1071 |
|
| 1072 |
procedure TVector3D.ConnectTo(svrIntf: IVector3D); |
| 1073 |
begin |
| 1074 |
Disconnect; |
| 1075 |
FIntf := svrIntf; |
| 1076 |
end; |
| 1077 |
|
| 1078 |
procedure TVector3D.DisConnect; |
| 1079 |
begin |
| 1080 |
if Fintf <> nil then |
| 1081 |
begin |
| 1082 |
FIntf := nil; |
| 1083 |
end; |
| 1084 |
end; |
| 1085 |
|
| 1086 |
function TVector3D.GetDefaultInterface: IVector3D; |
| 1087 |
begin |
| 1088 |
if FIntf = nil then |
| 1089 |
Connect; |
| 1090 |
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); |
| 1091 |
Result := FIntf; |
| 1092 |
end; |
| 1093 |
|
| 1094 |
constructor TVector3D.Create(AOwner: TComponent); |
| 1095 |
begin |
| 1096 |
inherited Create(AOwner); |
| 1097 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1098 |
FProps := TVector3DProperties.Create(Self); |
| 1099 |
{$ENDIF} |
| 1100 |
end; |
| 1101 |
|
| 1102 |
destructor TVector3D.Destroy; |
| 1103 |
begin |
| 1104 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1105 |
FProps.Free; |
| 1106 |
{$ENDIF} |
| 1107 |
inherited Destroy; |
| 1108 |
end; |
| 1109 |
|
| 1110 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1111 |
function TVector3D.GetServerProperties: TVector3DProperties; |
| 1112 |
begin |
| 1113 |
Result := FProps; |
| 1114 |
end; |
| 1115 |
{$ENDIF} |
| 1116 |
|
| 1117 |
function TVector3D.Get_X: Double; |
| 1118 |
begin |
| 1119 |
Result := DefaultInterface.X; |
| 1120 |
end; |
| 1121 |
|
| 1122 |
procedure TVector3D.Set_X(pVal: Double); |
| 1123 |
begin |
| 1124 |
DefaultInterface.Set_X(pVal); |
| 1125 |
end; |
| 1126 |
|
| 1127 |
function TVector3D.Get_Y: Double; |
| 1128 |
begin |
| 1129 |
Result := DefaultInterface.Y; |
| 1130 |
end; |
| 1131 |
|
| 1132 |
procedure TVector3D.Set_Y(pVal: Double); |
| 1133 |
begin |
| 1134 |
DefaultInterface.Set_Y(pVal); |
| 1135 |
end; |
| 1136 |
|
| 1137 |
function TVector3D.Get_Z: Double; |
| 1138 |
begin |
| 1139 |
Result := DefaultInterface.Z; |
| 1140 |
end; |
| 1141 |
|
| 1142 |
procedure TVector3D.Set_Z(pVal: Double); |
| 1143 |
begin |
| 1144 |
DefaultInterface.Set_Z(pVal); |
| 1145 |
end; |
| 1146 |
|
| 1147 |
function TVector3D.Get_Length: Double; |
| 1148 |
begin |
| 1149 |
Result := DefaultInterface.Length; |
| 1150 |
end; |
| 1151 |
|
| 1152 |
procedure TVector3D.Set_Length(pVal: Double); |
| 1153 |
begin |
| 1154 |
DefaultInterface.Set_Length(pVal); |
| 1155 |
end; |
| 1156 |
|
| 1157 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1158 |
constructor TVector3DProperties.Create(AServer: TVector3D); |
| 1159 |
begin |
| 1160 |
inherited Create; |
| 1161 |
FServer := AServer; |
| 1162 |
end; |
| 1163 |
|
| 1164 |
function TVector3DProperties.GetDefaultInterface: IVector3D; |
| 1165 |
begin |
| 1166 |
Result := FServer.DefaultInterface; |
| 1167 |
end; |
| 1168 |
|
| 1169 |
function TVector3DProperties.Get_X: Double; |
| 1170 |
begin |
| 1171 |
Result := DefaultInterface.X; |
| 1172 |
end; |
| 1173 |
|
| 1174 |
procedure TVector3DProperties.Set_X(pVal: Double); |
| 1175 |
begin |
| 1176 |
DefaultInterface.Set_X(pVal); |
| 1177 |
end; |
| 1178 |
|
| 1179 |
function TVector3DProperties.Get_Y: Double; |
| 1180 |
begin |
| 1181 |
Result := DefaultInterface.Y; |
| 1182 |
end; |
| 1183 |
|
| 1184 |
procedure TVector3DProperties.Set_Y(pVal: Double); |
| 1185 |
begin |
| 1186 |
DefaultInterface.Set_Y(pVal); |
| 1187 |
end; |
| 1188 |
|
| 1189 |
function TVector3DProperties.Get_Z: Double; |
| 1190 |
begin |
| 1191 |
Result := DefaultInterface.Z; |
| 1192 |
end; |
| 1193 |
|
| 1194 |
procedure TVector3DProperties.Set_Z(pVal: Double); |
| 1195 |
begin |
| 1196 |
DefaultInterface.Set_Z(pVal); |
| 1197 |
end; |
| 1198 |
|
| 1199 |
function TVector3DProperties.Get_Length: Double; |
| 1200 |
begin |
| 1201 |
Result := DefaultInterface.Length; |
| 1202 |
end; |
| 1203 |
|
| 1204 |
procedure TVector3DProperties.Set_Length(pVal: Double); |
| 1205 |
begin |
| 1206 |
DefaultInterface.Set_Length(pVal); |
| 1207 |
end; |
| 1208 |
|
| 1209 |
{$ENDIF} |
| 1210 |
|
| 1211 |
class function CoSensor.Create: ISensor; |
| 1212 |
begin |
| 1213 |
Result := CreateComObject(CLASS_Sensor) as ISensor; |
| 1214 |
end; |
| 1215 |
|
| 1216 |
class function CoSensor.CreateRemote(const MachineName: string): ISensor; |
| 1217 |
begin |
| 1218 |
Result := CreateRemoteComObject(UTF8Decode(MachineName), CLASS_Sensor) as ISensor; |
| 1219 |
end; |
| 1220 |
|
| 1221 |
procedure TSensor.InitServerData; |
| 1222 |
const |
| 1223 |
CServerData: TServerData = ( |
| 1224 |
ClassID: '{85004B00-1AA7-4777-B1CE-8427301B942D}'; |
| 1225 |
IntfIID: '{F3A6775E-6FA1-4829-BF32-5B045C29078F}'; |
| 1226 |
EventIID: '{E6929A4A-6F41-46C6-9252-A8CC53472CB1}'; |
| 1227 |
LicenseKey: nil; |
| 1228 |
Version: 500; |
| 1229 |
InstanceCount: 0); |
| 1230 |
begin |
| 1231 |
ServerData := @CServerData; |
| 1232 |
end; |
| 1233 |
|
| 1234 |
procedure TSensor.Connect; |
| 1235 |
var |
| 1236 |
punk: IUnknown; |
| 1237 |
begin |
| 1238 |
if FIntf = nil then |
| 1239 |
begin |
| 1240 |
punk := GetServer; |
| 1241 |
ConnectEvents(punk); |
| 1242 |
Fintf:= punk as ISensor; |
| 1243 |
end; |
| 1244 |
end; |
| 1245 |
|
| 1246 |
procedure TSensor.ConnectTo(svrIntf: ISensor); |
| 1247 |
begin |
| 1248 |
Disconnect; |
| 1249 |
FIntf := svrIntf; |
| 1250 |
ConnectEvents(FIntf); |
| 1251 |
end; |
| 1252 |
|
| 1253 |
procedure TSensor.DisConnect; |
| 1254 |
begin |
| 1255 |
if Fintf <> nil then |
| 1256 |
begin |
| 1257 |
DisconnectEvents(FIntf); |
| 1258 |
FIntf := nil; |
| 1259 |
end; |
| 1260 |
end; |
| 1261 |
|
| 1262 |
function TSensor.GetDefaultInterface: ISensor; |
| 1263 |
begin |
| 1264 |
if FIntf = nil then |
| 1265 |
Connect; |
| 1266 |
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); |
| 1267 |
Result := FIntf; |
| 1268 |
end; |
| 1269 |
|
| 1270 |
constructor TSensor.Create(AOwner: TComponent); |
| 1271 |
begin |
| 1272 |
inherited Create(AOwner); |
| 1273 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1274 |
FProps := TSensorProperties.Create(Self); |
| 1275 |
{$ENDIF} |
| 1276 |
end; |
| 1277 |
|
| 1278 |
destructor TSensor.Destroy; |
| 1279 |
begin |
| 1280 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1281 |
FProps.Free; |
| 1282 |
{$ENDIF} |
| 1283 |
inherited Destroy; |
| 1284 |
end; |
| 1285 |
|
| 1286 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1287 |
function TSensor.GetServerProperties: TSensorProperties; |
| 1288 |
begin |
| 1289 |
Result := FProps; |
| 1290 |
end; |
| 1291 |
{$ENDIF} |
| 1292 |
|
| 1293 |
procedure TSensor.InvokeEvent(DispID: TDispID; var Params: TVariantArray); |
| 1294 |
begin |
| 1295 |
case DispID of |
| 1296 |
-1: Exit; // DISPID_UNKNOWN |
| 1297 |
1: if Assigned(FOnSensorInput) then |
| 1298 |
FOnSensorInput(Self); |
| 1299 |
end; {case DispID} |
| 1300 |
end; |
| 1301 |
|
| 1302 |
function TSensor.Get_Translation: IVector3D; |
| 1303 |
begin |
| 1304 |
Result := DefaultInterface.Translation; |
| 1305 |
end; |
| 1306 |
|
| 1307 |
function TSensor.Get_Rotation: IAngleAxis; |
| 1308 |
begin |
| 1309 |
Result := DefaultInterface.Rotation; |
| 1310 |
end; |
| 1311 |
|
| 1312 |
function TSensor.Get_Device: IDispatch; |
| 1313 |
begin |
| 1314 |
Result := DefaultInterface.Device; |
| 1315 |
end; |
| 1316 |
|
| 1317 |
function TSensor.Get_Period: Double; |
| 1318 |
begin |
| 1319 |
Result := DefaultInterface.Period; |
| 1320 |
end; |
| 1321 |
|
| 1322 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1323 |
constructor TSensorProperties.Create(AServer: TSensor); |
| 1324 |
begin |
| 1325 |
inherited Create; |
| 1326 |
FServer := AServer; |
| 1327 |
end; |
| 1328 |
|
| 1329 |
function TSensorProperties.GetDefaultInterface: ISensor; |
| 1330 |
begin |
| 1331 |
Result := FServer.DefaultInterface; |
| 1332 |
end; |
| 1333 |
|
| 1334 |
function TSensorProperties.Get_Translation: IVector3D; |
| 1335 |
begin |
| 1336 |
Result := DefaultInterface.Translation; |
| 1337 |
end; |
| 1338 |
|
| 1339 |
function TSensorProperties.Get_Rotation: IAngleAxis; |
| 1340 |
begin |
| 1341 |
Result := DefaultInterface.Rotation; |
| 1342 |
end; |
| 1343 |
|
| 1344 |
function TSensorProperties.Get_Device: IDispatch; |
| 1345 |
begin |
| 1346 |
Result := DefaultInterface.Device; |
| 1347 |
end; |
| 1348 |
|
| 1349 |
function TSensorProperties.Get_Period: Double; |
| 1350 |
begin |
| 1351 |
Result := DefaultInterface.Period; |
| 1352 |
end; |
| 1353 |
|
| 1354 |
{$ENDIF} |
| 1355 |
|
| 1356 |
class function CoKeyboard.Create: IKeyboard; |
| 1357 |
begin |
| 1358 |
Result := CreateComObject(CLASS_Keyboard) as IKeyboard; |
| 1359 |
end; |
| 1360 |
|
| 1361 |
class function CoKeyboard.CreateRemote(const MachineName: string): IKeyboard; |
| 1362 |
begin |
| 1363 |
Result := CreateRemoteComObject(UTF8Decode(MachineName), CLASS_Keyboard) as IKeyboard; |
| 1364 |
end; |
| 1365 |
|
| 1366 |
procedure TKeyboard.InitServerData; |
| 1367 |
const |
| 1368 |
CServerData: TServerData = ( |
| 1369 |
ClassID: '{25BBE090-583A-4903-A61B-D0EC629AC4EC}'; |
| 1370 |
IntfIID: '{D6F968E7-2993-48D7-AF24-8B602D925B2C}'; |
| 1371 |
EventIID: '{6B6BB0A8-4491-40CF-B1A9-C15A801FE151}'; |
| 1372 |
LicenseKey: nil; |
| 1373 |
Version: 500; |
| 1374 |
InstanceCount: 0); |
| 1375 |
begin |
| 1376 |
ServerData := @CServerData; |
| 1377 |
end; |
| 1378 |
|
| 1379 |
procedure TKeyboard.Connect; |
| 1380 |
var |
| 1381 |
punk: IUnknown; |
| 1382 |
begin |
| 1383 |
if FIntf = nil then |
| 1384 |
begin |
| 1385 |
punk := GetServer; |
| 1386 |
ConnectEvents(punk); |
| 1387 |
Fintf:= punk as IKeyboard; |
| 1388 |
end; |
| 1389 |
end; |
| 1390 |
|
| 1391 |
procedure TKeyboard.ConnectTo(svrIntf: IKeyboard); |
| 1392 |
begin |
| 1393 |
Disconnect; |
| 1394 |
FIntf := svrIntf; |
| 1395 |
ConnectEvents(FIntf); |
| 1396 |
end; |
| 1397 |
|
| 1398 |
procedure TKeyboard.DisConnect; |
| 1399 |
begin |
| 1400 |
if Fintf <> nil then |
| 1401 |
begin |
| 1402 |
DisconnectEvents(FIntf); |
| 1403 |
FIntf := nil; |
| 1404 |
end; |
| 1405 |
end; |
| 1406 |
|
| 1407 |
function TKeyboard.GetDefaultInterface: IKeyboard; |
| 1408 |
begin |
| 1409 |
if FIntf = nil then |
| 1410 |
Connect; |
| 1411 |
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); |
| 1412 |
Result := FIntf; |
| 1413 |
end; |
| 1414 |
|
| 1415 |
constructor TKeyboard.Create(AOwner: TComponent); |
| 1416 |
begin |
| 1417 |
inherited Create(AOwner); |
| 1418 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1419 |
FProps := TKeyboardProperties.Create(Self); |
| 1420 |
{$ENDIF} |
| 1421 |
end; |
| 1422 |
|
| 1423 |
destructor TKeyboard.Destroy; |
| 1424 |
begin |
| 1425 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1426 |
FProps.Free; |
| 1427 |
{$ENDIF} |
| 1428 |
inherited Destroy; |
| 1429 |
end; |
| 1430 |
|
| 1431 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1432 |
function TKeyboard.GetServerProperties: TKeyboardProperties; |
| 1433 |
begin |
| 1434 |
Result := FProps; |
| 1435 |
end; |
| 1436 |
{$ENDIF} |
| 1437 |
|
| 1438 |
procedure TKeyboard.InvokeEvent(DispID: TDispID; var Params: TVariantArray); |
| 1439 |
begin |
| 1440 |
case DispID of |
| 1441 |
-1: Exit; // DISPID_UNKNOWN |
| 1442 |
1: if Assigned(FOnKeyDown) then |
| 1443 |
FOnKeyDown(Self, Params[0] {SYSINT}); |
| 1444 |
2: if Assigned(FOnKeyUp) then |
| 1445 |
FOnKeyUp(Self, Params[0] {SYSINT}); |
| 1446 |
end; {case DispID} |
| 1447 |
end; |
| 1448 |
|
| 1449 |
function TKeyboard.Get_Keys: Integer; |
| 1450 |
begin |
| 1451 |
Result := DefaultInterface.Keys; |
| 1452 |
end; |
| 1453 |
|
| 1454 |
function TKeyboard.Get_ProgrammableKeys: Integer; |
| 1455 |
begin |
| 1456 |
Result := DefaultInterface.ProgrammableKeys; |
| 1457 |
end; |
| 1458 |
|
| 1459 |
function TKeyboard.Get_Device: IDispatch; |
| 1460 |
begin |
| 1461 |
Result := DefaultInterface.Device; |
| 1462 |
end; |
| 1463 |
|
| 1464 |
function TKeyboard.GetKeyLabel(key: Integer): WideString; |
| 1465 |
begin |
| 1466 |
Result := DefaultInterface.GetKeyLabel(key); |
| 1467 |
end; |
| 1468 |
|
| 1469 |
function TKeyboard.GetKeyName(key: Integer): WideString; |
| 1470 |
begin |
| 1471 |
Result := DefaultInterface.GetKeyName(key); |
| 1472 |
end; |
| 1473 |
|
| 1474 |
function TKeyboard.IsKeyDown(key: Integer): WordBool; |
| 1475 |
begin |
| 1476 |
Result := DefaultInterface.IsKeyDown(key); |
| 1477 |
end; |
| 1478 |
|
| 1479 |
function TKeyboard.IsKeyUp(key: Integer): WordBool; |
| 1480 |
begin |
| 1481 |
Result := DefaultInterface.IsKeyUp(key); |
| 1482 |
end; |
| 1483 |
|
| 1484 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1485 |
constructor TKeyboardProperties.Create(AServer: TKeyboard); |
| 1486 |
begin |
| 1487 |
inherited Create; |
| 1488 |
FServer := AServer; |
| 1489 |
end; |
| 1490 |
|
| 1491 |
function TKeyboardProperties.GetDefaultInterface: IKeyboard; |
| 1492 |
begin |
| 1493 |
Result := FServer.DefaultInterface; |
| 1494 |
end; |
| 1495 |
|
| 1496 |
function TKeyboardProperties.Get_Keys: Integer; |
| 1497 |
begin |
| 1498 |
Result := DefaultInterface.Keys; |
| 1499 |
end; |
| 1500 |
|
| 1501 |
function TKeyboardProperties.Get_ProgrammableKeys: Integer; |
| 1502 |
begin |
| 1503 |
Result := DefaultInterface.ProgrammableKeys; |
| 1504 |
end; |
| 1505 |
|
| 1506 |
function TKeyboardProperties.Get_Device: IDispatch; |
| 1507 |
begin |
| 1508 |
Result := DefaultInterface.Device; |
| 1509 |
end; |
| 1510 |
|
| 1511 |
{$ENDIF} |
| 1512 |
|
| 1513 |
class function CoDevice.Create: ISimpleDevice; |
| 1514 |
begin |
| 1515 |
Result := CreateComObject(CLASS_Device) as ISimpleDevice; |
| 1516 |
end; |
| 1517 |
|
| 1518 |
class function CoDevice.CreateRemote(const MachineName: string): ISimpleDevice; |
| 1519 |
begin |
| 1520 |
Result := CreateRemoteComObject(UTF8Decode(MachineName), CLASS_Device) as ISimpleDevice; |
| 1521 |
end; |
| 1522 |
|
| 1523 |
procedure TDevice.InitServerData; |
| 1524 |
const |
| 1525 |
CServerData: TServerData = ( |
| 1526 |
ClassID: '{82C5AB54-C92C-4D52-AAC5-27E25E22604C}'; |
| 1527 |
IntfIID: '{CB3BF65E-0816-482A-BB11-64AF1E837812}'; |
| 1528 |
EventIID: '{8FE3A216-E235-49A6-9136-F9D81FDADEF5}'; |
| 1529 |
LicenseKey: nil; |
| 1530 |
Version: 500; |
| 1531 |
InstanceCount: 0); |
| 1532 |
begin |
| 1533 |
ServerData := @CServerData; |
| 1534 |
end; |
| 1535 |
|
| 1536 |
procedure TDevice.Connect; |
| 1537 |
var |
| 1538 |
punk: IUnknown; |
| 1539 |
begin |
| 1540 |
if FIntf = nil then |
| 1541 |
begin |
| 1542 |
punk := GetServer; |
| 1543 |
ConnectEvents(punk); |
| 1544 |
Fintf:= punk as ISimpleDevice; |
| 1545 |
end; |
| 1546 |
end; |
| 1547 |
|
| 1548 |
procedure TDevice.ConnectTo(svrIntf: ISimpleDevice); |
| 1549 |
begin |
| 1550 |
Disconnect; |
| 1551 |
FIntf := svrIntf; |
| 1552 |
ConnectEvents(FIntf); |
| 1553 |
end; |
| 1554 |
|
| 1555 |
procedure TDevice.DisConnect; |
| 1556 |
begin |
| 1557 |
if Fintf <> nil then |
| 1558 |
begin |
| 1559 |
DisconnectEvents(FIntf); |
| 1560 |
FIntf := nil; |
| 1561 |
end; |
| 1562 |
end; |
| 1563 |
|
| 1564 |
function TDevice.GetDefaultInterface: ISimpleDevice; |
| 1565 |
begin |
| 1566 |
if FIntf = nil then |
| 1567 |
Connect; |
| 1568 |
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); |
| 1569 |
Result := FIntf; |
| 1570 |
end; |
| 1571 |
|
| 1572 |
constructor TDevice.Create(AOwner: TComponent); |
| 1573 |
begin |
| 1574 |
inherited Create(AOwner); |
| 1575 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1576 |
FProps := TDeviceProperties.Create(Self); |
| 1577 |
{$ENDIF} |
| 1578 |
end; |
| 1579 |
|
| 1580 |
destructor TDevice.Destroy; |
| 1581 |
begin |
| 1582 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1583 |
FProps.Free; |
| 1584 |
{$ENDIF} |
| 1585 |
inherited Destroy; |
| 1586 |
end; |
| 1587 |
|
| 1588 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1589 |
function TDevice.GetServerProperties: TDeviceProperties; |
| 1590 |
begin |
| 1591 |
Result := FProps; |
| 1592 |
end; |
| 1593 |
{$ENDIF} |
| 1594 |
|
| 1595 |
procedure TDevice.InvokeEvent(DispID: TDispID; var Params: TVariantArray); |
| 1596 |
begin |
| 1597 |
case DispID of |
| 1598 |
-1: Exit; // DISPID_UNKNOWN |
| 1599 |
1: if Assigned(FOnDeviceChange) then |
| 1600 |
FOnDeviceChange(Self, Params[0] {Integer}); |
| 1601 |
end; {case DispID} |
| 1602 |
end; |
| 1603 |
|
| 1604 |
function TDevice.Get_Sensor: ISensor; |
| 1605 |
begin |
| 1606 |
Result := DefaultInterface.Sensor; |
| 1607 |
end; |
| 1608 |
|
| 1609 |
function TDevice.Get_Keyboard: IKeyboard; |
| 1610 |
begin |
| 1611 |
Result := DefaultInterface.Keyboard; |
| 1612 |
end; |
| 1613 |
|
| 1614 |
function TDevice.Get_type_: Integer; |
| 1615 |
begin |
| 1616 |
Result := DefaultInterface.type_; |
| 1617 |
end; |
| 1618 |
|
| 1619 |
function TDevice.Get_IsConnected: WordBool; |
| 1620 |
begin |
| 1621 |
Result := DefaultInterface.IsConnected; |
| 1622 |
end; |
| 1623 |
|
| 1624 |
procedure TDevice.Connect1; |
| 1625 |
begin |
| 1626 |
DefaultInterface.Connect; |
| 1627 |
end; |
| 1628 |
|
| 1629 |
procedure TDevice.Disconnect1; |
| 1630 |
begin |
| 1631 |
DefaultInterface.Disconnect; |
| 1632 |
end; |
| 1633 |
|
| 1634 |
procedure TDevice.LoadPreferences(const PreferencesName: WideString); |
| 1635 |
begin |
| 1636 |
DefaultInterface.LoadPreferences(PreferencesName); |
| 1637 |
end; |
| 1638 |
|
| 1639 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1640 |
constructor TDeviceProperties.Create(AServer: TDevice); |
| 1641 |
begin |
| 1642 |
inherited Create; |
| 1643 |
FServer := AServer; |
| 1644 |
end; |
| 1645 |
|
| 1646 |
function TDeviceProperties.GetDefaultInterface: ISimpleDevice; |
| 1647 |
begin |
| 1648 |
Result := FServer.DefaultInterface; |
| 1649 |
end; |
| 1650 |
|
| 1651 |
function TDeviceProperties.Get_Sensor: ISensor; |
| 1652 |
begin |
| 1653 |
Result := DefaultInterface.Sensor; |
| 1654 |
end; |
| 1655 |
|
| 1656 |
function TDeviceProperties.Get_Keyboard: IKeyboard; |
| 1657 |
begin |
| 1658 |
Result := DefaultInterface.Keyboard; |
| 1659 |
end; |
| 1660 |
|
| 1661 |
function TDeviceProperties.Get_type_: Integer; |
| 1662 |
begin |
| 1663 |
Result := DefaultInterface.type_; |
| 1664 |
end; |
| 1665 |
|
| 1666 |
function TDeviceProperties.Get_IsConnected: WordBool; |
| 1667 |
begin |
| 1668 |
Result := DefaultInterface.IsConnected; |
| 1669 |
end; |
| 1670 |
|
| 1671 |
{$ENDIF} |
| 1672 |
|
| 1673 |
class function CoTDxInfo.Create: ITDxInfo; |
| 1674 |
begin |
| 1675 |
Result := CreateComObject(CLASS_TDxInfo) as ITDxInfo; |
| 1676 |
end; |
| 1677 |
|
| 1678 |
class function CoTDxInfo.CreateRemote(const MachineName: string): ITDxInfo; |
| 1679 |
begin |
| 1680 |
Result := CreateRemoteComObject(UTF8Decode(MachineName), CLASS_TDxInfo) as ITDxInfo; |
| 1681 |
end; |
| 1682 |
|
| 1683 |
procedure TTDxInfo.InitServerData; |
| 1684 |
const |
| 1685 |
CServerData: TServerData = ( |
| 1686 |
ClassID: '{1A960ECE-0E57-4A68-B694-8373114F1FF4}'; |
| 1687 |
IntfIID: '{00612962-8FB6-47B2-BF98-4E8C0FF5F559}'; |
| 1688 |
EventIID: ''; |
| 1689 |
LicenseKey: nil; |
| 1690 |
Version: 500; |
| 1691 |
InstanceCount: 0); |
| 1692 |
begin |
| 1693 |
ServerData := @CServerData; |
| 1694 |
end; |
| 1695 |
|
| 1696 |
procedure TTDxInfo.Connect; |
| 1697 |
var |
| 1698 |
punk: IUnknown; |
| 1699 |
begin |
| 1700 |
if FIntf = nil then |
| 1701 |
begin |
| 1702 |
punk := GetServer; |
| 1703 |
Fintf:= punk as ITDxInfo; |
| 1704 |
end; |
| 1705 |
end; |
| 1706 |
|
| 1707 |
procedure TTDxInfo.ConnectTo(svrIntf: ITDxInfo); |
| 1708 |
begin |
| 1709 |
Disconnect; |
| 1710 |
FIntf := svrIntf; |
| 1711 |
end; |
| 1712 |
|
| 1713 |
procedure TTDxInfo.DisConnect; |
| 1714 |
begin |
| 1715 |
if Fintf <> nil then |
| 1716 |
begin |
| 1717 |
FIntf := nil; |
| 1718 |
end; |
| 1719 |
end; |
| 1720 |
|
| 1721 |
function TTDxInfo.GetDefaultInterface: ITDxInfo; |
| 1722 |
begin |
| 1723 |
if FIntf = nil then |
| 1724 |
Connect; |
| 1725 |
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); |
| 1726 |
Result := FIntf; |
| 1727 |
end; |
| 1728 |
|
| 1729 |
constructor TTDxInfo.Create(AOwner: TComponent); |
| 1730 |
begin |
| 1731 |
inherited Create(AOwner); |
| 1732 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1733 |
FProps := TTDxInfoProperties.Create(Self); |
| 1734 |
{$ENDIF} |
| 1735 |
end; |
| 1736 |
|
| 1737 |
destructor TTDxInfo.Destroy; |
| 1738 |
begin |
| 1739 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1740 |
FProps.Free; |
| 1741 |
{$ENDIF} |
| 1742 |
inherited Destroy; |
| 1743 |
end; |
| 1744 |
|
| 1745 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1746 |
function TTDxInfo.GetServerProperties: TTDxInfoProperties; |
| 1747 |
begin |
| 1748 |
Result := FProps; |
| 1749 |
end; |
| 1750 |
{$ENDIF} |
| 1751 |
|
| 1752 |
function TTDxInfo.RevisionNumber: WideString; |
| 1753 |
begin |
| 1754 |
Result := DefaultInterface.RevisionNumber; |
| 1755 |
end; |
| 1756 |
|
| 1757 |
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME} |
| 1758 |
constructor TTDxInfoProperties.Create(AServer: TTDxInfo); |
| 1759 |
begin |
| 1760 |
inherited Create; |
| 1761 |
FServer := AServer; |
| 1762 |
end; |
| 1763 |
|
| 1764 |
function TTDxInfoProperties.GetDefaultInterface: ITDxInfo; |
| 1765 |
begin |
| 1766 |
Result := FServer.DefaultInterface; |
| 1767 |
end; |
| 1768 |
|
| 1769 |
{$ENDIF} |
| 1770 |
|
| 1771 |
(* |
| 1772 |
procedure Register; |
| 1773 |
begin |
| 1774 |
RegisterComponents(dtlServerPage, [TAngleAxis, TVector3D, TSensor, TKeyboard, |
| 1775 |
TDevice, TTDxInfo]); |
| 1776 |
end; |
| 1777 |
*) |
| 1778 |
|
| 1779 |
end. |