IdRegisterCore.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  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. IdBaseComponent,
  104. IdComponent,
  105. IdDsnCoreResourceStrings,
  106. IdAntiFreeze,
  107. IdCmdTCPClient,
  108. IdCmdTCPServer,
  109. IdIOHandlerStream,
  110. {$IFNDEF DOTNET}
  111. IdIcmpClient,
  112. {$ENDIF}
  113. IdInterceptSimLog,
  114. IdInterceptThrottler,
  115. IdIPMCastClient,
  116. IdIPMCastServer,
  117. IdLogDebug,
  118. IdLogEvent,
  119. IdLogFile,
  120. IdLogStream,
  121. IdSchedulerOfThread,
  122. IdSchedulerOfThreadDefault,
  123. IdSchedulerOfThreadPool,
  124. IdServerIOHandlerSocket,
  125. IdServerIOHandlerStack,
  126. IdSimpleServer,
  127. IdThreadComponent,
  128. {$IFNDEF DOTNET}
  129. IdTraceRoute,
  130. {$ENDIF}
  131. IdUDPClient,
  132. IdUDPServer,
  133. IdIOHandlerSocket,
  134. IdIOHandlerStack,
  135. IdIntercept,
  136. IdTCPServer,
  137. IdTCPClient;
  138. {$IFDEF DOTNET}
  139. {$R IconsDotNet\TIdAntiFreeze.bmp}
  140. {$R IconsDotNet\TIdCmdTCPClient.bmp}
  141. {$R IconsDotNet\TIdCmdTCPServer.bmp}
  142. {$R IconsDotNet\TIdConnectionIntercept.bmp}
  143. {$R IconsDotNet\TIdICMPClient.bmp}
  144. {$R IconsDotNet\TIdInterceptSimLog.bmp}
  145. {$R IconsDotNet\TIdInterceptThrottler.bmp}
  146. {$R IconsDotNet\TIdIOHandlerStack.bmp}
  147. {$R IconsDotNet\TIdIOHandlerStream.bmp}
  148. {$R IconsDotNet\TIdLogDebug.bmp}
  149. {$R IconsDotNet\TIdLogEvent.bmp}
  150. {$R IconsDotNet\TIdLogFile.bmp}
  151. {$R IconsDotNet\TIdLogStream.bmp}
  152. {$R IconsDotNet\TIdSchedulerOfThreadDefault.bmp}
  153. {$R IconsDotNet\TIdSchedulerOfThreadPool.bmp}
  154. {$R IconsDotNet\TIdServerIOHandlerStack.bmp}
  155. {$R IconsDotNet\TIdSimpleServer.bmp}
  156. {$R IconsDotNet\TIdTCPClient.bmp}
  157. {$R IconsDotNet\TIdTCPServer.bmp}
  158. {$R IconsDotNet\TIdThreadComponent.bmp}
  159. {$R IconsDotNet\TIdUDPClient.bmp}
  160. {$R IconsDotNet\TIdUDPServer.bmp}
  161. {$R IconsDotNet\TIdIPMCastClient.bmp}
  162. {$R IconsDotNet\TIdIPMCastServer.bmp}
  163. {$R IconsDotNet\TIdSocksInfo.bmp}
  164. {$ELSE}
  165. {$IFNDEF FPC}
  166. {$IFDEF BORLAND}
  167. {$R IdCoreRegister.dcr}
  168. {$ELSE}
  169. {$R IdCoreRegisterCool.dcr}
  170. {$ENDIF}
  171. {$ENDIF}
  172. {$ENDIF}
  173. {$IFDEF HAS_TSelectionEditor}
  174. // TIdComponentSelectionEditor is called at design-time when saving/compiling a
  175. // project. It enumerates the data types of all parameters and return values of
  176. // every event handler assigned to any Indy component, extracting the unit names
  177. // of those data types and passing them to the IDE so it can insert them into
  178. // 'uses' clauses as needed.
  179. procedure SendUnitNameToProc(const AUnitName: String; Proc: TGetStrProc);
  180. begin
  181. // Do not return the 'System' unit, otherwise it will
  182. // cause an "Identifier redeclared" compiler error!
  183. if (AUnitName <> '') and (not TextIsSame(AUnitName, 'System')) then begin {do not localize}
  184. Proc(AUnitName);
  185. end;
  186. end;
  187. {$IFDEF VCL_XE2_OR_ABOVE}
  188. // in Delphi XE2 and later, TRttiInvokableType is used to enumerate parameters
  189. // and return values, and TRttiType reports fully qualified type names, so
  190. // finding a given type's unit name is very easy...
  191. function GetUnitNameForType(const AType: TRttiType): String;
  192. begin
  193. // TRttiParameter.ParamType may be nil if it's an untyped var or const parameter...
  194. // TRttiMethodType.ReturnType may be nil if it's a procedure...
  195. if AType <> nil then begin
  196. // TRttiType.UnitName returns the unit that declares TRttiType itself
  197. // (System.Rtti), so parse the TRttiType.QualifiedName value instead...
  198. Result := AType.QualifiedName;
  199. SetLength(Result, Length(Result) - Length(AType.Name) - 1);
  200. end else begin
  201. Result := '';
  202. end;
  203. end;
  204. {$ELSE}
  205. // in Delphi prior to XE2, as well as in FreePascal, TRttiInvokableType is not
  206. // available, so we have to use TypInfo RTTI to enumerating parameters and
  207. // return values, but only certain versions implement rich enough RTTI to allow
  208. // that. Let's try to pull out what we can...
  209. {$IFDEF FPC_2_6_0_OR_ABOVE}
  210. {$DEFINE HAS_tkEnumeration_UnitName}
  211. {$DEFINE HAS_tkMethod_ParamTypeInfo}
  212. {$ELSE}
  213. {$IFDEF VCL_6_OR_ABOVE}
  214. {$DEFINE HAS_tkEnumeration_UnitName}
  215. {$ENDIF}
  216. {$IFDEF VCL_2010_OR_ABOVE}
  217. {$DEFINE HAS_tkMethod_ParamTypeInfo}
  218. {$ENDIF}
  219. {$ENDIF}
  220. procedure SkipShortString(var P: PByte);
  221. begin
  222. Inc(P, 1 + Integer(P^));
  223. end;
  224. function ReadShortString(var P: PByte): String;
  225. begin
  226. {$IFDEF VCL_2009_OR_ABOVE}
  227. Result := UTF8ToString(PShortString(P)^);
  228. {$ELSE}
  229. Result := PShortString(P)^;
  230. {$ENDIF}
  231. SkipShortString(P);
  232. end;
  233. {$IFDEF FPC_2_6_0_OR_ABOVE}
  234. function NextShortString(PS: PShortString): PShortString;
  235. begin
  236. Result := PShortString(Pointer(PS)+PByte(PS)^+1);
  237. end;
  238. {$ENDIF}
  239. function GetUnitNameFromTypeName(const ATypeName: String): String;
  240. var
  241. K: Integer;
  242. begin
  243. // check if the type is qualified
  244. K := LastDelimiter('.', ATypeName);
  245. if K <> 0 then begin
  246. Result := Copy(ATypeName, 1, K-1);
  247. end else begin
  248. // TODO: enumerate package units and find the typename...
  249. Result := '';
  250. end;
  251. end;
  252. function GetUnitNameFromTypeInfo(const ATypeInfo: PPTypeInfo): String;
  253. var
  254. LTypeData: PTypeData;
  255. {$IFDEF HAS_tkEnumeration_UnitName}
  256. {$IFDEF FPC}
  257. PS, PSLast: PShortString;
  258. {$ELSE}
  259. LBaseTypeData: PTypeData;
  260. Value: Integer;
  261. P: PByte;
  262. {$ENDIF}
  263. {$ENDIF}
  264. begin
  265. Result := '';
  266. if ATypeInfo = nil then begin
  267. Exit;
  268. end;
  269. if ATypeInfo^ = nil then begin
  270. Exit;
  271. end;
  272. LTypeData := GetTypeData(ATypeInfo^);
  273. case ATypeInfo^.Kind of
  274. {$IFDEF HAS_tkEnumeration_UnitName}
  275. tkEnumeration: begin
  276. {$IFDEF FPC}
  277. // the unit name is the last string in the name list
  278. PS := @(LTypeData^.NameList);
  279. PSLast := nil;
  280. while PByte(PS)^ <> 0 do begin
  281. PSLast := PS;
  282. PS := NextShortString(PS);
  283. end;
  284. if PSLast <> nil then begin
  285. Result := PSLast^;
  286. end;
  287. {$ELSE}
  288. // the unit name follows after the name list
  289. LBaseTypeData := GetTypeData(LTypeData^.BaseType^);
  290. P := PByte(@(LBaseTypeData^.NameList));
  291. // LongBool/WordBool/ByteBool have MinValue < 0 and arbitrary
  292. // content in Value; Boolean has Value in [0, 1] }
  293. if (ATypeInfo^ = System.TypeInfo(Boolean)) or (LBaseTypeData^.MinValue < 0) then
  294. begin
  295. for Value := 0 to 1 do begin
  296. SkipShortString(P);
  297. end;
  298. end else
  299. begin
  300. for Value := LBaseTypeData^.MinValue to LBaseTypeData^.MaxValue do begin
  301. SkipShortString(P);
  302. end;
  303. end;
  304. Result := ReadShortString(P);
  305. {$ENDIF}
  306. end;
  307. {$ENDIF}
  308. tkSet: begin
  309. Result := GetUnitNameFromTypeInfo(LTypeData^.CompType);
  310. end;
  311. {$IFDEF VCL_5_OR_ABOVE}
  312. tkClass: begin
  313. {$IFDEF VCL_2009_OR_ABOVE}
  314. Result := UTF8ToString(LTypeData^.UnitName);
  315. {$ELSE}
  316. Result := LTypeData^.UnitName;
  317. {$ENDIF}
  318. end;
  319. {$ENDIF}
  320. {$IFDEF FPC_2_6_0_OR_ABOVE}
  321. tkHelper: begin
  322. Result := LTypeData^.HelperUnit;
  323. end;
  324. {$ENDIF}
  325. {$IFDEF VCL_5_OR_ABOVE}
  326. tkInterface: begin
  327. {$IFDEF VCL_2009_OR_ABOVE}
  328. Result := UTF8ToString(LTypeData^.IntfUnit);
  329. {$ELSE}
  330. Result := LTypeData^.IntfUnit;
  331. {$ENDIF}
  332. end;
  333. {$ENDIF}
  334. {$IFDEF FPC_2_2_2_OR_ABOVE} // TODO: when was tkInterfaceRaw added?
  335. tkInterfaceRaw: begin
  336. Result := LTypeData^.RawIntfUnit;
  337. end;
  338. {$ENDIF}
  339. {$IFDEF VCL_6_OR_ABOVE}
  340. tkDynArray: begin
  341. {$IFDEF VCL_2009_OR_ABOVE}
  342. Result := UTF8ToString(LTypeData^.DynUnitName);
  343. {$ELSE}
  344. Result := LTypeData^.DynUnitName;
  345. {$ENDIF}
  346. if Result = '' then begin
  347. Result := GetUnitNameFromTypeInfo(LTypeData^.elType2);
  348. end;
  349. end;
  350. {$ENDIF}
  351. end;
  352. end;
  353. procedure GetUnitNamesForMethodType(const ATypeInfo: PTypeInfo; Proc: TGetStrProc);
  354. type
  355. PPPTypeInfo = ^PPTypeInfo;
  356. var
  357. LTypeData: PTypeData;
  358. LTypeDataPtr: PByte;
  359. K: Integer;
  360. UnitName: string;
  361. begin
  362. if ATypeInfo = nil then begin
  363. Exit;
  364. end;
  365. LTypeData := GetTypeData(ATypeInfo);
  366. LTypeDataPtr := PByte(@(LTypeData^.ParamList));
  367. if LTypeData^.ParamCount > 0 then
  368. begin
  369. for K := 0 to LTypeData^.ParamCount-1 do
  370. begin
  371. Inc(LTypeDataPtr, SizeOf(TParamFlags));
  372. SkipShortString(LTypeDataPtr);
  373. {$IFDEF HAS_tkMethod_ParamTypeInfo}
  374. // handled further below...
  375. SkipShortString(LTypeDataPtr);
  376. {$ELSE}
  377. UnitName := GetUnitNameFromTypeName(ReadShortString(LTypeDataPtr));
  378. SendUnitNameToProc(UnitName, Proc);
  379. {$ENDIF}
  380. end;
  381. end;
  382. if LTypeData^.MethodKind = mkFunction then
  383. begin
  384. {$IFDEF HAS_tkMethod_ParamTypeInfo}
  385. SkipShortString(LTypeDataPtr);
  386. UnitName := GetUnitNameFromTypeInfo(PPPTypeInfo(LTypeDataPtr)^);
  387. Inc(LTypeDataPtr, SizeOf(PPTypeInfo));
  388. {$ELSE}
  389. UnitName := GetUnitNameFromTypeName(ReadShortString(LTypeDataPtr));
  390. {$ENDIF}
  391. SendUnitNameToProc(UnitName, Proc);
  392. end;
  393. {$IFDEF HAS_tkMethod_ParamTypeInfo}
  394. if LTypeData^.ParamCount > 0 then
  395. begin
  396. Inc(LTypeDataPtr, SizeOf(TCallConv));
  397. for K := 0 to LTypeData^.ParamCount-1 do
  398. begin
  399. UnitName := GetUnitNameFromTypeInfo(PPPTypeInfo(LTypeDataPtr)^);
  400. SendUnitNameToProc(UnitName, Proc);
  401. Inc(LTypeDataPtr, SizeOf(PPTypeInfo));
  402. end;
  403. end;
  404. {$ENDIF}
  405. end;
  406. {$ENDIF}
  407. type
  408. TIdBaseComponentSelectionEditor = class(TSelectionEditor)
  409. public
  410. procedure RequiresUnits(Proc: TGetStrProc); override;
  411. end;
  412. procedure TIdBaseComponentSelectionEditor.RequiresUnits(Proc: TGetStrProc);
  413. var
  414. Comp: TIdBaseComponent;
  415. I: Integer;
  416. {$IFDEF VCL_2010_OR_ABOVE}
  417. Ctx: TRttiContext;
  418. RetreivedCtx: Boolean;
  419. PropInfo: TRttiProperty;
  420. PropValue: TValue;
  421. {$IFDEF VCL_XE2_OR_ABOVE}
  422. PropType: TRttiMethodType;
  423. Param: TRttiParameter;
  424. {$ENDIF}
  425. {$ELSE}
  426. PropList: PPropList;
  427. PropCount: Integer;
  428. PropInfo: PPropInfo;
  429. J: Integer;
  430. {$ENDIF}
  431. begin
  432. inherited RequiresUnits(Proc);
  433. if (Designer = nil) or (Designer.Root = nil) then Exit;
  434. {$IFDEF VCL_2010_OR_ABOVE}
  435. RetreivedCtx := False;
  436. {$ENDIF}
  437. for I := 0 to Designer.Root.ComponentCount - 1 do
  438. begin
  439. if Designer.Root.Components[i] is TIdBaseComponent then
  440. begin
  441. Comp := TIdBaseComponent(Designer.Root.Components[i]);
  442. {$IFDEF VCL_2010_OR_ABOVE}
  443. if not RetreivedCtx then
  444. begin
  445. Ctx := TRttiContext.Create;
  446. RetreivedCtx := True;
  447. end;
  448. for PropInfo in Ctx.GetType(Comp.ClassType).GetProperties do
  449. begin
  450. // only interested in *assigned* event handlers
  451. // NOTE: Delphi 2010 has a problem with checking the TValue.IsEmpty
  452. // property inlined like below. It causes a "F2084 Internal Error C13394"
  453. // compiler error. So splitting up the comparison to use a local TValue
  454. // variable to work around that...
  455. {
  456. if (PropInfo.PropertyType.TypeKind = tkMethod) and
  457. (not PropInfo.GetValue(Comp).IsEmpty) then
  458. }
  459. if PropInfo.PropertyType.TypeKind = tkMethod then
  460. begin
  461. PropValue := PropInfo.GetValue(Comp);
  462. if not PropValue.IsEmpty then
  463. begin
  464. // although the System.Rtti unit was introduced in Delphi 2010,
  465. // the TRttiInvokableType class was not added to it until XE2
  466. {$IFDEF VCL_XE2_OR_ABOVE}
  467. PropType := PropInfo.PropertyType as TRttiMethodType;
  468. for Param in PropType.GetParameters do begin
  469. SendUnitNameToProc(GetUnitNameForType(Param.ParamType), Proc);
  470. end;
  471. SendUnitNameToProc(GetUnitNameForType(PropType.ReturnType), Proc);
  472. {$ELSE}
  473. // use the System.TypInfo unit to access the parameters and return type
  474. GetUnitNamesForMethodType(PropInfo.PropertyType.Handle, Proc);
  475. {$ENDIF}
  476. end;
  477. end;
  478. end;
  479. {$ELSE}
  480. PropCount := GetPropList(Comp, PropList);
  481. if PropCount > 0 then
  482. begin
  483. try
  484. for J := 0 to PropCount-1 do
  485. begin
  486. PropInfo := PropList^[J];
  487. // only interested in *assigned* event handlers
  488. if (PropInfo^.PropType^.Kind = tkMethod) and
  489. (GetMethodProp(Comp, PropInfo).Code <> nil) then
  490. begin
  491. GetUnitNamesForMethodType(PropInfo^.PropType^, Proc);
  492. end;
  493. end;
  494. finally
  495. FreeMem(PropList);
  496. end;
  497. end;
  498. {$ENDIF}
  499. end;
  500. end;
  501. end;
  502. {$ENDIF}
  503. procedure Register;
  504. begin
  505. {$IFNDEF FPC}
  506. RegisterComponents(RSRegIndyClients, [
  507. TIdTCPClient
  508. ,TIdUDPClient
  509. ,TIdCmdTCPClient
  510. ,TIdIPMCastClient
  511. {$IFNDEF DOTNET}
  512. ,TIdIcmpClient
  513. ,TIdTraceRoute
  514. {$ENDIF}
  515. ]);
  516. RegisterComponents(RSRegIndyServers, [
  517. TIdUDPServer,
  518. TIdCmdTCPServer,
  519. TIdSimpleServer,
  520. TIdTCPServer,
  521. TIdIPMCastServer
  522. ]);
  523. RegisterComponents(RSRegIndyIOHandlers,[
  524. TIdIOHandlerStack
  525. ,TIdIOHandlerStream
  526. ,TIdServerIOHandlerStack
  527. ]);
  528. RegisterComponents(RSRegIndyIntercepts, [
  529. TIdConnectionIntercept
  530. ,TIdInterceptSimLog
  531. ,TIdInterceptThrottler
  532. ,TIdLogDebug
  533. ,TIdLogEvent
  534. ,TIdLogFile
  535. ,TIdLogStream
  536. ]);
  537. {$IFDEF FMX}
  538. // RLebeau 8/1/2011 - FireMonkey has problems resolving references to
  539. // TIdAntiFreeze correctly because it is implemented in a design-time
  540. // package and not a run-time package. Until we can fix that properly,
  541. // we'll group TIdAntiFreeze with TControl so the IDE can filter out
  542. // TIdAntiFreeze from appearing at design-time in FireMoney projects.
  543. // Users will have to instantiate TIdAntiFreeze in code. This does not
  544. // affect VCL projects.
  545. GroupDescendentsWith(TIdAntiFreeze, TControl);
  546. {$ENDIF}
  547. RegisterComponents(RSRegIndyMisc, [
  548. TIdSocksInfo,
  549. TIdAntiFreeze,
  550. TIdSchedulerOfThreadDefault,
  551. TIdSchedulerOfThreadPool,
  552. TIdThreadComponent
  553. ]);
  554. {$ELSE}
  555. //This is a tempoary workaround for components not fitting on the palette
  556. //in Lazarus. Unlike Delphi, Lazarus still does not have the ability to
  557. //scroll through a palette page.
  558. RegisterComponents(RSRegIndyClients+CoreSuffix, [
  559. TIdTCPClient
  560. ,TIdUDPClient
  561. ,TIdCmdTCPClient
  562. ,TIdIPMCastClient
  563. {$IFNDEF DOTNET}
  564. ,TIdIcmpClient
  565. ,TIdTraceRoute
  566. {$ENDIF}
  567. ]);
  568. RegisterComponents(RSRegIndyServers+CoreSuffix, [
  569. TIdUDPServer,
  570. TIdCmdTCPServer,
  571. TIdSimpleServer,
  572. TIdTCPServer,
  573. TIdIPMCastServer
  574. ]);
  575. RegisterComponents(RSRegIndyIOHandlers+CoreSuffix,[
  576. TIdIOHandlerStack
  577. ,TIdIOHandlerStream
  578. ,TIdServerIOHandlerStack
  579. ]);
  580. RegisterComponents(RSRegIndyIntercepts+CoreSuffix, [
  581. TIdConnectionIntercept
  582. ,TIdInterceptSimLog
  583. ,TIdInterceptThrottler
  584. ,TIdLogDebug
  585. ,TIdLogEvent
  586. ,TIdLogFile
  587. ,TIdLogStream
  588. ]);
  589. RegisterComponents(RSRegIndyMisc+CoreSuffix, [
  590. TIdSocksInfo,
  591. TIdAntiFreeze,
  592. TIdSchedulerOfThreadDefault,
  593. TIdSchedulerOfThreadPool,
  594. TIdThreadComponent
  595. ]);
  596. {$ENDIF}
  597. {$IFDEF HAS_TSelectionEditor}
  598. RegisterSelectionEditor(TIdBaseComponent, TIdBaseComponentSelectionEditor);
  599. {$ENDIF}
  600. end;
  601. {$IFDEF FPC}
  602. initialization
  603. {$i IdRegisterCore.lrs}
  604. {$ENDIF}
  605. end.