Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 20, 2006 Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
I know there have been a number of efforts already, but none of them seem to be perfect. As such, I've decided to start a project to tidy them up. This work is based on Y. Tomino's translation of the Win32 headers into D: http://tinyurl.com/s66xg (Granted, Google doesn't exactly generate English as we know it from Japanese, but still....) At the moment I've done only commctrl.d. Yes, this is a rather long file, but it's given me a chance to draw up a decent list of improvements to be implemented. I've also tweaked two of the other files to get it to compile, but not gone through improving them. Notice that commctrl.d has been reduced from two files adding to 15200 lines, 412K to a single file of 6320 lines, 166K. Download the work so far: http://pr.stewartsplace.org.uk/d/win32.zip (Only the files that have actually been modified are in the download - see the above URL for those pending.) See the readme.txt file for a description of the improvements that have been made. Anybody is more than welcome to take another of the files and implement these improvements. Please announce which file you are taking in a followup to this post, to avoid duplication of effort. When you've done it, you may post it as an attachment here or send it to me by email. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
March 20, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart, Please consider using the mingw W32API headers, instead of the official Microsoft ones. http://cvs.sourceforge.net/viewcvs.py/mingw/w32api/#dirlist There are legal issues surrounding the Microsoft headers (AFAIK, you are not permitted to redistribute them). If the W32API headers are used instead, we'll be able to include them in the DMD/GDC downloads. Fortunately, the W32API is extremely similar to the Microsoft ones, so it shouldn't be hard to use them instead. Any improvement over std.c.windows would be *greatly* appreciated. -Don. Stewart Gordon wrote: > I know there have been a number of efforts already, but none of them seem to be perfect. As such, I've decided to start a project to tidy them up. > > This work is based on Y. Tomino's translation of the Win32 headers into D: > > http://tinyurl.com/s66xg > > (Granted, Google doesn't exactly generate English as we know it from Japanese, but still....) > > At the moment I've done only commctrl.d. Yes, this is a rather long file, but it's given me a chance to draw up a decent list of improvements to be implemented. I've also tweaked two of the other files to get it to compile, but not gone through improving them. Notice that commctrl.d has been reduced from two files adding to 15200 lines, 412K to a single file of 6320 lines, 166K. > > Download the work so far: > > http://pr.stewartsplace.org.uk/d/win32.zip > > (Only the files that have actually been modified are in the download - see the above URL for those pending.) > > See the readme.txt file for a description of the improvements that have been made. Anybody is more than welcome to take another of the files and implement these improvements. Please announce which file you are taking in a followup to this post, to avoid duplication of effort. When you've done it, you may post it as an attachment here or send it to me by email. > > Stewart. > |
March 20, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | Don Clugston wrote: > Stewart, > > Please consider using the mingw W32API headers, instead of the official Microsoft ones. > > http://cvs.sourceforge.net/viewcvs.py/mingw/w32api/#dirlist Anybody who wants to write files for this project from MinGW instead is more than welcome. It doesn't really matter what we start from > There are legal issues surrounding the Microsoft headers (AFAIK, you are not permitted to redistribute them). If the W32API headers are used instead, we'll be able to include them in the DMD/GDC downloads. > Fortunately, the W32API is extremely similar to the Microsoft ones, so it shouldn't be hard to use them instead. <snip> I basically chose to start from Tomino's work because it's a fairly comprehensive set of headers for which the first step (translating into D) has already been done. But you're right to mention it insofar as that project claims to be derived from M$'s own. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
March 28, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | This project is now officially based on the public domain MinGW headers. I've translated a few more of the files on this basis, and rewritten the instructions to make more sense to a translation from C headers. I've also set up a page on Wiki4D to coordinate the project: http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI Now, who's going to contribute? In line with comments from various people including Walter, my plan is for the work to be public domain. Is this OK with everyone? The main open issue I can think of at the moment is what to do with the Windows version CC stuff. We could get rid of the CC and just compile everything in, but this'll make it easy to lose track of the minimum Windows version an application supports. We probably don't really need to distinguish between Win95/NT4 and earlier Win32 (Win32s, whatever else) anymore, but it might still be worth doing it with some or all Windows versions since then. Defining a set of version identifiers for the supported Windows versions along the Win9x and WinNT lines is another possibility, but it'll take a bit of work to determine how the #ifs should be converted. This has also brought out my wish for a version import facility once again.... http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/11981 Meanwhile, can we get away with supplying a set of command line files for various Windows versions? Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
March 28, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon wrote:
> This project is now officially based on the public domain MinGW headers. I've translated a few more of the files on this basis, and rewritten the instructions to make more sense to a translation from C headers.
>
> I've also set up a page on Wiki4D to coordinate the project:
>
> http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI
>
> Now, who's going to contribute?
>
> In line with comments from various people including Walter, my plan is for the work to be public domain. Is this OK with everyone?
>
>
> The main open issue I can think of at the moment is what to do with the Windows version CC stuff.
>
> We could get rid of the CC and just compile everything in, but this'll make it easy to lose track of the minimum Windows version an application supports. We probably don't really need to distinguish between Win95/NT4 and earlier Win32 (Win32s, whatever else) anymore, but it might still be worth doing it with some or all Windows versions since then.
>
> Defining a set of version identifiers for the supported Windows versions along the Win9x and WinNT lines is another possibility, but it'll take a bit of work to determine how the #ifs should be converted.
>
> This has also brought out my wish for a version import facility once again....
>
> http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/11981
>
> Meanwhile, can we get away with supplying a set of command line files for various Windows versions?
>
> Stewart.
>
Its probably legally better to offer it under one of the freest licenses (MIT, BSD, libpng, etc.)
|
March 28, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kyle Furlong | In article <e0cf4q$mu3$1@digitaldaemon.com>, Kyle Furlong says... > >Stewart Gordon wrote: >> This project is now officially based on the public domain MinGW headers. >> I've translated a few more of the files on this basis, and rewritten >> the instructions to make more sense to a translation from C headers. >> >> I've also set up a page on Wiki4D to coordinate the project: >> >> http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI >> >> Now, who's going to contribute? >> >> In line with comments from various people including Walter, my plan is for the work to be public domain. Is this OK with everyone? .. > >Its probably legally better to offer it under one of the freest licenses (MIT, >BSD, libpng, etc.) What's freer than releasing it as public domain? Public domain would be my preference if it were my choice. jcc7 |
March 29, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | J C Calvarese wrote:
> In article <e0cf4q$mu3$1@digitaldaemon.com>, Kyle Furlong says...
>> Stewart Gordon wrote:
>>> This project is now officially based on the public domain MinGW headers. I've translated a few more of the files on this basis, and rewritten the instructions to make more sense to a translation from C headers.
>>>
>>> I've also set up a page on Wiki4D to coordinate the project:
>>>
>>> http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI
>>>
>>> Now, who's going to contribute?
>>>
>>> In line with comments from various people including Walter, my plan is for the work to be public domain. Is this OK with everyone?
> ..
>> Its probably legally better to offer it under one of the freest licenses (MIT, >BSD, libpng, etc.)
>
> What's freer than releasing it as public domain? Public domain would be my
> preference if it were my choice.
>
> jcc7
The problem with releasing anything into the public domain is that eventually it becomes ambiguous that it IS public domain. People drop the work anywhere and however they please, and somewhere down the line someone asks, "Hey what is the licensing of such and such." If the project is inactive its easy for this ambiguity to arise. Thus, having an explicit license which stipulates that use of the work is completely free, and that copies of the license must be distributed with the work avoid this.
|
March 29, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon wrote: > This project is now officially based on the public domain MinGW headers. I've translated a few more of the files on this basis, and rewritten the instructions to make more sense to a translation from C headers. > > I've also set up a page on Wiki4D to coordinate the project: > > http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI Fantastic! > Now, who's going to contribute? I hope that I can do a bit. > > In line with comments from various people including Walter, my plan is for the work to be public domain. Is this OK with everyone? > > The main open issue I can think of at the moment is what to do with the Windows version CC stuff. > > We could get rid of the CC and just compile everything in, but this'll make it easy to lose track of the minimum Windows version an application supports. We probably don't really need to distinguish between Win95/NT4 and earlier Win32 (Win32s, whatever else) anymore, but it might still be worth doing it with some or all Windows versions since then. Definitely worthwhile for Win95 and above. > Defining a set of version identifiers for the supported Windows versions along the Win9x and WinNT lines is another possibility, but it'll take a bit of work to determine how the #ifs should be converted. It's possible to use 'static if', now that it works at module scope. #if (WINVER > 0x4000) #else #endif can become static if (WINVER> 0x4000) { } else { } It's probably abuse of 'static if', but it should work as an interim solution. Don. |
March 29, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | Don Clugston wrote: > Stewart Gordon wrote: <snip> >> Now, who's going to contribute? > > I hope that I can do a bit. Excellent! <snip> >> Defining a set of version identifiers for the supported Windows versions along the Win9x and WinNT lines is another possibility, but it'll take a bit of work to determine how the #ifs should be converted. > > It's possible to use 'static if', now that it works at module scope. > > #if (WINVER > 0x4000) > #else > #endif > can become > static if (WINVER> 0x4000) { > } else { > } > > It's probably abuse of 'static if', but it should work as an interim solution. Where would the user set WINVER? A module for the user to edit to supply this data might be one possibility, but it would be a nightmare for someone maintaining or even trying to compile several projects that have different OS requirements. But for as long as it's only an interim solution.... It would also be nice if the policy for using the versions is clearer than the WINVER/_WIN32_WINDOWS/_WIN32_WINNT stuff is at the moment. At the moment, I'm puzzled by the number of instances of this #if (_WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0500) or similar. It seems to be saying that the function may be used by either an application that supports Win98 or an application that supports Win2000. So you could have a program that works on Windows 98 and Windows NT4 but not Windows 95, or a program that works on Windows 95 and Windows 2000 but not Windows NT4, and whatever is in that #if would be available to either. Unless I'm misunderstanding, it would appear that the || should be an &&. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
March 29, 2006 Re: Yet another effort at translating the Win32 API headers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon wrote: > It would also be nice if the policy for using the versions is clearer than the WINVER/_WIN32_WINDOWS/_WIN32_WINNT stuff is at the moment. At the moment, I'm puzzled by the number of instances of this > > #if (_WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0500) > > or similar. It seems to be saying that the function may be used by either an application that supports Win98 or an application that supports Win2000. So you could have a program that works on Windows 98 and Windows NT4 but not Windows 95, or a program that works on Windows 95 and Windows 2000 but not Windows NT4, and whatever is in that #if would be available to either. Unless I'm misunderstanding, it would appear that the || should be an &&. I think that the system is like this: _WIN32_WINDOWS is defined only for Win95/98/Me (the crappy ones) _WIN32_WINNT is defined only for Win NT4/2k/XP/Vista/... (the OK ones) WINVER is defined for all Windows, and equals _WIN32_* for any given OS. Now, the above condition does have to use an ||, as it's never the case that both are defined. It's also true that it could simply be (in this case) #if (WINVER >= 0x0410) because there is no _WIN32_WINNT between 0x0410 and 0x0500.. You also made a slight mistake - the condition doesn't hold for neither of NT4 or Win95, so it's actually not that confusing :) xs0 |
Copyright © 1999-2021 by the D Language Foundation