Borut Maricic wrote:
All Unicode related code must remain under IFDEFs, not contaminating
the ANSI version of Win32 widgetset because Unicode code is
experimental, and we are approaching 1.0, and if we don´t isolate it,
we may break Win32 interface, or delay 1.0 by introducing bugs. (Like
the lack of support for Win9x).

I agree very much.

I do not agree on permanent IFDEFs. For releasing 1.0 maybe yes, but in the long term no.

IMO there are 2 ways to solve this:
1) make 2 separate widgetstes. Im' not really pro this since it is hard to maintain and causes a lot of duplicate code. We don't want the same ifdef mess we have with gtk1/2 again. 2) Load the functions at runtime. So if the W function is available use that otherwise use the A function.


Errrr, I´m sorry to say but I can immediatly see that your code breaks
Win98 support for the ANSI version of win32 widgetset. Specifically
the following code:

   if Win32PlatformIsUnicodeUsed
   then Result := Windows.DefWindowProcW(Window, Msg, WParam, LParam)
   else Result := Windows.DefWindowProc (Window, Msg, WParam, LParam);

This is not enougth to run on Win9x, because even if the second line
above is never executed, the linker will still link the W versions of
Windows APIs. And our software won´t be able to run on Win9x because
those functions don´t exist.

For those situations you need option 2.

I agree that the last of these three lines (and in all
similar cases) should be:
    else Result := Windows.DefWindowProcA(Window, Msg, WParam, LParam);

That doesn't matter. The DefWindowProcW will be loaded anyway.

As I wrote:
* Have not coded any support for correct handling of the
situation where the runtime Win does not support Unicode.

(There should be code conversions too!!)

However, if one does not compile with -dUnicode and -dUseWin32u
the code should work as before (or at least I can not see
any problem). This code is still protected through ifdef
UseWin32u, however not in a "hardliner" way, so to speak (in
the sense that the if-command above would still be executed
(and else part taken)).

You assume the compiler will remove a non reached part of the code.

I think that your initial question (of the whole thread) is
a very good one: is this all necessary? Maybe it is just too
much to do and a new forked widgetset (just for Unicode-able
Wins) will suffice, as you suggest.

Then you will have to distribute 2 executables.

I'll read your wiki-additions in the evening. Any comments
from the core group?

Marc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to