IdRegisterCore.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. {
  17. Rev 1.1 2/8/2004 1:35:40 PM JPMugaas
  18. IdSocks is now in DotNET.
  19. Rev 1.0 2/3/2004 12:28:06 PM JPMugaas
  20. Kudzu wanted this renamed.
  21. Rev 1.27 2004.01.01 2:40:02 PM czhower
  22. Removed test ifdef
  23. Rev 1.26 1/1/2004 3:32:30 PM BGooijen
  24. Added icons for .Net
  25. Rev 1.25 2003.12.31 11:02:50 PM czhower
  26. New components now registered for .net.
  27. Rev 1.24 2003.12.25 6:55:20 PM czhower
  28. TCPServer
  29. Rev 1.23 11/22/2003 11:49:52 PM BGooijen
  30. Icons for DotNet
  31. Rev 1.22 17/11/2003 16:00:22 ANeillans
  32. Fix Delphi compile errors.
  33. Rev 1.21 11/8/2003 8:09:24 PM BGooijen
  34. fix, i mixed up some stuff
  35. Rev 1.20 11/8/2003 7:27:10 PM BGooijen
  36. DotNet
  37. Rev 1.19 2003.10.19 1:35:32 PM czhower
  38. Moved Borland define to .inc
  39. Rev 1.18 2003.10.18 11:32:42 PM czhower
  40. Changed throttler to intercept
  41. Rev 1.17 2003.10.17 6:18:50 PM czhower
  42. TIdInterceptSimLog
  43. Rev 1.16 2003.10.14 1:26:42 PM czhower
  44. Uupdates + Intercept support
  45. Rev 1.15 9/21/2003 01:10:40 AM JPMugaas
  46. Added IdThreadCOmponent to the registration in Core.
  47. Rev 1.14 2003.08.19 11:06:34 PM czhower
  48. Fixed names of scheduler units.
  49. Rev 1.13 8/19/2003 01:25:08 AM JPMugaas
  50. Unnecessary junk removed.
  51. Rev 1.12 8/15/2003 12:02:48 AM JPMugaas
  52. Incremented version number.
  53. Moved some units to new IndySuperCore package in D7.
  54. Made sure package titles are uniform in the IDE and in the .RES files.
  55. Rev 1.11 7/24/2003 03:22:00 AM JPMugaas
  56. Removed some old files.
  57. Rev 1.10 7/18/2003 4:33:12 PM SPerry
  58. Added TIdCmdTCPClient
  59. Rev 1.7 4/17/2003 05:02:26 PM JPMugaas
  60. Rev 1.6 4/11/2003 01:09:50 PM JPMugaas
  61. Rev 1.5 3/25/2003 11:12:54 PM BGooijen
  62. TIdChainEngineStack added.
  63. Rev 1.4 3/25/2003 05:02:00 PM JPMugaas
  64. TCmdTCPServer added.
  65. Rev 1.3 3/22/2003 10:14:54 PM BGooijen
  66. Added TIdServerIOHandlerChain to the palette
  67. Rev 1.2 3/22/2003 02:20:48 PM JPMugaas
  68. Updated registration.
  69. Rev 1.1 1/17/2003 04:18:44 PM JPMugaas
  70. Now compiles with new packages.
  71. Rev 1.0 11/13/2002 08:41:42 AM JPMugaas
  72. }
  73. unit IdRegisterCore;
  74. interface
  75. // Procedures
  76. procedure Register;
  77. implementation
  78. {$I IdCompilerDefines.inc}
  79. uses
  80. Classes,
  81. {$IFDEF FMX}
  82. Controls,
  83. {$ENDIF}
  84. {$IFDEF FPC}
  85. LResources,
  86. {$ENDIF}
  87. IdSocks,
  88. {$IFDEF HAS_TSelectionEditor}
  89. {$IFDEF FPC}
  90. PropEdits,
  91. ComponentEditors,
  92. {$ELSE}
  93. DesignIntf,
  94. DesignEditors,
  95. {$ENDIF}
  96. TypInfo,
  97. {$IFDEF VCL_2010_OR_ABOVE}
  98. Rtti,
  99. {$ENDIF}
  100. SysUtils,
  101. IdGlobal,
  102. {$ENDIF}
  103. {$IFDEF HAS_TSelectionEditor}
  104. IdBaseComponent,
  105. {$ENDIF}
  106. IdComponent,
  107. IdDsnCoreResourceStrings,
  108. IdAntiFreeze,
  109. IdCmdTCPClient,
  110. IdCmdTCPServer,
  111. IdIOHandlerStream,
  112. {$IFNDEF DOTNET}
  113. IdIcmpClient,
  114. {$ENDIF}
  115. IdInterceptSimLog,
  116. IdInterceptThrottler,
  117. IdIPMCastClient,
  118. IdIPMCastServer,
  119. IdLogDebug,
  120. IdLogEvent,
  121. IdLogFile,
  122. IdLogStream,
  123. IdSchedulerOfThreadDefault,
  124. IdSchedulerOfThreadPool,
  125. IdServerIOHandlerStack,
  126. IdSimpleServer,
  127. IdThreadComponent,
  128. {$IFNDEF DOTNET}
  129. IdTraceRoute,
  130. {$ENDIF}
  131. IdUDPClient,
  132. IdUDPServer,
  133. IdIOHandlerStack,
  134. IdIntercept,
  135. IdTCPServer,
  136. IdTCPClient;
  137. {$IFDEF DOTNET}
  138. {$R IconsDotNet\TIdAntiFreeze.bmp}
  139. {$R IconsDotNet\TIdCmdTCPClient.bmp}
  140. {$R IconsDotNet\TIdCmdTCPServer.bmp}
  141. {$R IconsDotNet\TIdConnectionIntercept.bmp}
  142. {$R IconsDotNet\TIdICMPClient.bmp}
  143. {$R IconsDotNet\TIdInterceptSimLog.bmp}
  144. {$R IconsDotNet\TIdInterceptThrottler.bmp}
  145. {$R IconsDotNet\TIdIOHandlerStack.bmp}
  146. {$R IconsDotNet\TIdIOHandlerStream.bmp}
  147. {$R IconsDotNet\TIdLogDebug.bmp}
  148. {$R IconsDotNet\TIdLogEvent.bmp}
  149. {$R IconsDotNet\TIdLogFile.bmp}
  150. {$R IconsDotNet\TIdLogStream.bmp}
  151. {$R IconsDotNet\TIdSchedulerOfThreadDefault.bmp}
  152. {$R IconsDotNet\TIdSchedulerOfThreadPool.bmp}
  153. {$R IconsDotNet\TIdServerIOHandlerStack.bmp}
  154. {$R IconsDotNet\TIdSimpleServer.bmp}
  155. {$R IconsDotNet\TIdTCPClient.bmp}
  156. {$R IconsDotNet\TIdTCPServer.bmp}
  157. {$R IconsDotNet\TIdThreadComponent.bmp}
  158. {$R IconsDotNet\TIdUDPClient.bmp}
  159. {$R IconsDotNet\TIdUDPServer.bmp}
  160. {$R IconsDotNet\TIdIPMCastClient.bmp}
  161. {$R IconsDotNet\TIdIPMCastServer.bmp}
  162. {$R IconsDotNet\TIdSocksInfo.bmp}
  163. {$ELSE}
  164. {$IFNDEF FPC}
  165. {$IFDEF BORLAND}
  166. {$R IdCoreRegister.dcr}
  167. {$ELSE}
  168. {$R IdCoreRegisterCool.dcr}
  169. {$ENDIF}
  170. {$ENDIF}
  171. {$ENDIF}
  172. {$IFDEF HAS_TSelectionEditor}
  173. // TIdComponentSelectionEditor is called at design-time when saving/compiling a
  174. // project. It enumerates the data types of all parameters and return values of
  175. // every event handler assigned to any Indy component, extracting the unit names
  176. // of those data types and passing them to the IDE so it can insert them into
  177. // 'uses' clauses as needed.
  178. procedure SendUnitNameToProc(const AUnitName: String; Proc: TGetStrProc);
  179. begin
  180. // Do not return the 'System' unit, otherwise it will
  181. // cause an "Identifier redeclared" compiler error!
  182. if (AUnitName <> '') and (not TextIsSame(AUnitName, 'System')) then begin {do not localize}
  183. Proc(AUnitName);
  184. end;
  185. end;
  186. {$IFDEF VCL_XE2_OR_ABOVE}
  187. // in Delphi XE2 and later, TRttiInvokableType is used to enumerate parameters
  188. // and return values, and TRttiType reports fully qualified type names, so
  189. // finding a given type's unit name is very easy...
  190. function GetUnitNameForType(const AType: TRttiType): String;
  191. begin
  192. // TRttiParameter.ParamType may be nil if it's an untyped var or const parameter...
  193. // TRttiMethodType.ReturnType may be nil if it's a procedure...
  194. if AType <> nil then begin
  195. // TRttiType.UnitName returns the unit that declares TRttiType itself
  196. // (System.Rtti), so parse the TRttiType.QualifiedName value instead...
  197. Result := AType.QualifiedName;
  198. SetLength(Result, Length(Result) - Length(AType.Name) - 1);
  199. end else begin
  200. Result := '';
  201. end;
  202. end;
  203. {$ELSE}
  204. // in Delphi prior to XE2, as well as in FreePascal, TRttiInvokableType is not
  205. // available, so we have to use TypInfo RTTI to enumerating parameters and
  206. // return values, but only certain versions implement rich enough RTTI to allow
  207. // that. Let's try to pull out what we can...
  208. {$IFDEF FPC_2_6_0_OR_ABOVE}
  209. {$DEFINE HAS_tkEnumeration_UnitName}
  210. {$DEFINE HAS_tkMethod_ParamTypeInfo}
  211. {$ELSE}
  212. {$IFDEF VCL_6_OR_ABOVE}
  213. {$DEFINE HAS_tkEnumeration_UnitName}
  214. {$ENDIF}
  215. {$IFDEF VCL_2010_OR_ABOVE}
  216. {$DEFINE HAS_tkMethod_ParamTypeInfo}
  217. {$ENDIF}
  218. {$ENDIF}
  219. procedure SkipShortString(var P: PByte);
  220. begin
  221. Inc(P, 1 + Integer(P^));
  222. end;
  223. function ReadShortString(var P: PByte): String;
  224. begin
  225. {$IFDEF VCL_2009_OR_ABOVE}
  226. Result := UTF8ToString(PShortString(P)^);
  227. {$ELSE}
  228. Result := PShortString(P)^;
  229. {$ENDIF}
  230. SkipShortString(P);
  231. end;
  232. {$IFDEF FPC_2_6_0_OR_ABOVE}
  233. function NextShortString(PS: PShortString): PShortString;
  234. begin
  235. Result := PShortString(Pointer(PS)+PByte(PS)^+1);
  236. end;
  237. {$ENDIF}
  238. function GetUnitNameFromTypeName(const ATypeName: String): String;
  239. var
  240. K: Integer;
  241. begin
  242. // check if the type is qualified
  243. K := LastDelimiter('.', ATypeName);
  244. if K <> 0 then begin
  245. Result := Copy(ATypeName, 1, K-1);
  246. end else begin
  247. // TODO: enumerate package units and find the typename...
  248. Result := '';
  249. end;
  250. end;
  251. function GetUnitNameFromTypeInfo(const ATypeInfo: PPTypeInfo): String;
  252. var
  253. LTypeData: PTypeData;
  254. {$IFDEF HAS_tkEnumeration_UnitName}
  255. {$IFDEF FPC}
  256. PS, PSLast: PShortString;
  257. {$ELSE}
  258. LBaseTypeData: PTypeData;
  259. Value: Integer;
  260. P: PByte;
  261. {$ENDIF}
  262. {$ENDIF}
  263. begin
  264. Result := '';
  265. if ATypeInfo = nil then begin
  266. Exit;
  267. end;
  268. if ATypeInfo^ = nil then begin
  269. Exit;
  270. end;
  271. LTypeData := GetTypeData(ATypeInfo^);
  272. case ATypeInfo^.Kind of
  273. {$IFDEF HAS_tkEnumeration_UnitName}
  274. tkEnumeration: begin
  275. {$IFDEF FPC}
  276. // the unit name is the last string in the name list
  277. PS := @(LTypeData^.NameList);
  278. PSLast := nil;
  279. while PByte(PS)^ <> 0 do begin
  280. PSLast := PS;
  281. PS := NextShortString(PS);
  282. end;
  283. if PSLast <> nil then begin
  284. Result := PSLast^;
  285. end;
  286. {$ELSE}
  287. // the unit name follows after the name list
  288. LBaseTypeData := GetTypeData(LTypeData^.BaseType^);
  289. P := PByte(@(LBaseTypeData^.NameList));
  290. // LongBool/WordBool/ByteBool have MinValue < 0 and arbitrary
  291. // content in Value; Boolean has Value in [0, 1] }
  292. if (ATypeInfo^ = System.TypeInfo(Boolean)) or (LBaseTypeData^.MinValue < 0) then
  293. begin
  294. for Value := 0 to 1 do begin
  295. SkipShortString(P);
  296. end;
  297. end else
  298. begin
  299. for Value := LBaseTypeData^.MinValue to LBaseTypeData^.MaxValue do begin
  300. SkipShortString(P);
  301. end;
  302. end;
  303. Result := ReadShortString(P);
  304. {$ENDIF}
  305. end;
  306. {$ENDIF}
  307. tkSet: begin
  308. Result := GetUnitNameFromTypeInfo(LTypeData^.CompType);
  309. end;
  310. {$IFDEF VCL_5_OR_ABOVE}
  311. tkClass: begin
  312. {$IFDEF VCL_2009_OR_ABOVE}
  313. Result := UTF8ToString(LTypeData^.UnitName);
  314. {$ELSE}
  315. Result := LTypeData^.UnitName;
  316. {$ENDIF}
  317. end;
  318. {$ENDIF}
  319. {$IFDEF FPC_2_6_0_OR_ABOVE}
  320. tkHelper: begin
  321. Result := LTypeData^.HelperUnit;
  322. end;
  323. {$ENDIF}
  324. {$IFDEF VCL_5_OR_ABOVE}
  325. tkInterface: begin
  326. {$IFDEF VCL_2009_OR_ABOVE}
  327. Result := UTF8ToString(LTypeData^.IntfUnit);
  328. {$ELSE}
  329. Result := LTypeData^.IntfUnit;
  330. {$ENDIF}
  331. end;
  332. {$ENDIF}
  333. {$IFDEF FPC_2_2_2_OR_ABOVE} // TODO: when was tkInterfaceRaw added?
  334. tkInterfaceRaw: begin
  335. Result := LTypeData^.RawIntfUnit;
  336. end;
  337. {$ENDIF}
  338. {$IFDEF VCL_6_OR_ABOVE}
  339. tkDynArray: begin
  340. {$IFDEF VCL_2009_OR_ABOVE}
  341. Result := UTF8ToString(LTypeData^.DynUnitName);
  342. {$ELSE}
  343. Result := LTypeData^.DynUnitName;
  344. {$ENDIF}
  345. if Result = '' then begin
  346. Result := GetUnitNameFromTypeInfo(LTypeData^.elType2);
  347. end;
  348. end;
  349. {$ENDIF}
  350. end;
  351. end;
  352. procedure GetUnitNamesForMethodType(const ATypeInfo: PTypeInfo; Proc: TGetStrProc);
  353. type
  354. PPPTypeInfo = ^PPTypeInfo;
  355. var
  356. LTypeData: PTypeData;
  357. LTypeDataPtr: PByte;
  358. K: Integer;
  359. UnitName: string;
  360. begin
  361. if ATypeInfo = nil then begin
  362. Exit;
  363. end;
  364. LTypeData := GetTypeData(ATypeInfo);
  365. LTypeDataPtr := PByte(@(LTypeData^.ParamList));
  366. if LTypeData^.ParamCount > 0 then
  367. begin
  368. for K := 0 to LTypeData^.ParamCount-1 do
  369. begin
  370. Inc(LTypeDataPtr, SizeOf(TParamFlags));
  371. SkipShortString(LTypeDataPtr);
  372. {$IFDEF HAS_tkMethod_ParamTypeInfo}
  373. // handled further below...
  374. SkipShortString(LTypeDataPtr);
  375. {$ELSE}
  376. UnitName := GetUnitNameFromTypeName(ReadShortString(LTypeDataPtr));
  377. SendUnitNameToProc(UnitName, Proc);
  378. {$ENDIF}
  379. end;
  380. end;
  381. if LTypeData^.MethodKind = mkFunction then
  382. begin
  383. {$IFDEF HAS_tkMethod_ParamTypeInfo}
  384. SkipShortString(LTypeDataPtr);
  385. UnitName := GetUnitNameFromTypeInfo(PPPTypeInfo(LTypeDataPtr)^);
  386. Inc(LTypeDataPtr, SizeOf(PPTypeInfo));
  387. {$ELSE}
  388. UnitName := GetUnitNameFromTypeName(ReadShortString(LTypeDataPtr));
  389. {$ENDIF}
  390. SendUnitNameToProc(UnitName, Proc);
  391. end;
  392. {$IFDEF HAS_tkMethod_ParamTypeInfo}
  393. if LTypeData^.ParamCount > 0 then
  394. begin
  395. Inc(LTypeDataPtr, SizeOf(TCallConv));
  396. for K := 0 to LTypeData^.ParamCount-1 do
  397. begin
  398. UnitName := GetUnitNameFromTypeInfo(PPPTypeInfo(LTypeDataPtr)^);
  399. SendUnitNameToProc(UnitName, Proc);
  400. Inc(LTypeDataPtr, SizeOf(PPTypeInfo));
  401. end;
  402. end;
  403. {$ENDIF}
  404. end;
  405. {$ENDIF}
  406. type
  407. TIdBaseComponentSelectionEditor = class(TSelectionEditor)
  408. public
  409. procedure RequiresUnits(Proc: TGetStrProc); override;
  410. end;
  411. procedure TIdBaseComponentSelectionEditor.RequiresUnits(Proc: TGetStrProc);
  412. var
  413. Comp: TIdBaseComponent;
  414. I: Integer;
  415. {$IFDEF VCL_2010_OR_ABOVE}
  416. Ctx: TRttiContext;
  417. RetreivedCtx: Boolean;
  418. PropInfo: TRttiProperty;
  419. PropValue: TValue;
  420. {$IFDEF VCL_XE2_OR_ABOVE}
  421. PropType: TRttiMethodType;
  422. Param: TRttiParameter;
  423. {$ENDIF}
  424. {$ELSE}
  425. PropList: PPropList;
  426. PropCount: Integer;
  427. PropInfo: PPropInfo;
  428. J: Integer;
  429. {$ENDIF}
  430. begin
  431. inherited RequiresUnits(Proc);
  432. if (Designer = nil) or (Designer.Root = nil) then Exit;
  433. {$IFDEF VCL_2010_OR_ABOVE}
  434. RetreivedCtx := False;
  435. {$ENDIF}
  436. for I := 0 to Designer.Root.ComponentCount - 1 do
  437. begin
  438. if Designer.Root.Components[i] is TIdBaseComponent then
  439. begin
  440. Comp := TIdBaseComponent(Designer.Root.Components[i]);
  441. {$IFDEF VCL_2010_OR_ABOVE}
  442. if not RetreivedCtx then
  443. begin
  444. Ctx := TRttiContext.Create;
  445. RetreivedCtx := True;
  446. end;
  447. for PropInfo in Ctx.GetType(Comp.ClassType).GetProperties do
  448. begin
  449. // only interested in *assigned* event handlers
  450. // NOTE: Delphi 2010 has a problem with checking the TValue.IsEmpty
  451. // property inlined like below. It causes a "F2084 Internal Error C13394"
  452. // compiler error. So splitting up the comparison to use a local TValue
  453. // variable to work around that...
  454. {
  455. if (PropInfo.PropertyType.TypeKind = tkMethod) and
  456. (not PropInfo.GetValue(Comp).IsEmpty) then
  457. }
  458. if PropInfo.PropertyType.TypeKind = tkMethod then
  459. begin
  460. PropValue := PropInfo.GetValue(Comp);
  461. if not PropValue.IsEmpty then
  462. begin
  463. // although the System.Rtti unit was introduced in Delphi 2010,
  464. // the TRttiInvokableType class was not added to it until XE2
  465. {$IFDEF VCL_XE2_OR_ABOVE}
  466. PropType := PropInfo.PropertyType as TRttiMethodType;
  467. for Param in PropType.GetParameters do begin
  468. SendUnitNameToProc(GetUnitNameForType(Param.ParamType), Proc);
  469. end;
  470. SendUnitNameToProc(GetUnitNameForType(PropType.ReturnType), Proc);
  471. {$ELSE}
  472. // use the System.TypInfo unit to access the parameters and return type
  473. GetUnitNamesForMethodType(PropInfo.PropertyType.Handle, Proc);
  474. {$ENDIF}
  475. end;
  476. end;
  477. end;
  478. {$ELSE}
  479. PropCount := GetPropList(Comp, PropList);
  480. if PropCount > 0 then
  481. begin
  482. try
  483. for J := 0 to PropCount-1 do
  484. begin
  485. PropInfo := PropList^[J];
  486. // only interested in *assigned* event handlers
  487. if (PropInfo^.PropType^.Kind = tkMethod) and
  488. (GetMethodProp(Comp, PropInfo).Code <> nil) then
  489. begin
  490. GetUnitNamesForMethodType(PropInfo^.PropType^, Proc);
  491. end;
  492. end;
  493. finally
  494. FreeMem(PropList);
  495. end;
  496. end;
  497. {$ENDIF}
  498. end;
  499. end;
  500. end;
  501. {$ENDIF}
  502. procedure Register;
  503. begin
  504. {$IFNDEF FPC}
  505. RegisterComponents(RSRegIndyClients, [
  506. TIdTCPClient
  507. ,TIdUDPClient
  508. ,TIdCmdTCPClient
  509. ,TIdIPMCastClient
  510. {$IFNDEF DOTNET}
  511. ,TIdIcmpClient
  512. ,TIdTraceRoute
  513. {$ENDIF}
  514. ]);
  515. RegisterComponents(RSRegIndyServers, [
  516. TIdUDPServer,
  517. TIdCmdTCPServer,
  518. TIdSimpleServer,
  519. TIdTCPServer,
  520. TIdIPMCastServer
  521. ]);
  522. RegisterComponents(RSRegIndyIOHandlers,[
  523. TIdIOHandlerStack
  524. ,TIdIOHandlerStream
  525. ,TIdServerIOHandlerStack
  526. ]);
  527. RegisterComponents(RSRegIndyIntercepts, [
  528. TIdConnectionIntercept
  529. ,TIdInterceptSimLog
  530. ,TIdInterceptThrottler
  531. ,TIdLogDebug
  532. ,TIdLogEvent
  533. ,TIdLogFile
  534. ,TIdLogStream
  535. ]);
  536. {$IFDEF FMX}
  537. // RLebeau 8/1/2011 - FireMonkey has problems resolving references to
  538. // TIdAntiFreeze correctly because it is implemented in a design-time
  539. // package and not a run-time package. Until we can fix that properly,
  540. // we'll group TIdAntiFreeze with TControl so the IDE can filter out
  541. // TIdAntiFreeze from appearing at design-time in FireMoney projects.
  542. // Users will have to instantiate TIdAntiFreeze in code. This does not
  543. // affect VCL projects.
  544. GroupDescendentsWith(TIdAntiFreeze, TControl);
  545. {$ENDIF}
  546. RegisterComponents(RSRegIndyMisc, [
  547. TIdSocksInfo,
  548. TIdAntiFreeze,
  549. TIdSchedulerOfThreadDefault,
  550. TIdSchedulerOfThreadPool,
  551. TIdThreadComponent
  552. ]);
  553. {$ELSE}
  554. //This is a tempoary workaround for components not fitting on the palette
  555. //in Lazarus. Unlike Delphi, Lazarus still does not have the ability to
  556. //scroll through a palette page.
  557. RegisterComponents(RSRegIndyClients+CoreSuffix, [
  558. TIdTCPClient
  559. ,TIdUDPClient
  560. ,TIdCmdTCPClient
  561. ,TIdIPMCastClient
  562. {$IFNDEF DOTNET}
  563. ,TIdIcmpClient
  564. ,TIdTraceRoute
  565. {$ENDIF}
  566. ]);
  567. RegisterComponents(RSRegIndyServers+CoreSuffix, [
  568. TIdUDPServer,
  569. TIdCmdTCPServer,
  570. TIdSimpleServer,
  571. TIdTCPServer,
  572. TIdIPMCastServer
  573. ]);
  574. RegisterComponents(RSRegIndyIOHandlers+CoreSuffix,[
  575. TIdIOHandlerStack
  576. ,TIdIOHandlerStream
  577. ,TIdServerIOHandlerStack
  578. ]);
  579. RegisterComponents(RSRegIndyIntercepts+CoreSuffix, [
  580. TIdConnectionIntercept
  581. ,TIdInterceptSimLog
  582. ,TIdInterceptThrottler
  583. ,TIdLogDebug
  584. ,TIdLogEvent
  585. ,TIdLogFile
  586. ,TIdLogStream
  587. ]);
  588. RegisterComponents(RSRegIndyMisc+CoreSuffix, [
  589. TIdSocksInfo,
  590. TIdAntiFreeze,
  591. TIdSchedulerOfThreadDefault,
  592. TIdSchedulerOfThreadPool,
  593. TIdThreadComponent
  594. ]);
  595. {$ENDIF}
  596. {$IFDEF HAS_TSelectionEditor}
  597. RegisterSelectionEditor(TIdBaseComponent, TIdBaseComponentSelectionEditor);
  598. {$ENDIF}
  599. end;
  600. {$IFDEF FPC}
  601. initialization
  602. {$i IdRegisterCore.lrs}
  603. {$ENDIF}
  604. end.