Babble about Win32Lib
- Posted by David Cuny <dcuny at LANSET.COM> Mar 02, 1999
- 414 views
[Long Post Warning] Just thought I'd post the direction I'm heading with Win32Lib these days. This is pretty much speculation; after WinMan and Gnuphoria, I'm not making any promises that this will ever see the light of day. [The Problems] 1. I can't add new controls to Win32Lib without rewriting the core code. 2. Win32Lib doesn't support emulated (non-native, 100% Euphoria) controls. 3. Maintaining ports such as Dos32Lib is difficult, because there is little code sharing. 4. The graphic portion of Win32Lib is just a bit *too* hacked. 5. The graphic portion of Dos32Lib is limping badly and needs a rewrite. 6. Win32Lib is not very portable, and the X Windows port looms in the future. [The Goals] 1. Decouple Win32-specific code from Win32Lib, making it platform independant. The core WinLib code is limited to knowing about windows, graphics and events - shell routines whose personality is defined in included files. 2. Add hooks to the WinLib core so it can easily be extended with include files, and move all the controls into include files. 3. The same hooks should also support the creation of 'emulated' controls (such as a 'clock' control). These emulated controls should only use platform-independant functions defined in the core code, so they will work across platforms. (I'm thinking of calling them EuCX controls). [The Benefits] First and foremost, other people should be able to easily add new native and emulated controls to Win32Lib. That takes a burden off me, and puts it into the capable hands of bright coders such as yourselves. Second, it will be much easier to keep multiple platforms in sync, since they can share large amounts of code. Third, it should make porting to other platforms (such as Linux, X Windows and Macintosh) much easier, since the initial port can use emulated controls, and later implement the controls as native. Fourth, it gives me a chance to go back an rewrite the Win32Lib graphic routines, now that I have a better idea of how things go together. Finally, I can fool around with multiple look and feels for controls - 'Java' and 'Platinum' controls. Oh, I should mention that this doesn't preclude hooking into native Win32 calls - but it obviously makes the code non-portable. [What's The Current Status?] Those who have made it this far into my e-mail will no doubt have noticed that I've been a bit short on details. I've got a very specific plan of implementation in mind, but things change as I code and find out that there are much better ways of doing things, or lead to a dead-end. In any event, the proof is in the code, and the current code is nowhere near completion. One reason to post all this stuff is to get some feedback. How do people feel about this direction? Once I get the basic stuff in place (it'll take a while), will anyone be willing to help implement new native or emulated controls? Another reason is to get feedback about cross-platform compatibility. Cross-platform is a high priority for me, and I need to make some serious changes. Finally, it explains why I'm flaking out on all that stuff I've been promising to do, like fix that bug in the Res toolkit, or add more common controls. Comments? -- David Cuny