mirror of
https://github.com/reactos/wine.git
synced 2025-02-01 09:42:14 +00:00
f1aa3030a6
Sun Aug 4 18:18:48 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/scroll.c] Attempted to implement undocumented scroll-bar messages. * [tools/build.c] [include/callback.h] [windows/winproc.c] CallTo16_* functions now get DS from the previous 16-bit stackframe. * [if1632/thunk.c] [include/callback.h] Added thunks to implement callbacks for the emulator. Now all the Enum* functions always take a real function pointer even in the emulator. * [loader/builtin.c] Removed binary search in BUILTIN_GetEntryPoint32(), as it didn't work with NULL entry points. Using linear search now. * [loader/module.c] Implemented IsSharedSelector(). * [loader/task.c] Changed SwitchStackTo/Back to use the instance data to store the previous stack instead of the TDB. Also copy the local variables onto the new stack. Added GetExeVersion() and SetTackSignalProc(). Implemented SetSigHandler(). Sat Aug 3 22:19:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [controls/menu.c] "Fixed" problem in deleting menus where win32 could get into an endless loop when it crashed. I think I've fixed the symptoms, not the original problem so it might be worth further investigation. * [debugger/registers.c] Added missing #ifdefs on FS_REG and GS_REG, needed for FreeBSD to compile wine properly. * [files/dos_fs.c] Made DOSFS_Hash and DOSFS_Match non-static so they can be called from win32/findfile.c (q.v.). * [if1632/gdi32.spec] Added SetMapMode (call existing function) * [if1632/kernel32.spec] Added FindFirstFileA and SetFileAttributesA. * [if1632/user32.spec] Added BringWindowToTop, CreatePopupMenu, GetKeyState, GetParent, IsDlgButtonChecked (call existing functions) and IsDialogMessageA, UnhookWindowsHookEx. * [win32/file.c] Added stub function SetFileAttributes32A. It's a stub because I can't really work out what this function should do with most attributes in a Unix environment. Anyone care to expand it? * [win32/findfile.c] New file. Initial stab at FindFirstFile. This doesn't work as specified yet, though a lot of the groundwork is there. I haven't time to work on this for the next month, so if anyone wants to pick it up and run with it please do. * [win32/memory.c] Removed malloc.h from includes (covered by stdlib.h include, and gets rid of a warning in FreeBSD). * [win32/newfns.c] UnhookWindowsHookEx32A stub added. * [win32/user32.c] Added implementation of IsDialogMessage32A. * [windows/dialog.c] IsDlgButtonChecked now calls SendDlgItemMessage32A instead of SendDlgItemMessage16. Sat Aug 3 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/graphics.c] Removed rectangle checking (conflicted with nonstandard mapping modes). * [windows/dialog.c] Added check for child-style dialogs to DS_ABSALIGN coordinate conversion. * [objects/color.c] Cleaned up misc. bits Thu Aug 1 10:51:45 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/focus.c] [windows/event.c] [windows/win.c] [windows/defdlg.c] Fixes to focusing and activation. * [windows/defdlg.c] Properly(?) handle DM_GETDEFID. * [controls/combo.c] Handle CB_FINDSTRINGEXACT, CB_SETEDITSEL, CB_GETEDITSEL. CBCheckSize: Adjust edit position. Tue Jul 30 09:46:36 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/file.c] [include/file.h] [loader/module.c] [loader/ne_image.c] Pass HFILEs instead of unix-fds to self-loader code. Mon Jul 29 21:48:25 1996 Albrecht Kleine <kleine@ak.sax.de> * [include/metafile.h] [objects/metafile.c] [objects/text.c] Implemented handling of some new metafile records (META_...) in PlayMetaFileRecord(), rewrite of 'case META_EXTTEXTOUT'. Added functions like MF_StretchBlt() for usage in metafiles. Minor bugfix in CopyMetafile(). * [objects/bitmap.c][objects/dib.c] Added check for metafile-DC in Bitmap and DIB functions: CreateCompatibleBitmap() etc.
This is a short discussion of resources in WineLib. Introduction Resources are used to store dialogs, menus, bitmaps, icons, version information, strings, fonts, and accelerators. In a Win3.1 programming environment, there are three file formats for resources: - the RC script, which is human-readable and can be processed by a resource compiler - the .RES file, which is the output of the resource compiler - the .EXE and .DLL files, which store resources as a part of the NE file format For WineLib, only a part of this is supported. In particular, there is no .RES file, the executable is not a NE file (as it is a native Unix executable), and some resource types are not implemented: icons, version information, strings, and fonts. Building a WineLib application The build process assumes that the C source files and the resource script is available. At the moment, a single resource script is recommended. This script is processed by winerc: 1) the preprocessor is used to resolve symbolic style name (LBS_STANDARD, ...) into numbers. This involves processing windows.h 2) the unused parts of windows.h (type definitions) are removed. This would not be necessary if Wine's windows.h would use the RC_INVOKED macro. 3) winerc is invoked to create a binary representation of the resources. This representation is stored as C source code (arrays). 4) gcc is used to compile the generated C code. Now, each resource is available as a C array to the application. As the executable is not in the NE format, it is not possible to retrieve resource locations in the executable via name. Instead, the resources have to be referenced with their generated C array names. The linker then resolves these names in the compiled resource file. 5) The program sources are compiled and linked with the output of step 4. A sample build process is in toolkit/Makefile:hello3. Required changes to the program sources Because loading the resources from an instance handle is not possible, the *Indirect functions have to be used to load a resource. The C arrays can be directly passed to the *Indirect functions. So, instead of writing hMenu=LoadMenu(hInstance,"MAIN"); write hMenu=LoadMenuIndirect(hello3_MENU_MAIN.bytes); Fortunately, the Windows API has the following functions available: DialogBoxIndirect CreateDialogIndirect DialogBoxIndirectParam CreateDialogIndirectParam LoadMenuIndirect SetDIBitsToDevice Sample code is available in hello3.c. hello3res.c contains the corresponding resources. Keeping a common source Clearly, changing the sources is not very desirable, and suggestions how to reduce the amount of work are welcome. In the meantime, two approaches allow at least to remain a common source between the Win3.1 code and the WineLib code: 1) conditional compiles: When compiling a WineLib application, WINELIB is defined. This can be used to select Wine-specific code. 2) usage of winerc for Windows: The *Indirect functions are available on plain Win3.1, and the resource format is fully compatible. Thus, recompiling sources modified for WineLib on Win3.1 is possible and known to work. Open problems 1) Icons and cursors: For these resources, there is no *Indirect function documented. In addition, both are implemented by a set of two resources. This is the reason why they are not supported by winerc. 2) Accelerators: Although winerc supports accelerators, there is no LoadAcceleratorIndirect function. A work-around would be to define one. 3) Fonts: Font resources are not supported by Wine at all. 4) String tables: Although string tables are not supported by winerc, there is no reason not to add such support. Again, some indirect loading would be necessary. 5) API requires loading by name: At some places, the name of a resource is passed instead of a handle. The WNDCLASS structure contains the name of a menu resource, and the icon in a dialog box is referenced by its name. (Are there some more places?) Clearly, loading the resource by name would be highly desirable. The resource compiler currently creates a structure containing all resources defined in an RC file. However, it is not clear how WINELIB could find the location of this structure, especially, when there is more than one RC file.