Neil Hodgson | 14 Jan 2002 00:37
Picon

Re: [scite] Re: [Foxgui-users]FXScintilla-1.42fox1

Gilles Filippini:

> My opinion is that writing
> class FXFont;
> typedef FXFont *FontID;
> actually costs *nothing* more than :
> typedef void *FontID;
> because the compiler needs to know about FXFont only when processing the
> PlatFOX.cxx source.
> And I see two more advantages :
> - safe typechecking (no need to typecast from void* to FXFont)
> - better readability of the source code (again, no need to typecast).
> The only drawback I see is that it clutters platfrom.h with as many
> definition as platforms. But well... I think it doesn't matter since it
> does not require including platform dependent headers. See below also.

   I don't like the clutter. It also gets in the way of trying some other
techniques.

> > In the future, I'd like to move in the direction of only
> > having interfaces defined in Platform.h without any data fields,
changing
> > the code in the same way as was done for Surface recently. If you want
to
> > continue with your own version of Platform.h that defines FX* then that
is
> > fine, but there are advantages to only having one definition.
> I agree with you on this point.
> FontID, WindowID and co are implementation details. They shouldn't be
> used by the interfaces. They shouldn't even appear in platform.h.
> I'd like to keep my own xxxID definitions until these changes are done.

   OK. I think the easiest solution for now is in separate copies until I
find time to fix this up properly. Much of the problem here is from cutting
corners originally. BTW, the PLAT_ definitions are almost unused in
Scintilla now and should eventually move out so they are not seen by
platform independent code.

   Neil


Gmane