Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-04

Published interface TWSxxxxxx

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

José Mejuto

Hello Lazarus-List,

All objects in the widgetset interface TWSxxxxx has the "class procedure" under the published section like:

TWSBitBtn = class(TWSButton)
published
  class procedure SetGlyph(const ABitBtn:...........
  class procedure SetLayout(const ABitBtn:..........
  class procedure SetMargin(const ABitBtn:..........
  class procedure SetSpacing(const ABitBtn:.........
end;

Is there any reason to be published instead public ? Maybe to garantee that the functions will never be removed by fpc/linker if not directly used in the code ?

Best regards, Jos?

Reply by email

Marc Weustink
to José Mejuto
Jos? Mejuto wrote 16 lines
Hello Lazarus-List, All objects in the widgetset interface TWSxxxxx has the "class procedure" under the published section like: TWSBitBtn = class(TWSButton) published class procedure SetGlyph(const ABitBtn:........... class procedure SetLayout(const ABitBtn:.......... class procedure SetMargin(const ABitBtn:.......... class procedure SetSpacing(const ABitBtn:......... end; Is there any reason to be published instead public ? Maybe to garantee that the functions will never be removed by fpc/linker if not directly used in the code ?

there is a "virtual" classtree build based on RTTI. RTTI is only generated for published methods

Marc

Reply by email

José Mejuto
to Marc Weustink

Hello Lazarus-List,

you wrote
> Is there any reason to be published instead public ? Maybe to garantee > that the functions will never be removed by fpc/linker if not directly > used in the code ?

MW> there is a "virtual" classtree build based on RTTI. RTTI is only MW> generated for published methods

So this limits the possibility of the LCL to left out parts not being used in the program, as every class and method is references in some way by a published method.

And now the question :) should I in LCLfpgui move the public methods to published section (when ancestor is published of course) ? It is just to get a more hint clear compilation.

Best regards, Jos?

Reply by email

Marc Weustink
to José Mejuto
Jos? Mejuto wrote 13 lines
Hello Lazarus-List, Friday, April 16, 2010, 3:02:37 PM, you wrote: >> Is there any reason to be published instead public ? Maybe to garantee >> that the functions will never be removed by fpc/linker if not directly >> used in the code ? MW> there is a "virtual" classtree build based on RTTI. RTTI is only MW> generated for published methods So this limits the possibility of the LCL to left out parts not being used in the program, as every class and method is references in some way by a published method.

Yes, you correct. Thats one of the reasons of the big hello world. We will move this to interfaces someday after 1.0 or so.

And now the question :) should I in LCLfpgui move the public methods to published section (when ancestor is published of course) ? It is just to get a more hint clear compilation.

IMO yes.

Marc

Reply by email