Commit 5f721f81 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 0.5

Sun Jan 2 12:38:53 1994 David Metcalfe <david@prism.demon.co.uk> * [windows/class.c] Implemented GetClassName and GetClassInfo. * [windows/caret.c] Various improvements to text caret code. Fri Dec 31 15:22:22 1993 John Brezak <brezak@apollo.hp.com> * [misc/comm.c] Patches to work with NetBSD. Thu Dec 30 12:11:55 1993 John Richardson <jrichard@cs.uml.edu> * [objects/bitblt.c] Added StretchBlt(). Tue Jan 4 05:22:07 1994 julliard@di.epfl.ch (Alexandre Julliard) * [misc/user.c] Added creation of system message queue. * [objects/bitmap.c] [objects/dcvalues.c] [windows/dc.c] Added DC size fields into DC structure. * [objects/clipping.c] Bug fix in CLIPPING_IntersectRect(). * [windows/class.c] Allocate a DCE instead of a DC for CS_CLASSDC classes. * [windows/clipping.c] Fixed GetUpdateRect() and GetUpdateRgn() to clip to the client area. * [windows/dce.c] Implemented GetDCEx() and GetWindowDC(). * [windows/defwnd.c] Implemented WM_WINDOWPOSCHANGED handling. * [windows/event.c] Preliminary support for Xlib event handling instead of Xt callbacks. Changed MSG_AddMsg() calls to hardware_event() or PostMessage(). * [windows/message.c] Preliminary support for multiple message queues. Implemented hardware_event() to store messages into the system queue. Implemented Get/SetTaskQueue(). Better WM_PAINT and WM_TIMER handling. Changes to use Xlib instead of Xt for events. * [windows/painting.c] Use GetDCEx() to retrieve the DC, to get a correct visible region. * [windows/timer.c] Moved the timer procedure callback into DispatchMessage(). Changed implementation to get rid of Xt timeouts. Timer checking is now done inside GetMessage(). * [windows/win.c] Allocate a DCE instead of a DC for CS_OWNDC windows. Replaced Xt calls with Xlib calls. Moved window positioning functions into windows/winpos.c * [windows/winpos.c] (New file) Rewritten most of the window positioning functions. Implemented SetWindowPos() and MapWindowPoints(). Jan 3, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [if1632/user.spec] Bad arguments description for function SetDlgItemText. * [objects/text.c] Function DrawText now handle DT_CALCRECT request. * [misc/message.c] Message boxes now use DrawText with DT_CALCRECT. * [windows/graphics.c] Bug fix in function FrameRect, (it was using PEN instead of BRUSH). * [windows/win.c] Bug fix for flags in function ShowWindow. More accurate WM_SIZE generated by function ShowWindow. * [controls/listbox.c] More code for LBS_MULTIPLESEL. More code for LBS_MULTICOLUMN. * [include/windows.h] Bad define for MF_SEPARATOR. * [controls/menu.c] New functions: PopMenuWndProc() with 'glues', CreatePopupMenu(), AppendMenu(), InsertMenu(), RemoveMenu(), DeleteMenu(), ModifyMenu(), TrackPopupMenu(). Code in stubs: CreateMenu(), DestroyMenu(). Sat Jan 1 10:22:43 1994 Bob Amstadt (bob@pooh) * loader/wine.c: Added support for relocation types 5 and 6. Mon Dec 27 11:06:03 1993 Erik Bos (erik@trashcan.hacktic.nl) * [misc/comm.c] new functions: BuildCommDCB(), OpenComm(), CloseComm(), SetCommBreak(), ClearCommBreak(), EscapeCommFunction(), FlushComm(), GetCommError(), SetCommEventMask(), GetCommEventMask(), SetCommState(), GetCommState(), TransmitCommChar(), ReadComm(), WriteComm(). Wed Dec 22 13:00:15 1993 David Metcalfe <david@prism.demon.co.uk> * [windows/caret.c] Implemented text caret functions. Tue Dec 21 06:13:58 1993 julliard@di.epfl.ch (Alexandre Julliard) * [loader/wine.c] Bug fix in LoadImage(). * [objects/bitblt.c] [objects/clipping.c] [objects/text.c] [windows/dc.c] [windows/dce.c] [windows/graphics.c] Modified graphics calls to take into account the DC origin. * [windows/defwnd.c] Added preliminary WM_NCCALCSIZE handling. * [windows/event.c] Send WM_NCCALCSIZE message on resize event. * [windows/win.c] Send WM_NCCALCSIZE message in CreateWindow(). Realize widgets at creation time (should prevent problems with unrealized widgets). Dec 19, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [controls/static.c] Send mouse & keyboard message received to its parent. * [controls/scroll.c] Send keyboard message received to its parent. * [controls/listbox.c] Add Navigation keys . ListBox now use VSCROLL & HSCROLL instead of children. Alpha version of LBS_MULTIPLESEL. Alpha version of LBS_MULTICOLUMN. * [controls/combo.c] Add Navigation keys on closed ComboBox. Remove useless 'COMBOBOX_CreateComboBox' function. Mon Dec 19 20:39:34 1993 Erik Bos (erik@trashcan.hacktic.nl) * [loader/wine. LoadImage() modified to use FindFile(). * [misc/file.c] SetErrorMode added * [misc/dos_fs.c] bug fixes. Dec 13, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [memory/global.c] bug fix in GlobalGetFreeSegment : good ptr in 'g_prev'. * [sysres.dll] preliminary version of a 'glass of wine' bitmap * [windows/event.c] New function 'GetCapture'. * [controls/scroll.c] Remove useless 'SCROLLBAR_CreateScrollBar' function. * [controls/listbox.c] Remove useless 'LISTBOX_CreateListBox' function. Mon Dec 13 13:51:00 1993 David Metcalfe <david@prism.demon.co.uk> * [objects/font.c] Corrected bugs in GetCharWidth(). * [windows/event.c] Modified EVENT_key to send Windows virtual key codes for WM_KEYDOWN and WM_KEYUP messages, and a WM_CHAR message for printable characters. Wed Dec 08 19:20:00 1993 Karl Guenter Wuensch (hn324wu@unidui.uni-duisburg.de) * [windows/graphics.c] Added Polyline and Polygon Mon Dec 13 14:51:54 1993 Erik Bos (erik@trashcan.hacktic.nl) * [controls/listbox.c] ListBoxDirectory() modified to use dos_fs.c's functions to access files&|drives. Sat Dec 04 17:04:23 1993 Erik Bos (erik@trashcan.hacktic.nl) * [misc/dos_fs.c] Added FindFile() to search a file in a dos/unix style path. * [misc/file.c] New Win31 functions: OpenFile, _lcreate, _llseek, GetTempDrive, GetTempFileName, GetWindowsDirectory, GetSystemDirectory, GetDriveType. * [misc/int21.c] Modified. Wed Dec 1 16:20:45 1993 Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) * [misc/profile.c] The Profile functions now return the correct values. They now implement all the features described in the SDK. Tue Nov 30 13:55:27 1993 Bob Amstadt (bob at amscons) * [loader/selector.c] Rewrote selector aliasing routines to use System V IPC routine to alias memory segments. Nov 28, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [controls/listbox.c] More consistency in functions using wIndexes * [controls/scroll.c] New function : ShowScrollBar(). * [loader/cursor.c] ... New file Move cursor functions from [loader/resource.c]. New function : ClipCursor(). New function : GetClipCursor(). New function : CreateCursor(). SetCursor() now working using gloabal variable 'winHasCursor'. *[object/palette.c] New stub only : SelectPalette(). New stub only : RealizePalette(). *[win/event.c] New function : EVENT_enter_notify(), update 'winHasCursor' and send WM_SETCURSOR. *[win/defwnd.c] Add processing of WM_SETCURSOR message. *[win/win.c] New members in WND structure : hCursor, hWndVScroll & hWndHScroll. CreateWindowEx() now create children for WM_HSCROLL & WM_VSCROLL. New function ClientToScreen(). New function ScreenToClient(). Mon Nov 25 18:25:40 1993 Erik Bos (erik@trashcan.hacktic.nl) * [files.h / regfunc.h / misc/dos.c] Removed. * [misc/dos_fs.c] Added support for loading dosdrive cfg from wine.ini. * [misc/int21.c] Modified. Wed Nov 24 11:37:33 1993 julliard@disuns2.epfl.ch (Alexandre Julliard) * [include/atom.h] [memory/atom.c] Implemented atoms. * [windows/class.c] Modified RegisterClass() to use atoms. Implemented CS_GLOBALCLASS style. * [windows/message.c] Implemented RegisterWindowMessage(). * [loader/resource.c] Bug fix in LoadResource(). * [windows/dialog.c] Modified CreateDialogParam() to use Find/LoadResource().
parent e399fc36
Sun Jan 2 12:38:53 1994 David Metcalfe <david@prism.demon.co.uk>
* [windows/class.c]
Implemented GetClassName and GetClassInfo.
* [windows/caret.c]
Various improvements to text caret code.
Fri Dec 31 15:22:22 1993 John Brezak <brezak@apollo.hp.com>
* [misc/comm.c]
Patches to work with NetBSD.
Thu Dec 30 12:11:55 1993 John Richardson <jrichard@cs.uml.edu>
* [objects/bitblt.c] Added StretchBlt().
Tue Jan 4 05:22:07 1994 julliard@di.epfl.ch (Alexandre Julliard)
* [misc/user.c]
Added creation of system message queue.
* [objects/bitmap.c] [objects/dcvalues.c] [windows/dc.c]
Added DC size fields into DC structure.
* [objects/clipping.c]
Bug fix in CLIPPING_IntersectRect().
* [windows/class.c]
Allocate a DCE instead of a DC for CS_CLASSDC classes.
* [windows/clipping.c]
Fixed GetUpdateRect() and GetUpdateRgn() to clip to the client area.
* [windows/dce.c]
Implemented GetDCEx() and GetWindowDC().
* [windows/defwnd.c]
Implemented WM_WINDOWPOSCHANGED handling.
* [windows/event.c]
Preliminary support for Xlib event handling instead of Xt callbacks.
Changed MSG_AddMsg() calls to hardware_event() or PostMessage().
* [windows/message.c]
Preliminary support for multiple message queues.
Implemented hardware_event() to store messages into the system queue.
Implemented Get/SetTaskQueue().
Better WM_PAINT and WM_TIMER handling.
Changes to use Xlib instead of Xt for events.
* [windows/painting.c]
Use GetDCEx() to retrieve the DC, to get a correct visible region.
* [windows/timer.c]
Moved the timer procedure callback into DispatchMessage().
Changed implementation to get rid of Xt timeouts. Timer checking
is now done inside GetMessage().
* [windows/win.c]
Allocate a DCE instead of a DC for CS_OWNDC windows.
Replaced Xt calls with Xlib calls.
Moved window positioning functions into windows/winpos.c
* [windows/winpos.c] (New file)
Rewritten most of the window positioning functions.
Implemented SetWindowPos() and MapWindowPoints().
Jan 3, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [if1632/user.spec]
Bad arguments description for function SetDlgItemText.
* [objects/text.c]
Function DrawText now handle DT_CALCRECT request.
* [misc/message.c]
Message boxes now use DrawText with DT_CALCRECT.
* [windows/graphics.c]
Bug fix in function FrameRect, (it was using PEN instead of BRUSH).
* [windows/win.c]
Bug fix for flags in function ShowWindow.
More accurate WM_SIZE generated by function ShowWindow.
* [controls/listbox.c]
More code for LBS_MULTIPLESEL.
More code for LBS_MULTICOLUMN.
* [include/windows.h]
Bad define for MF_SEPARATOR.
* [controls/menu.c]
New functions: PopMenuWndProc() with 'glues',
CreatePopupMenu(), AppendMenu(), InsertMenu(), RemoveMenu(),
DeleteMenu(), ModifyMenu(), TrackPopupMenu().
Code in stubs: CreateMenu(), DestroyMenu().
Sat Jan 1 10:22:43 1994 Bob Amstadt (bob@pooh)
* loader/wine.c: Added support for relocation types 5 and 6.
----------------------------------------------------------------------
Mon Dec 27 11:06:03 1993 Erik Bos (erik@trashcan.hacktic.nl)
* [misc/comm.c]
new functions: BuildCommDCB(), OpenComm(), CloseComm(),
SetCommBreak(), ClearCommBreak(), EscapeCommFunction(), FlushComm(),
GetCommError(), SetCommEventMask(), GetCommEventMask(),
SetCommState(), GetCommState(), TransmitCommChar(), ReadComm(),
WriteComm().
Wed Dec 22 13:00:15 1993 David Metcalfe <david@prism.demon.co.uk>
* [windows/caret.c]
Implemented text caret functions.
Tue Dec 21 06:13:58 1993 julliard@di.epfl.ch (Alexandre Julliard)
* [loader/wine.c]
Bug fix in LoadImage().
* [objects/bitblt.c] [objects/clipping.c] [objects/text.c]
[windows/dc.c] [windows/dce.c] [windows/graphics.c]
Modified graphics calls to take into account the DC origin.
* [windows/defwnd.c]
Added preliminary WM_NCCALCSIZE handling.
* [windows/event.c]
Send WM_NCCALCSIZE message on resize event.
* [windows/win.c]
Send WM_NCCALCSIZE message in CreateWindow().
Realize widgets at creation time (should prevent problems with
unrealized widgets).
Dec 19, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/static.c]
Send mouse & keyboard message received to its parent.
* [controls/scroll.c]
Send keyboard message received to its parent.
* [controls/listbox.c]
Add Navigation keys .
ListBox now use VSCROLL & HSCROLL instead of children.
Alpha version of LBS_MULTIPLESEL.
Alpha version of LBS_MULTICOLUMN.
* [controls/combo.c]
Add Navigation keys on closed ComboBox.
Remove useless 'COMBOBOX_CreateComboBox' function.
Mon Dec 19 20:39:34 1993 Erik Bos (erik@trashcan.hacktic.nl)
* [loader/wine.
LoadImage() modified to use FindFile().
* [misc/file.c]
SetErrorMode added
* [misc/dos_fs.c]
bug fixes.
Dec 13, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [memory/global.c]
bug fix in GlobalGetFreeSegment : good ptr in 'g_prev'.
* [sysres.dll]
preliminary version of a 'glass of wine' bitmap
* [windows/event.c]
New function 'GetCapture'.
* [controls/scroll.c]
Remove useless 'SCROLLBAR_CreateScrollBar' function.
* [controls/listbox.c]
Remove useless 'LISTBOX_CreateListBox' function.
Mon Dec 13 13:51:00 1993 David Metcalfe <david@prism.demon.co.uk>
* [objects/font.c]
Corrected bugs in GetCharWidth().
* [windows/event.c]
Modified EVENT_key to send Windows virtual key codes for
WM_KEYDOWN and WM_KEYUP messages, and a WM_CHAR message
for printable characters.
Wed Dec 08 19:20:00 1993 Karl Guenter Wuensch (hn324wu@unidui.uni-duisburg.de)
* [windows/graphics.c]
Added Polyline and Polygon
Mon Dec 13 14:51:54 1993 Erik Bos (erik@trashcan.hacktic.nl)
* [controls/listbox.c]
ListBoxDirectory() modified to use dos_fs.c's functions to
access files&|drives.
Sat Dec 04 17:04:23 1993 Erik Bos (erik@trashcan.hacktic.nl)
* [misc/dos_fs.c]
Added FindFile() to search a file in a dos/unix style path.
* [misc/file.c]
New Win31 functions: OpenFile, _lcreate, _llseek, GetTempDrive,
GetTempFileName, GetWindowsDirectory, GetSystemDirectory,
GetDriveType.
* [misc/int21.c]
Modified.
Wed Dec 1 16:20:45 1993 Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx)
* [misc/profile.c]
The Profile functions now return the correct values. They now
implement all the features described in the SDK.
Tue Nov 30 13:55:27 1993 Bob Amstadt (bob at amscons)
* [loader/selector.c]
Rewrote selector aliasing routines to use System V IPC
routine to alias memory segments.
Nov 28, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/listbox.c]
More consistency in functions using wIndexes
* [controls/scroll.c]
New function : ShowScrollBar().
* [loader/cursor.c] ... New file
Move cursor functions from [loader/resource.c].
New function : ClipCursor().
New function : GetClipCursor().
New function : CreateCursor().
SetCursor() now working using gloabal variable 'winHasCursor'.
*[object/palette.c]
New stub only : SelectPalette().
New stub only : RealizePalette().
*[win/event.c]
New function : EVENT_enter_notify(),
update 'winHasCursor' and send WM_SETCURSOR.
*[win/defwnd.c]
Add processing of WM_SETCURSOR message.
*[win/win.c]
New members in WND structure : hCursor, hWndVScroll & hWndHScroll.
CreateWindowEx() now create children for WM_HSCROLL & WM_VSCROLL.
New function ClientToScreen().
New function ScreenToClient().
Mon Nov 25 18:25:40 1993 Erik Bos (erik@trashcan.hacktic.nl)
* [files.h / regfunc.h / misc/dos.c]
Removed.
* [misc/dos_fs.c]
Added support for loading dosdrive cfg from wine.ini.
* [misc/int21.c]
Modified.
Wed Nov 24 11:37:33 1993 julliard@disuns2.epfl.ch (Alexandre Julliard)
* [include/atom.h] [memory/atom.c]
Implemented atoms.
* [windows/class.c]
Modified RegisterClass() to use atoms.
Implemented CS_GLOBALCLASS style.
* [windows/message.c]
Implemented RegisterWindowMessage().
* [loader/resource.c]
Bug fix in LoadResource().
* [windows/dialog.c]
Modified CreateDialogParam() to use Find/LoadResource().
Mon Nov 22 13:58:56 1993 David Metcalfe <david@prism.demon.co.uk> Mon Nov 22 13:58:56 1993 David Metcalfe <david@prism.demon.co.uk>
* [windows/scroll.c] * [windows/scroll.c]
...@@ -37,7 +329,6 @@ Nov 21, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) ...@@ -37,7 +329,6 @@ Nov 21, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [sysres.dll] * [sysres.dll]
Resources only 16bits DLL for System Resources, icons, etc... Resources only 16bits DLL for System Resources, icons, etc...
----------------------------------------------------------------------
Sun Nov 14 14:39:06 1993 julliard@di.epfl.ch (Alexandre Julliard) Sun Nov 14 14:39:06 1993 julliard@di.epfl.ch (Alexandre Julliard)
* [include/dialog.h] [windows/dialog.c] * [include/dialog.h] [windows/dialog.c]
......
#include "Wine.tmpl"
/*
* This is the first try at using Imakefiles. There are probably many
* problems and things I haven't even considered. I do not have a Linux
* system to test them on, just NetBSD, so you may need to change things
* like the the SYSLIBS definition below...
*
* Peter Galbavy, 5th Dec 1993 peter@wonderland.org
*/
#define IHaveSubDirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)'
SUBDIRS = \
tools \
controls \
debugger \
etc \
if1632 \
include \
loader \
memory \
misc \
objects \
test \
windows
WINEDIR = $(LIBDIR)/wine
OBJS = \
if1632.o \
controls.o \
loader.o \
memory.o \
misc.o \
objects.o \
windows.o \
debugger.o \
readline.o
#ifdef i386BsdArchitecture
SYSLIBS = -ll -lm -li386 -lgnumalloc
#else
#ifdef LinuxArchitechture
SYSLIBS = -lm
#endif
#endif
AllTarget(wine)
NamedTargetSubdirs($(OBJS),$(SUBDIRS),"making",PassCDebugFlags,all)
MakefileSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
IncludesSubdirs($(SUBDIRS))
CleanSubdirs($(SUBDIRS))
NormalProgramTarget(wine,$(OBJS),XawClientDepLibs,XawClientLibs,$(SYSLIBS))
depend::
install::
includes::
clean::
All code unless stated otherwise is covered by the GNU Pubic License.
###################################################################### ######################################################################
# These variables are inherited by the sub-makefiles # These variables are inherited by the sub-makefiles
DEBUGOPTS= DEBUGOPTS=-DUSE_XLIB
COPTS=-O2 -m486 COPTS=-O2 -m486
INCLUDE_DIR=include INCLUDE_DIR=include
LDFLAGS= LDFLAGS=
...@@ -12,11 +12,17 @@ LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm ...@@ -12,11 +12,17 @@ LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm
OBJS=if1632/if1632.o controls/controls.o loader/loader.o \ OBJS=if1632/if1632.o controls/controls.o loader/loader.o \
memory/memory.o misc/misc.o objects/objects.o windows/windows.o debugger/debugger.o memory/memory.o misc/misc.o objects/objects.o windows/windows.o debugger/debugger.o
SUBDIRS=if1632 controls loader memory misc objects windows debugger SUBDIRS=if1632 controls loader memory misc objects windows debugger
TAGFILES=if1632/{*.c,*.S} controls/{*.c,*.S} loader/{*.c,*.S} \
memory/{*.c,*.S} misc/{*.c,*.S} objects/{*.c,*.S} \
windows/{*.c,*.S} debugger/{*.c,*.S}
all: $(TARGET) all: $(TARGET)
dummy: dummy:
tags:
etags $(TAGFILES)
clean: clean:
rm -f *~ *.o *# rm -f *~ *.o *#
@for i in tools $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done @for i in tools $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done
......
You may without charge, royalty or other payment, copy and
distribute copies of this work and derivative works of this work
in source or binary form provided that: (1)
you appropriately publish on each copy an appropriate copyright
notice; (2) faithfully reproduce all prior copyright notices
included in the original work (you may also add your own
copyright notice); and (3) agree to indemnify and hold all prior
authors, copyright holders and licensors of the work harmless
from and against all damages arising from use of the work.
You may distribute sources of derivative works of the work
provided that (1) (a) all source files of the original work that
have been modified, (b) all source files of the derivative work
that contain any party of the original work, and (c) all source
files of the derivative work that are necessary to compile, link
and run the derivative work without unresolved external calls and
with the same functionality of the original work ("Necessary
Sources") carry a prominent notice explaining the nature and date
of the modification and/or creation. You are encouraged to make
the Necessary Sources available under this license in order to
further the development and acceptance of the work.
EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED
WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND, INCLUDING
BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY OR TITLE. EXCEPT AS
OTHERWISE PROVIDED BY LAW, NO AUTHOR, COPYRIGHT HOLDER OR
LICENSOR SHALL BE LIABLE TO YOU FOR DAMAGES OF ANY KIND, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Copyright Robert J. Amstadt, 1993. All code is provided without Copyright Robert J. Amstadt, 1993. All code is provided without
warranty. It is my intent to cover this code with the Gnu Public warranty. All code is covered by the license contained in the file
License. LICENSE unless explicitly stated in the individual source file.
INSTALLATION: INSTALLATION:
...@@ -19,18 +19,56 @@ All: ...@@ -19,18 +19,56 @@ All:
To build Wine, first do a "make depend" and then a "make". The To build Wine, first do a "make depend" and then a "make". The
executable "wine" will be built. "wine" will load and run Windows' executable "wine" will be built. "wine" will load and run Windows'
executables. You must specify the entire path to the executable, executables. You must have a file "wine.ini" in the current directory,
have the executable in the current directory, or specify a load your homedirectory, or in the path specified by the environment
path with environment variable WINEPATH. variable WINEPATH. Multiple directories in WINEPATH should be seperated
by semi-colons and NOT by colons!
For example, to run Windows' solitaire: You must specify the entire path to the executable, or a filename only
(using the path= statement in wine.ini as the search path)
export WINEPATH=/dos/windows;/dos/windows/system For example: to run Windows' solitaire:
wine sol
export WINEPATH=/etc;/usr/windows
wine sol (using the path= statement in wine.ini
wine sol.exe as the search path)
wine c:\\windows\\sol.exe (using a dosfilename)
wine /usr/windows/sol.exe (using a unixfilename)
Have a nice game of solitaire, but be careful. Emulation isn't perfect. Have a nice game of solitaire, but be careful. Emulation isn't perfect.
So, occassionally it will crash. So, occassionally it will crash.
WHAT'S NEW with version 0.5: (see ChangeLog for details)
- Working towards elimination of Xt-dependent code.
- StretchBlt()
- GetClassName() & GetClassInfo()
- Implemented loader relocation types 5 and 6.
WHAT'S NEW with version 0.4.14: (see ChangeLog for details)
- Bug fixes and enhancements
- Comm functions
- Text caret functions
WHAT'S NEW with version 0.4.13: (see ChangeLog for details)
- Bug fixes
- GetCapture()
- More keyboard handling
- Polyline() and Polygon()
WHAT'S NEW with version 0.4.12: (see ChangeLog for details)
- Bug fixes
- New DOS file functions
- Experimental Imakefiles
WHAT'S NEW with version 0.4.11: (see ChangeLog for details)
- Bug fixes
- New cursor functions
- New file system handling
- Atoms
WHAT'S NEW with version 0.4.10: (see ChangeLog for details) WHAT'S NEW with version 0.4.10: (see ChangeLog for details)
- Bug fixes - Bug fixes
- More scroll bar functions - More scroll bar functions
......
EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED
WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND, INCLUDING
BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY OR TITLE. EXCEPT AS
OTHERWISE PROVIDED BY LAW, NO AUTHOR, COPYRIGHT HOLDER OR
LICENSOR SHALL BE LIABLE TO YOU FOR DAMAGES OF ANY KIND, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
XCOMM $Id$
INCLUDES = -I$(TOP)/include
XCOMM Imake rules go here
XCOMM First, dll description to files etc
#ifndef MakeDllFromSpec
#define MakeDllFromSpec(name,objfile) @@\
objfile.o: Concat(dll_,name.o) Concat3(dll_,name,_tab.o) @@\
@@\
Concat(dll_,name.S) Concat3(dll_,name,_tab.c): name.spec $(TOP)/tools/build @@\
$(TOP)/tools/build name.spec @@\
#endif
/*
* WineRelocatableTarget - generate rules to produce a relocatable object
* file instead of a library.
*/
#ifndef WineRelocatableTarget
#define WineRelocatableTarget(objname,objlist,depobj) @@\
AllTarget(objname.o) @@\
@@\
objname.o: depobj @@\
$(RM) $@ @@\
$(LD) $(LDCOMBINEFLAGS) objlist depobj -o $@
#endif /* WineRelocatableTarget */
...@@ -6,7 +6,7 @@ diff -ruN ../Backup//Makefile ./Makefile ...@@ -6,7 +6,7 @@ diff -ruN ../Backup//Makefile ./Makefile
# These definitions are for the top level # These definitions are for the top level
TARGET=wine TARGET=wine
-LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm -LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm
+LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm -li386 -lgnumalloc +LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm -li386 -lgnumalloc -ll
OBJS=if1632/if1632.o controls/controls.o loader/loader.o \ OBJS=if1632/if1632.o controls/controls.o loader/loader.o \
memory/memory.o misc/misc.o objects/objects.o windows/windows.o memory/memory.o misc/misc.o objects/objects.o windows/windows.o
SUBDIRS=if1632 controls loader memory misc objects windows SUBDIRS=if1632 controls loader memory misc objects windows
......
#include "../Wine.tmpl"
MODULE = controls
SRCS = \
menu.c \
widgets.c \
button.c \
scroll.c \
listbox.c \
combo.c \
static.c \
SmeMenuButto.c \
WinLabel.c \
WinCommand.c \
WinMenuButto.c
OBJS = \
menu.o \
widgets.o \
button.o \
scroll.o \
listbox.o \
combo.o \
static.o \
SmeMenuButto.o \
WinLabel.o \
WinCommand.o \
WinMenuButto.o
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
includes::
install::
...@@ -17,60 +17,24 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993"; ...@@ -17,60 +17,24 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include "combo.h" #include "combo.h"
#include "heap.h" #include "heap.h"
#include "win.h" #include "win.h"
#include "dirent.h" #include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h> #include <sys/stat.h>
LPHEADCOMBO ComboGetStorageHeader(HWND hwnd); LPHEADCOMBO ComboGetStorageHeader(HWND hwnd);
int CreateComboStruct(HWND hwnd); int CreateComboStruct(HWND hwnd);
void COMBOBOX_CreateComboBox(LPSTR className, LPSTR comboLabel, HWND hwnd)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
WND *parentPtr = WIN_FindWndPtr(wndPtr->hwndParent);
DWORD style;
char widgetName[15];
#ifdef DEBUG_COMBO
printf("combo: label = %s, x = %d, y = %d\n", comboLabel,
wndPtr->rectClient.left, wndPtr->rectClient.top);
printf(" width = %d, height = %d\n",
wndPtr->rectClient.right - wndPtr->rectClient.left,
wndPtr->rectClient.bottom - wndPtr->rectClient.top);
#endif
if (!wndPtr)
return;
style = wndPtr->dwStyle & 0x0000FFFF;
/*
if ((style & LBS_NOTIFY) == LBS_NOTIFY)
*/
sprintf(widgetName, "%s%d", className, wndPtr->wIDmenu);
wndPtr->winWidget = XtVaCreateManagedWidget(widgetName,
compositeWidgetClass,
parentPtr->winWidget,
XtNx, wndPtr->rectClient.left,
XtNy, wndPtr->rectClient.top,
XtNwidth, wndPtr->rectClient.right -
wndPtr->rectClient.left,
XtNheight, 16,
NULL );
GlobalUnlock(hwnd);
GlobalUnlock(wndPtr->hwndParent);
}
/*********************************************************************** /***********************************************************************
* WIDGETS_ComboWndProc * ComboWndProc
*/ */
LONG COMBOBOX_ComboBoxWndProc( HWND hwnd, WORD message, LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
WORD wParam, LONG lParam )
{ {
WORD wRet; WORD wRet;
RECT rect; RECT rect;
int y; int y, count;
int width, height; int width, height;
int AltState;
WND *wndPtr; WND *wndPtr;
LPHEADCOMBO lphc; LPHEADCOMBO lphc;
char str[128]; char str[128];
...@@ -106,17 +70,20 @@ LONG COMBOBOX_ComboBoxWndProc( HWND hwnd, WORD message, ...@@ -106,17 +70,20 @@ LONG COMBOBOX_ComboBoxWndProc( HWND hwnd, WORD message,
case WM_DESTROY: case WM_DESTROY:
lphc = ComboGetStorageHeader(hwnd); lphc = ComboGetStorageHeader(hwnd);
if (lphc == 0) return 0; if (lphc == 0) return 0;
/*
DestroyWindow(lphc->hWndDrop); DestroyWindow(lphc->hWndDrop);
DestroyWindow(lphc->hWndEdit); DestroyWindow(lphc->hWndEdit);
/*
DestroyWindow(lphc->hWndLBox);
*/ */
DestroyWindow(lphc->hWndLBox);
free(lphc); free(lphc);
*((LPHEADCOMBO *)&wndPtr->wExtra[1]) = 0; /*
*((LPHEADCOMBO *)&wndPtr->wExtra[1]) = 0;
printf("Combo WM_DESTROY after clearing wExtra !\n");
*/
#ifdef DEBUG_COMBO #ifdef DEBUG_COMBO
printf("Combo WM_DESTROY %lX !\n", lphc); printf("Combo WM_DESTROY %lX !\n", lphc);
#endif #endif
return 0; return DefWindowProc( hwnd, message, wParam, lParam );
case WM_COMMAND: case WM_COMMAND:
wndPtr = WIN_FindWndPtr(hwnd); wndPtr = WIN_FindWndPtr(hwnd);
...@@ -169,9 +136,56 @@ LONG COMBOBOX_ComboBoxWndProc( HWND hwnd, WORD message, ...@@ -169,9 +136,56 @@ LONG COMBOBOX_ComboBoxWndProc( HWND hwnd, WORD message,
break; break;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
printf("Combo WM_LBUTTONDOWN wParam=%x lParam=%lX !\n", wParam, lParam); printf("Combo WM_LBUTTONDOWN wParam=%x lParam=%lX !\n", wParam, lParam);
wndPtr = WIN_FindWndPtr(hwnd);
lphc = ComboGetStorageHeader(hwnd);
lphc->dwState = lphc->dwState ^ CB_SHOWDROPDOWN;
if ((lphc->dwState & CB_SHOWDROPDOWN) == CB_SHOWDROPDOWN)
ShowWindow(lphc->hWndLBox, SW_SHOW);
break; break;
case WM_KEYDOWN: case WM_KEYDOWN:
printf("Combo WM_KEYDOWN wParam %X!\n", wParam); wndPtr = WIN_FindWndPtr(hwnd);
lphc = ComboGetStorageHeader(hwnd);
y = SendMessage(lphc->hWndLBox, LB_GETCURSEL, 0, 0L);
count = SendMessage(lphc->hWndLBox, LB_GETCOUNT, 0, 0L);
printf("COMBOBOX // GetKeyState(VK_MENU)=%d\n", GetKeyState(VK_MENU));
if (GetKeyState(VK_MENU) < 0) {
lphc->dwState = lphc->dwState ^ CB_SHOWDROPDOWN;
if ((lphc->dwState & CB_SHOWDROPDOWN) == CB_SHOWDROPDOWN) {
ShowWindow(lphc->hWndLBox, SW_SHOW);
}
else {
ShowWindow(lphc->hWndLBox, SW_HIDE);
y = SendMessage(lphc->hWndLBox, LB_GETCURSEL, 0, 0L);
if (y != LB_ERR) {
SendMessage(lphc->hWndLBox, LB_GETTEXT, (WORD)y, (LPARAM)str);
SendMessage(lphc->hWndEdit, WM_SETTEXT, (WORD)y, (LPARAM)str);
}
}
}
else
{
switch(wParam) {
case VK_HOME:
y = 0;
break;
case VK_END:
y = count - 1;
break;
case VK_UP:
y--;
break;
case VK_DOWN:
y++;
break;
}
if (y < 0) y = 0;
if (y >= count) y = count - 1;
SendMessage(lphc->hWndLBox, LB_SETCURSEL, y, 0L);
SendMessage(lphc->hWndLBox, LB_GETTEXT, (WORD)y, (LPARAM)str);
SendMessage(lphc->hWndEdit, WM_SETTEXT, (WORD)y, (LPARAM)str);
SendMessage(GetParent(hwnd), WM_COMMAND, wndPtr->wIDmenu,
MAKELONG(hwnd, CBN_SELCHANGE));
}
break; break;
case WM_CTLCOLOR: case WM_CTLCOLOR:
return(SendMessage(GetParent(hwnd), WM_CTLCOLOR, wParam, lParam)); return(SendMessage(GetParent(hwnd), WM_CTLCOLOR, wParam, lParam));
......
...@@ -17,7 +17,8 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993"; ...@@ -17,7 +17,8 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include "scroll.h" #include "scroll.h"
#include "heap.h" #include "heap.h"
#include "win.h" #include "win.h"
#include "dirent.h" #include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h> #include <sys/stat.h>
LPHEADSCROLL ScrollBarGetWindowAndStorage(HWND hwnd, WND **wndPtr); LPHEADSCROLL ScrollBarGetWindowAndStorage(HWND hwnd, WND **wndPtr);
...@@ -26,50 +27,10 @@ void StdDrawScrollBar(HWND hwnd); ...@@ -26,50 +27,10 @@ void StdDrawScrollBar(HWND hwnd);
int CreateScrollBarStruct(HWND hwnd); int CreateScrollBarStruct(HWND hwnd);
void SCROLLBAR_CreateScrollBar(LPSTR className, LPSTR scrollLabel, HWND hwnd)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
WND *parentPtr = WIN_FindWndPtr(wndPtr->hwndParent);
DWORD style;
char widgetName[15];
#ifdef DEBUG_SCROLLBAR
printf("scroll: label = %s, x = %d, y = %d\n", scrollLabel,
wndPtr->rectClient.left, wndPtr->rectClient.top);
printf(" width = %d, height = %d\n",
wndPtr->rectClient.right - wndPtr->rectClient.left,
wndPtr->rectClient.bottom - wndPtr->rectClient.top);
#endif
if (!wndPtr)
return;
style = wndPtr->dwStyle & 0x0000FFFF;
/*
if ((style & SBS_NOTIFY) == SBS_NOTIFY)
*/
sprintf(widgetName, "%s%d", className, wndPtr->wIDmenu);
wndPtr->winWidget = XtVaCreateManagedWidget(widgetName,
compositeWidgetClass,
parentPtr->winWidget,
XtNx, wndPtr->rectClient.left,
XtNy, wndPtr->rectClient.top,
XtNwidth, wndPtr->rectClient.right -
wndPtr->rectClient.left,
XtNheight, wndPtr->rectClient.bottom -
wndPtr->rectClient.top,
NULL );
GlobalUnlock(hwnd);
GlobalUnlock(wndPtr->hwndParent);
}
/*********************************************************************** /***********************************************************************
* WIDGETS_ScrollBarWndProc * WIDGETS_ScrollBarWndProc
*/ */
LONG SCROLLBAR_ScrollBarWndProc( HWND hwnd, WORD message, LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
WORD wParam, LONG lParam )
{ {
WORD wRet; WORD wRet;
short x, y; short x, y;
...@@ -169,8 +130,11 @@ LONG SCROLLBAR_ScrollBarWndProc( HWND hwnd, WORD message, ...@@ -169,8 +130,11 @@ LONG SCROLLBAR_ScrollBarWndProc( HWND hwnd, WORD message,
break; break;
case WM_KEYDOWN: case WM_KEYDOWN:
printf("ScrollBar WM_KEYDOWN wParam %X !\n", wParam); case WM_KEYUP:
break; case WM_CHAR:
lphs = ScrollBarGetWindowAndStorage(hwnd, &wndPtr);
return(SendMessage(wndPtr->hwndParent, message, wParam, lParam));
case WM_PAINT: case WM_PAINT:
StdDrawScrollBar(hwnd); StdDrawScrollBar(hwnd);
break; break;
...@@ -330,36 +294,36 @@ int CreateScrollBarStruct(HWND hwnd) ...@@ -330,36 +294,36 @@ int CreateScrollBarStruct(HWND hwnd)
wndPtr->hInstance, 0L); wndPtr->hInstance, 0L);
} }
if (lphs->MaxPix < 1) lphs->MaxPix = 1; if (lphs->MaxPix < 1) lphs->MaxPix = 1;
if (wndPtr->hCursor == (HCURSOR)NULL)
wndPtr->hCursor = LoadCursor((HINSTANCE)NULL, IDC_ARROW);
return TRUE; return TRUE;
} }
/*************************************************************************
int GetScrollPos(HWND hwnd, int nBar) * GetScrollWindowHandle
{ */
LPHEADSCROLL lphs; HWND GetScrollWindowHandle(HWND hWnd, int nBar)
lphs = ScrollBarGetStorageHeader(hwnd);
if (lphs == NULL) return 0;
return lphs->CurVal;
}
void GetScrollRange(HWND hwnd, int nBar, LPINT lpMin, LPINT lpMax)
{ {
LPHEADSCROLL lphs; WND *wndPtr;
lphs = ScrollBarGetStorageHeader(hwnd); if (nBar != SB_CTL) {
if (lphs == NULL) return; wndPtr = WIN_FindWndPtr(hWnd);
*lpMin = lphs->MinVal; if (nBar == SB_VERT) return wndPtr->hWndVScroll;
*lpMax = lphs->MaxVal; if (nBar == SB_HORZ) return wndPtr->hWndHScroll;
return (HWND)NULL;
}
return hWnd;
} }
/*************************************************************************
* SetScrollPos [USER.62]
*/
int SetScrollPos(HWND hwnd, int nBar, int nPos, BOOL bRedraw) int SetScrollPos(HWND hwnd, int nBar, int nPos, BOOL bRedraw)
{ {
int nRet; int nRet;
LPHEADSCROLL lphs; LPHEADSCROLL lphs;
hwnd = GetScrollWindowHandle(hwnd, nBar);
lphs = ScrollBarGetStorageHeader(hwnd); lphs = ScrollBarGetStorageHeader(hwnd);
if (lphs == NULL) return 0; if (lphs == NULL) return 0;
nRet = lphs->CurVal; nRet = lphs->CurVal;
...@@ -383,9 +347,27 @@ int SetScrollPos(HWND hwnd, int nBar, int nPos, BOOL bRedraw) ...@@ -383,9 +347,27 @@ int SetScrollPos(HWND hwnd, int nBar, int nPos, BOOL bRedraw)
/*************************************************************************
* GetScrollPos [USER.63]
*/
int GetScrollPos(HWND hwnd, int nBar)
{
LPHEADSCROLL lphs;
hwnd = GetScrollWindowHandle(hwnd, nBar);
lphs = ScrollBarGetStorageHeader(hwnd);
if (lphs == NULL) return 0;
return lphs->CurVal;
}
/*************************************************************************
* SetScrollRange [USER.64]
*/
void SetScrollRange(HWND hwnd, int nBar, int MinPos, int MaxPos, BOOL bRedraw) void SetScrollRange(HWND hwnd, int nBar, int MinPos, int MaxPos, BOOL bRedraw)
{ {
LPHEADSCROLL lphs; LPHEADSCROLL lphs;
hwnd = GetScrollWindowHandle(hwnd, nBar);
lphs = ScrollBarGetStorageHeader(hwnd); lphs = ScrollBarGetStorageHeader(hwnd);
if (lphs == NULL) return; if (lphs == NULL) return;
lphs->MinVal = (short)MinPos; lphs->MinVal = (short)MinPos;
...@@ -406,5 +388,50 @@ void SetScrollRange(HWND hwnd, int nBar, int MinPos, int MaxPos, BOOL bRedraw) ...@@ -406,5 +388,50 @@ void SetScrollRange(HWND hwnd, int nBar, int MinPos, int MaxPos, BOOL bRedraw)
/*************************************************************************
* GetScrollRange [USER.65]
*/
void GetScrollRange(HWND hwnd, int nBar, LPINT lpMin, LPINT lpMax)
{
LPHEADSCROLL lphs;
hwnd = GetScrollWindowHandle(hwnd, nBar);
lphs = ScrollBarGetStorageHeader(hwnd);
if (lphs == NULL) return;
*lpMin = lphs->MinVal;
*lpMax = lphs->MaxVal;
}
/*************************************************************************
* ShowScrollBar [USER.267]
*/
void ShowScrollBar(HWND hWnd, WORD wBar, BOOL bFlag)
{
WND *wndPtr;
#ifdef DEBUG_SCROLL
printf("ShowScrollBar hWnd=%04X wBar=%d bFlag=%d\n", hWnd, wBar, bFlag);
#endif
if (wBar == SB_CTL) {
if (bFlag)
ShowWindow(hWnd, SW_SHOW);
else
ShowWindow(hWnd, SW_HIDE);
return;
}
wndPtr = WIN_FindWndPtr(hWnd);
if ((wBar == SB_VERT) || (wBar == SB_BOTH)) {
if (bFlag)
ShowWindow(wndPtr->hWndVScroll, SW_SHOW);
else
ShowWindow(wndPtr->hWndVScroll, SW_HIDE);
}
if ((wBar == SB_HORZ) || (wBar == SB_BOTH)) {
if (bFlag)
ShowWindow(wndPtr->hWndHScroll, SW_SHOW);
else
ShowWindow(wndPtr->hWndHScroll, SW_HIDE);
}
}
...@@ -109,6 +109,18 @@ LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam) ...@@ -109,6 +109,18 @@ LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
InvalidateRect(hWnd, NULL, TRUE); InvalidateRect(hWnd, NULL, TRUE);
break; break;
case WM_KEYDOWN:
case WM_KEYUP:
case WM_CHAR:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
return(SendMessage(wndPtr->hwndParent, uMsg, wParam, lParam));
default: default:
lResult = DefWindowProc(hWnd, uMsg, wParam, lParam); lResult = DefWindowProc(hWnd, uMsg, wParam, lParam);
break; break;
......
...@@ -13,23 +13,28 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; ...@@ -13,23 +13,28 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
LONG ButtonWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ); LONG ButtonWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG StaticWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ); LONG StaticWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG SCROLLBAR_ScrollBarWndProc( HWND hwnd, WORD message, LONG ListBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
WORD wParam, LONG lParam ); LONG ComboBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG LISTBOX_ListBoxWndProc( HWND hwnd, WORD message, LONG PopupMenuWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
WORD wParam, LONG lParam );
LONG COMBOBOX_ComboBoxWndProc( HWND hwnd, WORD message,
WORD wParam, LONG lParam );
static WNDCLASS WIDGETS_BuiltinClasses[] = static WNDCLASS WIDGETS_BuiltinClasses[] =
{ {
{ 0, (LONG(*)())ButtonWndProc, 0, 2, 0, 0, 0, 0, NULL, "BUTTON" }, { CS_GLOBALCLASS, (LONG(*)())ButtonWndProc, 0, 2,
{ 0, (LONG(*)())StaticWndProc, 0, 0, 0, 0, 0, 0, NULL, "STATIC" }, 0, 0, 0, 0, NULL, "BUTTON" },
{ 0, (LONG(*)())SCROLLBAR_ScrollBarWndProc, 0, 8, 0, 0, 0, 0, NULL, "SCROLLBAR" }, { CS_GLOBALCLASS, (LONG(*)())StaticWndProc, 0, 0,
{ 0, (LONG(*)())LISTBOX_ListBoxWndProc, 0, 8, 0, 0, 0, 0, NULL, "LISTBOX" }, 0, 0, 0, 0, NULL, "STATIC" },
{ 0, (LONG(*)())COMBOBOX_ComboBoxWndProc, 0, 8, 0, 0, 0, 0, NULL, "COMBOBOX" }, { CS_GLOBALCLASS, (LONG(*)())ScrollBarWndProc, 0, 8,
{ 0, (LONG(*)())DefDlgProc, 0, DLGWINDOWEXTRA, 0, 0, 0, 0, NULL, DIALOG_CLASS_NAME } 0, 0, 0, 0, NULL, "SCROLLBAR" },
{ CS_GLOBALCLASS, (LONG(*)())ListBoxWndProc, 0, 8,
0, 0, 0, 0, NULL, "LISTBOX" },
{ CS_GLOBALCLASS, (LONG(*)())ComboBoxWndProc, 0, 8,
0, 0, 0, 0, NULL, "COMBOBOX" },
{ CS_GLOBALCLASS, (LONG(*)())PopupMenuWndProc, 0, 8,
0, 0, 0, 0, NULL, "POPUPMENU" },
{ CS_GLOBALCLASS, (LONG(*)())DefDlgProc, 0, DLGWINDOWEXTRA,
0, 0, 0, 0, NULL, DIALOG_CLASS_NAME }
}; };
#define NB_BUILTIN_CLASSES \ #define NB_BUILTIN_CLASSES \
......
#include "../Wine.tmpl"
#define IHavSubDirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)'
MODULE = debugger
DEFINES = -DUSE_READLINE
SUBDIRS = readline
/* Quick and dirt hack, since i386 is defined as 1. sigh */
#define temp i386
#undef i386
SRCS = \
dbg.tab.c \
hash.c \
lex.yy.c \
info.c \
i386-pinsn.c
OBJS = \
dbg.tab.o \
hash.o \
lex.yy.o \
info.o \
i386-pinsn.o
#define i386 temp
#undef temp
/*
* All the SUBDIR stuff
*/
MakeSubdirs($(SUBDIRS))
MakefileSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
CleanSubdirs($(SUBDIRS))
IncludesSubdirs($(SUBDIRS))
/*
* The main act
*/
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
depend:: dbg.tab.c dbg.tab.h lex.yy.c
DependTarget()
includes::
install::
clean::
$(RM) lex.yy.c dbg.tab* y.tab.c
dbg.tab.c dbg.tab.h: dbg.y
$(YACC) -b dbg -d dbg.y
lex.yy.c: debug.l
$(LEX) -I debug.l
#include "../../Wine.tmpl"
MODULE = readline
YACC = yacc -b dbg -d
DEFINES = -DANSI_ARROWS -DHAVE_TCGETATTR -DHIDE -DUSE_DIRENT -DSYS_UNIX
SRCS = \
complete.c \
editline.c \
sysunix.c
OBJS = \
complete.o \
editline.o \
sysunix.o
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
includes::
install::
#include "../Wine.tmpl"
MODULE = etc
AllTarget()
depend::
CleanTarget()
includes::
This diff is collapsed. Click to expand it.
#include "../Wine.tmpl"
MODULE = if1632
SRCS = \
call.S \
callback.c \
relay.c
OBJS = \
call.o \
callback.o \
relay.o
/*
* If you add a new spec file, copy one of these lines
*/
MakeDllFromSpec(gdi,$(TOP)/$(MODULE))
MakeDllFromSpec(kernel,$(TOP)/$(MODULE))
MakeDllFromSpec(keyboard,$(TOP)/$(MODULE))
MakeDllFromSpec(shell,$(TOP)/$(MODULE))
MakeDllFromSpec(sound,$(TOP)/$(MODULE))
MakeDllFromSpec(unixlib,$(TOP)/$(MODULE))
MakeDllFromSpec(user,$(TOP)/$(MODULE))
MakeDllFromSpec(win87em,$(TOP)/$(MODULE))
/*
* Yes I know *.o is not veru clever, but can you do it cleaner ?
*/
WineRelocatableTarget($(TOP)/$(MODULE),*.o,$(OBJS))
clean::
$(RM) dll*
depend::
includes::
...@@ -7,7 +7,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; ...@@ -7,7 +7,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "segmem.h" #include "segmem.h"
#include <setjmp.h> #include <setjmp.h>
extern unsigned short SelectorOwners[]; extern SEGDESC Segments[];
extern unsigned short IF1632_Saved16_ss; extern unsigned short IF1632_Saved16_ss;
extern unsigned long IF1632_Saved16_ebp; extern unsigned long IF1632_Saved16_ebp;
extern unsigned long IF1632_Saved16_esp; extern unsigned long IF1632_Saved16_esp;
...@@ -56,7 +56,7 @@ FindDataSegmentForCode(unsigned long csip) ...@@ -56,7 +56,7 @@ FindDataSegmentForCode(unsigned long csip)
unsigned int seg_idx; unsigned int seg_idx;
seg_idx = (unsigned short) (csip >> 19); seg_idx = (unsigned short) (csip >> 19);
return SelectorOwners[seg_idx]; return Segments[seg_idx].owner;
} }
/********************************************************************** /**********************************************************************
......
...@@ -43,6 +43,11 @@ length 490 ...@@ -43,6 +43,11 @@ length 490
33 pascal TextOut(word s_word s_word ptr word) TextOut(1 2 3 4 5) 33 pascal TextOut(word s_word s_word ptr word) TextOut(1 2 3 4 5)
34 pascal BitBlt( word s_word s_word s_word s_word word s_word s_word long) 34 pascal BitBlt( word s_word s_word s_word s_word word s_word s_word long)
BitBlt(1 2 3 4 5 6 7 8 9) BitBlt(1 2 3 4 5 6 7 8 9)
35 pascal StrechBlt( word s_word s_word s_word s_word word s_word s_word s_word s_word long)
StrechBlt(1 2 3 4 5 6 7 8 9 10 11)
36 pascal Polygon (word ptr word) Polygon (1 2 3)
37 pascal Polyline (word ptr word) Polyline (1 2 3)
39 pascal RestoreDC(word s_word) RestoreDC(1 2) 39 pascal RestoreDC(word s_word) RestoreDC(1 2)
40 pascal FillRgn(word word word) FillRgn(1 2 3) 40 pascal FillRgn(word word word) FillRgn(1 2 3)
43 pascal PaintRgn(word word) PaintRgn(1 2) 43 pascal PaintRgn(word word) PaintRgn(1 2)
......
...@@ -28,6 +28,8 @@ length 415 ...@@ -28,6 +28,8 @@ length 415
24 pascal UnlockSegment(s_word) KERNEL_UnlockSegment(1) 24 pascal UnlockSegment(s_word) KERNEL_UnlockSegment(1)
25 pascal GlobalCompact(long) GlobalCompact(1) 25 pascal GlobalCompact(long) GlobalCompact(1)
30 pascal WaitEvent(word) KERNEL_WaitEvent(1) 30 pascal WaitEvent(word) KERNEL_WaitEvent(1)
34 pascal SetTaskQueue(word word) SetTaskQueue(1 2)
35 pascal GetTaskQueue(word) GetTaskQueue(1)
49 pascal GetModuleFileName(word ptr s_word) KERNEL_GetModuleFileName(1 2 3) 49 pascal GetModuleFileName(word ptr s_word) KERNEL_GetModuleFileName(1 2 3)
50 pascal GetProcAddress(word ptr) GetProcAddress(1 2) 50 pascal GetProcAddress(word ptr) GetProcAddress(1 2)
51 pascal MakeProcInstance(ptr word) CALLBACK_MakeProcInstance(1 2) 51 pascal MakeProcInstance(ptr word) CALLBACK_MakeProcInstance(1 2)
...@@ -43,6 +45,8 @@ length 415 ...@@ -43,6 +45,8 @@ length 415
74 pascal OpenFile(ptr ptr word) KERNEL_OpenFile(1 2 3) 74 pascal OpenFile(ptr ptr word) KERNEL_OpenFile(1 2 3)
81 pascal _lclose(word) KERNEL__lclose(1) 81 pascal _lclose(word) KERNEL__lclose(1)
82 pascal _lread(word ptr word) KERNEL__lread(1 2 3) 82 pascal _lread(word ptr word) KERNEL__lread(1 2 3)
83 pascal _lcreate(ptr word) KERNEL__lcreate(1 2)
84 pascal _llseek(word long word) KERNEL__llseek(1 2 3)
85 pascal _lopen(ptr word) KERNEL__lopen(1 2) 85 pascal _lopen(ptr word) KERNEL__lopen(1 2)
86 pascal _lwrite(word ptr word) KERNEL__lwrite(1 2 3) 86 pascal _lwrite(word ptr word) KERNEL__lwrite(1 2 3)
88 pascal lstrcpy(ptr ptr) lstrcpy(1 2) 88 pascal lstrcpy(ptr ptr) lstrcpy(1 2)
...@@ -51,11 +55,14 @@ length 415 ...@@ -51,11 +55,14 @@ length 415
91 register InitTask(word word word word word 91 register InitTask(word word word word word
word word word word word) word word word word word)
KERNEL_InitTask() KERNEL_InitTask()
92 pascal GetTempDrive(byte) GetTempDrive(1)
95 pascal LoadLibrary(ptr) LoadLibrary(1) 95 pascal LoadLibrary(ptr) LoadLibrary(1)
96 pascal FreeLibrary(word) FreeLibrary(1) 96 pascal FreeLibrary(word) FreeLibrary(1)
97 pascal GetTempFileName(byte ptr word ptr) GetTempDrive(1 2 3 4)
102 register DOS3Call(word word word word word 102 register DOS3Call(word word word word word
word word word word word) word word word word word)
KERNEL_DOS3Call() KERNEL_DOS3Call()
107 pascal SetErrorMode(word) SetErrorMode(1)
111 pascal GlobalWire(word) GlobalLock(1) 111 pascal GlobalWire(word) GlobalLock(1)
112 pascal GlobalUnWire(word) GlobalUnlock(1) 112 pascal GlobalUnWire(word) GlobalUnlock(1)
115 pascal OutputDebugString(ptr) OutputDebugString(1) 115 pascal OutputDebugString(ptr) OutputDebugString(1)
...@@ -68,6 +75,9 @@ length 415 ...@@ -68,6 +75,9 @@ length 415
WritePrivateProfileString(1 2 3 4) WritePrivateProfileString(1 2 3 4)
131 pascal GetDOSEnvironment() GetDOSEnvironment() 131 pascal GetDOSEnvironment() GetDOSEnvironment()
132 return GetWinFlags 0 0x413 132 return GetWinFlags 0 0x413
134 pascal GetWindowsDirectory(ptr word) GetWindowsDirectory(1 2)
135 pascal GetSystemDirectory(ptr word) GetSystemDirectory(1 2)
136 pascal GetDriveType(byte) GetWindowsDirectory(1)
154 return GlobalNotify 4 0 154 return GlobalNotify 4 0
163 pascal GlobalLRUOldest(word) ReturnArg(1) 163 pascal GlobalLRUOldest(word) ReturnArg(1)
164 pascal GlobalLRUNewest(word) ReturnArg(1) 164 pascal GlobalLRUNewest(word) ReturnArg(1)
......
...@@ -173,7 +173,7 @@ DLLRelay(unsigned int func_num, unsigned int seg_off) ...@@ -173,7 +173,7 @@ DLLRelay(unsigned int func_num, unsigned int seg_off)
case DLL_ARGTYPE_FARPTR: case DLL_ARGTYPE_FARPTR:
ip = (int *) ((char *) arg_ptr + offset); ip = (int *) ((char *) arg_ptr + offset);
if (*ip & 0xffff0000) if (*ip & 0xffff0000)
arg_table[i] = SAFEMAKEPTR((unsigned) *ip >> 16, *ip); arg_table[i] = FIXPTR(*ip);
else else
arg_table[i] = *ip; arg_table[i] = *ip;
break; break;
......
...@@ -13,12 +13,16 @@ length 540 ...@@ -13,12 +13,16 @@ length 540
13 pascal GetTickCount() GetTickCount() 13 pascal GetTickCount() GetTickCount()
14 return GetTimerResolution 0 1000 14 return GetTimerResolution 0 1000
15 pascal GetCurrentTime() GetTickCount() 15 pascal GetCurrentTime() GetTickCount()
16 pascal ClipCursor(ptr) ClipCursor(1)
17 pascal GetCursorPos(ptr) GetCursorPos(1)
18 pascal SetCapture(word) SetCapture(1) 18 pascal SetCapture(word) SetCapture(1)
19 pascal ReleaseCapture() ReleaseCapture() 19 pascal ReleaseCapture() ReleaseCapture()
20 pascal SetDoubleClickTime(word) SetDoubleClickTime(1) 20 pascal SetDoubleClickTime(word) SetDoubleClickTime(1)
21 pascal GetDoubleClickTime() GetDoubleClickTime() 21 pascal GetDoubleClickTime() GetDoubleClickTime()
22 pascal SetFocus(word) SetFocus(1) 22 pascal SetFocus(word) SetFocus(1)
23 pascal GetFocus() GetFocus() 23 pascal GetFocus() GetFocus()
28 pascal ClientToScreen(word ptr) ClientToScreen(1 2)
29 pascal ScreenToClient(word ptr) ScreenToClient(1 2)
31 pascal IsIconic(word) IsIconic(1) 31 pascal IsIconic(word) IsIconic(1)
32 pascal GetWindowRect(word ptr) GetWindowRect(1 2) 32 pascal GetWindowRect(word ptr) GetWindowRect(1 2)
33 pascal GetClientRect(word ptr) GetClientRect(1 2) 33 pascal GetClientRect(word ptr) GetClientRect(1 2)
...@@ -41,13 +45,18 @@ length 540 ...@@ -41,13 +45,18 @@ length 540
56 pascal MoveWindow(word word word word word word) 56 pascal MoveWindow(word word word word word word)
MoveWindow(1 2 3 4 5 6) MoveWindow(1 2 3 4 5 6)
57 pascal RegisterClass(ptr) RegisterClass(1) 57 pascal RegisterClass(ptr) RegisterClass(1)
58 pascal GetClassName(word ptr word) GetClassName(1 2 3)
61 pascal ScrollWindow(word s_word s_word ptr ptr) ScrollWindow(1 2 3 4 5) 61 pascal ScrollWindow(word s_word s_word ptr ptr) ScrollWindow(1 2 3 4 5)
62 pascal SetScrollPos(word word word word) SetScrollPos(1 2 3 4) 62 pascal SetScrollPos(word word word word) SetScrollPos(1 2 3 4)
63 pascal GetScrollPos(word word) GetScrollPos(1 2)
64 pascal SetScrollRange(word word word word word) SetScrollRange(1 2 3 4 5) 64 pascal SetScrollRange(word word word word word) SetScrollRange(1 2 3 4 5)
65 pascal GetScrollRange(word word ptr ptr) GetScrollRange(1 2 3 4)
66 pascal GetDC(word) GetDC(1) 66 pascal GetDC(word) GetDC(1)
67 pascal GetWindowDC(word) GetWindowDC(1)
68 pascal ReleaseDC(word word) ReleaseDC(1 2) 68 pascal ReleaseDC(word word) ReleaseDC(1 2)
69 pascal SetCursor(word word) SetCursor(1 2) 69 pascal SetCursor(word) SetCursor(1)
71 pascal ShowCursor(word word) ShowCursor(1 2) 70 pascal SetCursorPos(word word) SetCursorPos(1 2)
71 pascal ShowCursor(word) ShowCursor(1)
72 pascal SetRect(ptr s_word s_word s_word s_word) SetRect(1 2 3 4 5) 72 pascal SetRect(ptr s_word s_word s_word s_word) SetRect(1 2 3 4 5)
73 pascal SetRectEmpty(ptr) SetRectEmpty(1) 73 pascal SetRectEmpty(ptr) SetRectEmpty(1)
74 pascal CopyRect(ptr ptr) CopyRect(1 2) 74 pascal CopyRect(ptr ptr) CopyRect(1 2)
...@@ -67,7 +76,7 @@ length 540 ...@@ -67,7 +76,7 @@ length 540
89 pascal CreateDialog(word ptr word ptr) CreateDialog(1 2 3 4) 89 pascal CreateDialog(word ptr word ptr) CreateDialog(1 2 3 4)
90 pascal IsDialogMessage(word ptr) IsDialogMessage(1 2) 90 pascal IsDialogMessage(word ptr) IsDialogMessage(1 2)
91 pascal GetDlgItem(word word) GetDlgItem(1 2) 91 pascal GetDlgItem(word word) GetDlgItem(1 2)
92 pascal SetDlgItemText(word ptr) SetDlgItemText(1 2) 92 pascal SetDlgItemText(word word ptr) SetDlgItemText(1 2 3)
93 pascal GetDlgItemText(word word ptr word) GetDlgItemText(1 2 3 4) 93 pascal GetDlgItemText(word word ptr word) GetDlgItemText(1 2 3 4)
94 pascal SetDlgItemInt(word word word word) SetDlgItemInt(1 2 3 4) 94 pascal SetDlgItemInt(word word word word) SetDlgItemInt(1 2 3 4)
95 pascal GetDlgItemInt(word word ptr word) GetDlgItemInt(1 2 3 4) 95 pascal GetDlgItemInt(word word ptr word) GetDlgItemInt(1 2 3 4)
...@@ -106,9 +115,18 @@ length 540 ...@@ -106,9 +115,18 @@ length 540
136 pascal SetWindowLong(word s_word long) SetWindowLong(1 2 3) 136 pascal SetWindowLong(word s_word long) SetWindowLong(1 2 3)
150 pascal LoadMenu(word ptr) LoadMenu(1 2) 150 pascal LoadMenu(word ptr) LoadMenu(1 2)
151 pascal CreateMenu() CreateMenu() 151 pascal CreateMenu() CreateMenu()
154 pascal CheckMenu(word word word) CheckMenu(1 2 3) 152 pascal DestroyMenu(word) DestroyMenu(1)
154 pascal CheckMenuItem(word word word) CheckMenuItem(1 2 3)
155 pascal EnableMenuItem(word word word) EnableMenuItem(1 2 3)
157 pascal GetMenu(word) GetMenu(1) 157 pascal GetMenu(word) GetMenu(1)
158 pascal SetMenu(word word) SetMenu(1 2) 158 pascal SetMenu(word word) SetMenu(1 2)
163 pascal CreateCaret(word word word word) CreateCaret(1 2 3 4)
164 pascal DestroyCaret() DestroyCaret()
165 pascal SetCaretPos(word word) SetCaretPos(1 2)
166 pascal HideCaret(word) HideCaret(1)
167 pascal ShowCaret(word) ShowCaret(1)
166 pascal SetCaretBlinkTime(word) SetCaretBlinkTime(1)
169 pascal GetCaretBlinkTime() GetCaretBlinkTime()
171 pascal WinHelp(word word long) WinHelp(1 2 3) 171 pascal WinHelp(word word long) WinHelp(1 2 3)
173 pascal LoadCursor(word ptr) LoadCursor(1 2) 173 pascal LoadCursor(word ptr) LoadCursor(1 2)
174 pascal LoadIcon(word ptr) LoadIcon(1 2) 174 pascal LoadIcon(word ptr) LoadIcon(1 2)
...@@ -119,7 +137,24 @@ length 540 ...@@ -119,7 +137,24 @@ length 540
180 pascal GetSysColor(word) GetSysColor(1) 180 pascal GetSysColor(word) GetSysColor(1)
181 pascal SetSysColors(word ptr ptr) SetSysColors(1 2 3) 181 pascal SetSysColors(word ptr ptr) SetSysColors(1 2 3)
182 pascal KillSystemTimer(word word) KillSystemTimer(1 2) 182 pascal KillSystemTimer(word word) KillSystemTimer(1 2)
183 pascal GetCaretPos(ptr) GetCaretPos(1)
190 pascal GetUpdateRect(word ptr word) GetUpdateRect(1 2 3) 190 pascal GetUpdateRect(word ptr word) GetUpdateRect(1 2 3)
200 pascal OpenComm(ptr word word) OpenComm(1 2 3)
201 pascal SetCommState(ptr) SetCommState(1)
202 pascal GetCommState(word ptr) GetCommState(1 2)
203 pascal GetCommError(word ptr) GetCommError(1 2)
204 pascal ReadComm(word ptr word) ReadComm(1 2 3)
205 pascal WriteComm(word ptr word) WriteComm(1 2 3)
206 pascal TransmitCommChar(word byte) TransmitCommChar (1 2)
207 pascal CloseComm(word) CloseComm(1)
208 pascal SetCommEventMask(word word) SetCommEventMask(1 2)
209 pascal GetCommEventMask(word word) GetCommEventMask(1 2)
210 pascal SetCommBreak(word) SetCommBreak(1)
211 pascal ClearCommBreak(word) ClearCommBreak(1)
212 pascal UngetCommChar(word byte) UngetCommChar(1 2)
213 pascal BuildCommDCB(ptr ptr) BuildCommDCB(1 2)
214 pascal EscapeCommFunction(word word) EscapeCommFunction(1 2)
215 pascal FlushComm(word word) FlushComm(1 2)
218 pascal DialogBoxIndirect(word word word ptr) DialogBoxIndirect(1 2 3 4) 218 pascal DialogBoxIndirect(word word word ptr) DialogBoxIndirect(1 2 3 4)
219 pascal CreateDialogIndirect(word ptr word ptr) 219 pascal CreateDialogIndirect(word ptr word ptr)
CreateDialogIndirect(1 2 3 4) CreateDialogIndirect(1 2 3 4)
...@@ -131,6 +166,7 @@ length 540 ...@@ -131,6 +166,7 @@ length 540
230 pascal GetNextWindow(word word) GetNextWindow(1 2) 230 pascal GetNextWindow(word word) GetNextWindow(1 2)
232 pascal SetWindowPos(word word word word word word word) 232 pascal SetWindowPos(word word word word word word word)
SetWindowPos(1 2 3 4 5 6 7) SetWindowPos(1 2 3 4 5 6 7)
236 pascal GetCapture() GetCapture()
237 pascal GetUpdateRgn(word word word) GetUpdateRgn(1 2 3) 237 pascal GetUpdateRgn(word word word) GetUpdateRgn(1 2 3)
239 pascal DialogBoxParam(word ptr word ptr long) DialogBoxParam(1 2 3 4 5) 239 pascal DialogBoxParam(word ptr word ptr long) DialogBoxParam(1 2 3 4 5)
240 pascal DialogBoxIndirectParam(word word word ptr long) 240 pascal DialogBoxIndirectParam(word word word ptr long)
...@@ -140,9 +176,14 @@ length 540 ...@@ -140,9 +176,14 @@ length 540
242 pascal CreateDialogIndirectParam(word ptr word ptr long) 242 pascal CreateDialogIndirectParam(word ptr word ptr long)
CreateDialogIndirectParam(1 2 3 4 5) CreateDialogIndirectParam(1 2 3 4 5)
244 pascal EqualRect(ptr ptr) EqualRect(1 2) 244 pascal EqualRect(ptr ptr) EqualRect(1 2)
258 pascal MapWindowPoints(word word ptr word) MapWindowPoints(1 2 3 4)
262 pascal GetWindow(word word) GetWindow(1 2) 262 pascal GetWindow(word word) GetWindow(1 2)
266 pascal SetMessageQueue(word) SetMessageQueue(1) 266 pascal SetMessageQueue(word) SetMessageQueue(1)
267 pascal ShowScrollBar(word word word) ShowScrollBar(1 2 3)
272 pascal IsZoomed(word) IsZoomed(1)
277 pascal GetDlgCtrlID(word) GetDlgCtrlID(1) 277 pascal GetDlgCtrlID(word) GetDlgCtrlID(1)
282 pascal SelectPalette(word word word) SelectPalette(1 2 3)
283 pascal RealizePalette(word) RealizePalette(1)
286 pascal GetDesktopWindow() GetDesktopWindow() 286 pascal GetDesktopWindow() GetDesktopWindow()
288 pascal GetMessageExtraInfo() GetMessageExtraInfo() 288 pascal GetMessageExtraInfo() GetMessageExtraInfo()
319 pascal ScrollWindowEx(word s_word s_word ptr ptr word ptr word) 319 pascal ScrollWindowEx(word s_word s_word ptr ptr word ptr word)
...@@ -151,9 +192,20 @@ length 540 ...@@ -151,9 +192,20 @@ length 540
325 pascal PaintRect(word word word word ptr) PaintRect(1 2 3 4 5) 325 pascal PaintRect(word word word word ptr) PaintRect(1 2 3 4 5)
334 pascal GetQueueStatus(word) GetQueueStatus(1) 334 pascal GetQueueStatus(word) GetQueueStatus(1)
335 pascal GetInputState() GetInputState() 335 pascal GetInputState() GetInputState()
359 pascal GetDCEx(word word long) GetDCEx(1 2 3)
373 pascal SubtractRect(ptr ptr ptr) SubtractRect(1 2 3) 373 pascal SubtractRect(ptr ptr ptr) SubtractRect(1 2 3)
403 pascal UnregisterClass(ptr word) UnregisterClass(1 2) 403 pascal UnregisterClass(ptr word) UnregisterClass(1 2)
404 pascal GetClassInfo(word ptr ptr) GetClassInfo(1 2 3)
406 pascal CreateCursor(word word word word word ptr ptr)
CreateCursor(1 2 3 4 5 6 7)
410 pascal InsertMenu(word word word word ptr) InsertMenu(1 2 3 4 5)
411 pascal AppendMenu(word word word ptr) AppendMenu(1 2 3 4) 411 pascal AppendMenu(word word word ptr) AppendMenu(1 2 3 4)
412 pascal RemoveMenu(word word word) RemoveMenu(1 2 3)
413 pascal DeleteMenu(word word word) DeleteMenu(1 2 3)
414 pascal ModifyMenu(word word word word ptr) ModifyMenu(1 2 3 4 5)
415 pascal CreatePopupMenu() CreatePopupMenu()
416 pascal TrackPopupMenu(word word word word word word ptr)
TrackPopupMenu(1 2 3 4 5 6 7)
420 pascal wsprintf(ptr ptr) wsprintf(1 2) 420 pascal wsprintf(ptr ptr) wsprintf(1 2)
421 pascal wvsprintf(ptr ptr ptr) wvsprintf(1 2 3) 421 pascal wvsprintf(ptr ptr ptr) wvsprintf(1 2 3)
430 pascal lstrcmp(ptr ptr) lstrcmp(1 2) 430 pascal lstrcmp(ptr ptr) lstrcmp(1 2)
......
#include "../Wine.tmpl"
MODULE = include
HEADERS = \
atom.h \
callback.h \
class.h \
combo.h \
cursor.h \
dce.h \
dialog.h \
dlls.h \
files.h \
gdi.h \
heap.h \
icon.h \
int21.h \
listbox.h \
menu.h \
message.h \
neexe.h \
prototypes.h \
regfunc.h \
scroll.h \
segmem.h \
user.h \
win.h \
windows.h \
wine.h
AllTarget()
depend::
CleanTarget()
includes::
/*
* Atom table definitions
*
* Copyright 1993 Alexandre Julliard
*/
#ifndef ATOM_H
#define ATOM_H
#include "windows.h"
typedef struct
{
HANDLE next;
WORD refCount;
BYTE length;
BYTE str[1];
} ATOMENTRY;
typedef struct
{
WORD size;
HANDLE entries[1];
} ATOMTABLE;
#endif /* ATOM_H */
...@@ -17,7 +17,7 @@ typedef struct tagCLASS ...@@ -17,7 +17,7 @@ typedef struct tagCLASS
HCLASS hNext; /* Next class */ HCLASS hNext; /* Next class */
WORD wMagic; /* Magic number (must be CLASS_MAGIC) */ WORD wMagic; /* Magic number (must be CLASS_MAGIC) */
ATOM atomName; /* Name of the class */ ATOM atomName; /* Name of the class */
HDC hdc; /* Class DC (if CS_CLASSDC) */ HANDLE hdce; /* Class DCE (if CS_CLASSDC) */
WORD cWindows; /* Count of existing windows of this class */ WORD cWindows; /* Count of existing windows of this class */
WNDCLASS wc __attribute__ ((packed)); /* Class information */ WNDCLASS wc __attribute__ ((packed)); /* Class information */
WORD wExtra[1]; /* Class extra bytes */ WORD wExtra[1]; /* Class extra bytes */
......
...@@ -9,16 +9,27 @@ ...@@ -9,16 +9,27 @@
#include "windows.h" #include "windows.h"
typedef enum
{
DCE_CACHE_DC, /* This is a cached DC (allocated by USER) */
DCE_CLASS_DC, /* This is a class DC (style CS_CLASSDC) */
DCE_WINDOW_DC /* This is a window DC (style CS_OWNDC) */
} DCE_TYPE;
typedef struct tagDCE typedef struct tagDCE
{ {
HANDLE hNext; HANDLE hNext;
HWND hwndCurrent; HWND hwndCurrent;
HDC hdc; HDC hdc;
BYTE flags; DCE_TYPE type;
BOOL inUse; BOOL inUse;
WORD xOrigin; WORD xOrigin;
WORD yOrigin; WORD yOrigin;
} DCE; } DCE;
extern HANDLE DCE_AllocDCE( DCE_TYPE type );
extern void DCE_FreeDCE( HANDLE hdce );
#endif /* DCE_H */ #endif /* DCE_H */
#ifndef _FILES_H
#define _FILES_H
#define OPEN_MAX 256
/***************************************************************************
This structure stores the infomation needed for a single DOS drive
***************************************************************************/
struct DosDriveStruct
{
char RootDirectory [256]; /* Unix base for this drive letter */
char CurrentDirectory [256]; /* Current directory for this drive */
char VolumeLabel [11];
unsigned long serialnumber;
};
#endif /*_FILES_H*/
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef GDI_H #ifndef GDI_H
#define GDI_H #define GDI_H
#include <X11/Intrinsic.h> #include <X11/Xlib.h>
#include "windows.h" #include "windows.h"
#include "segmem.h" #include "segmem.h"
...@@ -158,6 +158,8 @@ typedef struct ...@@ -158,6 +158,8 @@ typedef struct
WORD MapMode; WORD MapMode;
short DCOrgX; /* DC origin */ short DCOrgX; /* DC origin */
short DCOrgY; short DCOrgY;
short DCSizeX; /* DC dimensions */
short DCSizeY;
short CursPosX; /* Current position */ short CursPosX; /* Current position */
short CursPosY; short CursPosY;
short WndOrgX; short WndOrgX;
...@@ -200,7 +202,6 @@ typedef struct ...@@ -200,7 +202,6 @@ typedef struct
{ {
GC gc; /* X Window GC */ GC gc; /* X Window GC */
Drawable drawable; Drawable drawable;
Widget widget;
X_PHYSFONT font; X_PHYSFONT font;
X_PHYSPEN pen; X_PHYSPEN pen;
X_PHYSBRUSH brush; X_PHYSBRUSH brush;
......
#ifndef INT21_H #ifndef INT21_H
#define INT21_H #define INT21_H
#include <dirent.h>
struct dosdirent {
int inuse;
DIR *ds;
char unixpath[256];
char filename[256];
char attribute;
long filesize;
long filetime;
long filedate;
};
struct diskinfo {
unsigned int infolevel;
unsigned long serialnumber;
char label[11];
char fstype[8];
};
#define DosVersion 0x0303; #define DosVersion 0x0303;
#define SectorSize 0x200; #define SectorSize 0x200;
#define SectorsPerCluster 0x04; #define SectorsPerCluster 0x04;
#define AX context->sc_eax #define EAX context->sc_eax
#define BX context->sc_ebx #define EBX context->sc_ebx
#define CX context->sc_ecx #define ECX context->sc_ecx
#define DX context->sc_edx #define EDX context->sc_edx
#define AX (context->sc_eax & 0x0000ffffL)
#define BX (context->sc_ebx & 0x0000ffffL)
#define CX (context->sc_ecx & 0x0000ffffL)
#define DX (context->sc_edx & 0x0000ffffL)
#define ES context->sc_es #define ES context->sc_es
#define DS context->sc_ds #define DS context->sc_ds
#define DI context->sc_edi #define DI context->sc_edi
...@@ -22,13 +47,6 @@ ...@@ -22,13 +47,6 @@
#define SetCflag (context->sc_efl |= 0x00000001L) #define SetCflag (context->sc_efl |= 0x00000001L)
#define ResetCflag (context->sc_efl &= 0xfffffffeL) #define ResetCflag (context->sc_efl &= 0xfffffffeL)
struct diskinfo {
WORD infolevel;
DWORD serialnumber;
char label[11];
char fstype[8];
};
/* extended error codes */ /* extended error codes */
#define NoError 0x00 #define NoError 0x00
......
...@@ -14,16 +14,17 @@ typedef LISTSTRUCT FAR* LPLISTSTRUCT; ...@@ -14,16 +14,17 @@ typedef LISTSTRUCT FAR* LPLISTSTRUCT;
typedef struct tagHEADLIST { typedef struct tagHEADLIST {
short FirstVisible; short FirstVisible;
short ItemSelect;
short ItemsCount; short ItemsCount;
short ItemsVisible; short ItemsVisible;
short ItemSelected; short ColumnsVisible;
short PrevSelected; short ItemsPerColumn;
short ItemFocused;
short PrevFocused;
short StdItemHeight; short StdItemHeight;
short ColumnsWidth;
short DrawCtlType; short DrawCtlType;
void *lpFirst; void *lpFirst;
DWORD dwStyle; DWORD dwStyle;
HWND hWndScroll;
HWND hWndLogicParent; HWND hWndLogicParent;
} HEADLIST; } HEADLIST;
typedef HEADLIST FAR* LPHEADLIST; typedef HEADLIST FAR* LPHEADLIST;
......
...@@ -27,7 +27,10 @@ typedef struct tagMENUITEM ...@@ -27,7 +27,10 @@ typedef struct tagMENUITEM
Widget w; Widget w;
Widget menu_w; Widget menu_w;
char menu_name[10]; char menu_name[10];
} MENUITEM; RECT rect;
HBITMAP hCheckBit;
HBITMAP hUnCheckBit;
} MENUITEM, *LPMENUITEM;
typedef struct tagMENUBAR typedef struct tagMENUBAR
{ {
...@@ -40,6 +43,16 @@ typedef struct tagMENUBAR ...@@ -40,6 +43,16 @@ typedef struct tagMENUBAR
MENUITEM *firstItem; MENUITEM *firstItem;
} MENUBAR, *LPMENUBAR; } MENUBAR, *LPMENUBAR;
typedef struct tagPOPUPMENU
{
HWND hWnd; /* PopupMenu window handle */
HWND ownerWnd; /* Owner window */
WORD nItems; /* Number of items on menu */
MENUITEM *firstItem;
WORD FocusedItem;
WORD MouseFlags;
} POPUPMENU, *LPPOPUPMENU;
typedef struct typedef struct
{ {
WORD version; /* Should be zero */ WORD version; /* Should be zero */
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
/* Message as stored in the queue (contains the extraInfo field) */ /* Message as stored in the queue (contains the extraInfo field) */
typedef struct tagQMSG typedef struct tagQMSG
{ {
DWORD extraInfo; /* Only in 3.1 */
MSG msg; MSG msg;
DWORD extraInfo __attribute__ ((packed)); /* Only in 3.1 */
} QMSG; } QMSG;
...@@ -28,17 +28,28 @@ typedef struct tagMESSAGEQUEUE ...@@ -28,17 +28,28 @@ typedef struct tagMESSAGEQUEUE
WORD queueSize; /* Size of the queue */ WORD queueSize; /* Size of the queue */
DWORD GetMessageTimeVal; /* Value returned by GetMessageTime */ DWORD GetMessageTimeVal; /* Value returned by GetMessageTime */
DWORD GetMessagePosVal; /* Value returned by GetMessagePos */ DWORD GetMessagePosVal; /* Value returned by GetMessagePos */
WORD GetMessageExtraInfoVal; /* Value returned by GetMessageExtraInfo */ DWORD GetMessageExtraInfoVal; /* Value returned by GetMessageExtraInfo */
DWORD lParam; /* Next four values set by SetMessage */ DWORD lParam; /* Next four values set by SendMessage */
WORD wParam; WORD wParam;
WORD msg; WORD msg;
WORD hWnd; WORD hWnd;
WORD wPostQMsg; /* PostQuitMessage flag */ WORD wPostQMsg; /* PostQuitMessage flag */
WORD wExitCode; /* PostQuitMessage exit code */ WORD wExitCode; /* PostQuitMessage exit code */
WORD InSendMessageHandle; /* Handle of task that sent a message */ WORD InSendMessageHandle; /* Handle of task that sent a message */
WORD wPaintCount; /* Number of WM_PAINT needed */
WORD wTimerCount; /* Number of timers for this application */
WORD tempStatus; /* State reset by GetQueueStatus */ WORD tempStatus; /* State reset by GetQueueStatus */
WORD status; /* Queue state */ WORD status; /* Queue state */
QMSG messages[1]; /* Queue messages */ QMSG messages[1]; /* Queue messages */
} MESSAGEQUEUE; } MESSAGEQUEUE;
extern void MSG_IncPaintCount( HANDLE hQueue );
extern void MSG_DecPaintCount( HANDLE hQueue );
extern void MSG_IncTimerCount( HANDLE hQueue );
extern void MSG_DecTimerCount( HANDLE hQueue );
extern BOOL MSG_CreateSysMsgQueue( int size );
extern void hardware_event(HWND hwnd, WORD message, WORD wParam, LONG lParam,
WORD xPos, WORD yPos, DWORD time, DWORD extraInfo);
#endif /* MESSAGE_H */ #endif /* MESSAGE_H */
...@@ -136,7 +136,9 @@ struct relocation_entry_s ...@@ -136,7 +136,9 @@ struct relocation_entry_s
/* Used by Windows 3.0 programs, like when getting selector to be /* Used by Windows 3.0 programs, like when getting selector to be
given to makeprocinst */ given to makeprocinst */
#define NE_RELTYPE_INT1 4 #define NE_RELTYPE_INT1 4
#define NE_RELTYPE_OFFSET16 5 #define NE_RELTYPE_ORDINALADD 5
#define NE_RELTYPE_NAMEADD 6
/* /*
* DOS PSP * DOS PSP
*/ */
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "neexe.h" #include "neexe.h"
#include "segmem.h" #include "segmem.h"
#include "wine.h" #include "wine.h"
#include "int21.h"
extern struct segment_descriptor_s * extern struct segment_descriptor_s *
CreateSelectors(struct w_files *); CreateSelectors(struct w_files *);
...@@ -33,5 +34,15 @@ extern int CurrentNEFile; ...@@ -33,5 +34,15 @@ extern int CurrentNEFile;
extern do_int1A(struct sigcontext_struct * context); extern do_int1A(struct sigcontext_struct * context);
extern do_int21(struct sigcontext_struct * context); extern do_int21(struct sigcontext_struct * context);
#endif /* PROTOTYPES_H */ extern void GetUnixDirName(char *rootdir, char *name);
extern char *GetDirectUnixFileName(char *dosfilename);
extern char *GetUnixFileName(char *dosfilename);
extern char *FindFile(char *buffer, int buflen, char *rootname, char **extensions, char *path);
extern char *WineIniFileName(void);
extern char *WinIniFileName(void);
extern struct dosdirent *DOS_opendir(char *dosdirname);
extern struct dosdirent *DOS_readdir(struct dosdirent *de);
extern void DOS_closedir(struct dosdirent *de);
#endif /* PROTOTYPES_H */
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
#ifndef SEGMEM_H #ifndef SEGMEM_H
#define SEGMEM_H #define SEGMEM_H
#ifdef __linux__
#define HAVE_IPC
#include <sys/ipc.h>
#include <sys/shm.h>
#endif
/* /*
* Array to track selector allocation. * Array to track selector allocation.
*/ */
...@@ -15,21 +21,32 @@ ...@@ -15,21 +21,32 @@
extern unsigned short SelectorMap[MAX_SELECTORS]; extern unsigned short SelectorMap[MAX_SELECTORS];
#ifdef HAVE_IPC
#define SAFEMAKEPTR(s, o) (((int) (s) << 16) | ((o) & 0xffff))
#define FIXPTR(p) (p)
#else
#define SAFEMAKEPTR(s, o) \ #define SAFEMAKEPTR(s, o) \
(((int) SelectorMap[SelectorMap[(s) >> 3] & SELECTOR_INDEXMASK] << 19) \ (((int) SelectorMap[SelectorMap[(s) >> 3] & SELECTOR_INDEXMASK] << 19) \
| 0x70000 | ((o) & 0xffff)) | 0x70000 | ((o) & 0xffff))
#define FIXPTR(p) SAFEMAKEPTR((unsigned long) (p) >> 16, (p))
#endif
/* /*
* Structure to hold info about each selector we create. * Structure to hold info about each selector we create.
*/ */
struct segment_descriptor_s typedef struct segment_descriptor_s
{ {
void *base_addr; /* Pointer to segment in flat memory */ void *base_addr; /* Pointer to segment in flat memory */
unsigned int length; /* Length of segment */ unsigned int length; /* Length of segment */
unsigned int flags; /* Segment flags (see neexe.h and below)*/ unsigned int flags; /* Segment flags (see neexe.h and below)*/
unsigned short selector; /* Selector used to access this segment */ unsigned short selector; /* Selector used to access this segment */
}; unsigned short owner; /* Handle of owner program */
unsigned char type; /* DATA or CODE */
#ifdef HAVE_IPC
key_t shm_key; /* Shared memory key or IPC_PRIVATE */
#endif
} SEGDESC;
/* /*
* Additional flags * Additional flags
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
extern MDESC *USER_Heap; extern MDESC *USER_Heap;
#define USER_HEAP_ALLOC(f,size) ((int)HEAP_Alloc(&USER_Heap,f,size) & 0xffff) #define USER_HEAP_ALLOC(f,size) ((int)HEAP_Alloc(&USER_Heap,f,size) & 0xffff)
#define USER_HEAP_REALLOC(handle,size,f) ((int)HEAP_ReAlloc(&USER_Heap, \
USER_HEAP_ADDR(handle),size,f) & 0xffff)
#define USER_HEAP_ADDR(handle) ((void *)(handle|((int)USER_Heap & 0xffff0000))) #define USER_HEAP_ADDR(handle) ((void *)(handle|((int)USER_Heap & 0xffff0000)))
#define USER_HEAP_FREE(handle) (HEAP_Free(&USER_Heap,USER_HEAP_ADDR(handle))) #define USER_HEAP_FREE(handle) (HEAP_Free(&USER_Heap,USER_HEAP_ADDR(handle)))
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
#define WIN_H #define WIN_H
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Core.h>
#include "windows.h" #include "windows.h"
#include "menu.h" #include "menu.h"
...@@ -26,31 +24,41 @@ typedef struct tagWND ...@@ -26,31 +24,41 @@ typedef struct tagWND
HWND hwndOwner; /* Window owner */ HWND hwndOwner; /* Window owner */
HCLASS hClass; /* Window class */ HCLASS hClass; /* Window class */
HANDLE hInstance; /* Window hInstance (from CreateWindow) */ HANDLE hInstance; /* Window hInstance (from CreateWindow) */
RECT rectClient; /* Window client area screen coords */ RECT rectClient; /* Client area rel. to parent client area */
RECT rectWindow; /* Window whole area screen coords */ RECT rectWindow; /* Whole window rel. to parent client area */
HANDLE hmemTaskQ; /* Task queue global memory handle */
HRGN hrgnUpdate; /* Update region */ HRGN hrgnUpdate; /* Update region */
HWND hwndLastActive; /* Last active popup hwnd */ HWND hwndLastActive; /* Last active popup hwnd */
FARPROC lpfnWndProc; /* Window procedure */ FARPROC lpfnWndProc; /* Window procedure */
DWORD dwStyle; /* Window style (from CreateWindow) */ DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */ DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
HDC hdc; /* Window DC (if CS_OWNDC) */ HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
HMENU hmenuSystem; /* System menu */ HMENU hmenuSystem; /* System menu */
HCURSOR hCursor; /* Window Current Cursor */
HWND hWndVScroll; /* Verti. ScrollBar handle of the window */
HWND hWndHScroll; /* Horiz. ScrollBar handle of the window */
WORD wIDmenu; /* ID or hmenu (from CreateWindow) */ WORD wIDmenu; /* ID or hmenu (from CreateWindow) */
HANDLE hText; /* Handle of window text */ HANDLE hText; /* Handle of window text */
WORD flags; /* Misc. flags */ WORD flags; /* Misc. flags */
Widget shellWidget; /* For top-level windows */ Widget shellWidget; /* For top-level windows */
Widget winWidget; /* For all windows */ Widget winWidget; /* For all windows */
Widget compositeWidget;/* For top-level windows */ Widget compositeWidget;/* For top-level windows */
Window window; /* X window */
LPMENUBAR menuBarPtr; /* Menu bar */ LPMENUBAR menuBarPtr; /* Menu bar */
WORD wExtra[1]; /* Window extra bytes */ WORD wExtra[1]; /* Window extra bytes */
} WND; } WND;
/* WND flags values */ /* WND flags values */
#define WIN_ERASE_UPDATERGN 1 /* Update region needs erasing */ #define WIN_ERASE_UPDATERGN 0x01 /* Update region needs erasing */
#define WIN_NEEDS_BEGINPAINT 0x02 /* WM_PAINT sent to window */
#define WIN_GOT_SIZEMSG 0x04 /* WM_SIZE has been sent to the window */
#define WIN_OWN_DC 0x08 /* Win class has style CS_OWNDC */
#define WIN_CLASS_DC 0x10 /* Win class has style CS_CLASSDC */
/* Window functions */ /* Window functions */
WND * WIN_FindWndPtr( HWND hwnd ); WND *WIN_FindWndPtr( HWND hwnd );
BOOL WIN_UnlinkWindow( HWND hwnd );
BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
HWND WIN_FindWinToRepaint( HWND hwnd ); HWND WIN_FindWinToRepaint( HWND hwnd );
......
...@@ -22,9 +22,14 @@ extern struct w_files * wine_files; ...@@ -22,9 +22,14 @@ extern struct w_files * wine_files;
extern char *GetFilenameFromInstance(unsigned short instance); extern char *GetFilenameFromInstance(unsigned short instance);
extern struct w_files *GetFileInfo(unsigned short instance); extern struct w_files *GetFileInfo(unsigned short instance);
extern char *FindFileInPath(char *buffer, int buflen, char *rootname, extern char *WineIniFileName(void);
char **extensions, char *path); extern char *WinIniFileName(void);
extern char *GetSystemIniFilename(void);
#define MAX_DOS_DRIVES 26
#define WINE_INI WineIniFileName()
#define WIN_INI WinIniFileName()
#ifdef linux #ifdef linux
struct sigcontext_struct { struct sigcontext_struct {
unsigned short sc_gs, __gsh; unsigned short sc_gs, __gsh;
......
#include "../Wine.tmpl"
MODULE = loader
SRCS = \
dump.c \
files.c \
ldt.c \
ldtlib.c \
resource.c \
selector.c \
signal.c \
library.c \
wine.c \
cursor.c
OBJS = \
dump.o \
files.o \
ldt.o \
ldtlib.o \
resource.o \
selector.o \
signal.o \
library.o \
wine.o \
cursor.o
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
includes::
install::
CFLAGS=$(COPTS) $(DEBUGOPTS) -I../include CFLAGS=$(COPTS) $(DEBUGOPTS) -I../include
OBJS=dump.o files.o ldt.o ldtlib.o resource.o selector.o signal.o int1a.o \ OBJS=dump.o ldt.o ldtlib.o resource.o selector.o signal.o library.o \
int21.o wine.o library.o wine.o cursor.o
default: loader.o default: loader.o
......
This diff is collapsed. Click to expand it.
static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
/**********************************************************************
* FindFileInPath
*/
char *
FindFileInPath(char *buffer, int buflen, char *rootname,
char **extensions, char *path)
{
char *workingpath;
char *dirname;
DIR *d;
struct dirent *f;
char **e;
int rootnamelen;
int found = 0;
if (strchr(rootname, '/') != NULL)
{
strncpy(buffer, rootname, buflen);
return buffer;
}
rootnamelen = strlen(rootname);
workingpath = malloc(strlen(path) + 1);
if (workingpath == NULL)
return NULL;
strcpy(workingpath, path);
for(dirname = strtok(workingpath, ":;");
dirname != NULL;
dirname = strtok(NULL, ":;"))
{
d = opendir(dirname);
if (d != NULL)
{
while ((f = readdir(d)) != NULL)
{
if (strncasecmp(rootname, f->d_name, rootnamelen) == 0)
{
if (extensions == NULL ||
strcasecmp(rootname, f->d_name) == 0)
{
found = 1;
}
else if (f->d_name[rootnamelen] == '.')
{
for (e = extensions; *e != NULL; e++)
{
if (strcasecmp(*e, f->d_name + rootnamelen + 1)
== 0)
{
found = 1;
break;
}
}
}
if (found)
{
strncpy(buffer, dirname, buflen);
strncat(buffer, "/", buflen - strlen(buffer));
strncat(buffer, f->d_name, buflen - strlen(buffer));
closedir(d);
return buffer;
}
}
}
closedir(d);
}
}
return NULL;
}
/**********************************************************************
* GetSystemIniFilename
*/
char *
GetSystemIniFilename()
{
static char *IniName = NULL;
char inipath[256];
if (IniName)
return IniName;
getcwd(inipath, 256);
strcat(inipath, ":");
strcat(inipath, getenv("HOME"));
strcat(inipath, ":");
strcat(inipath, getenv("WINEPATH"));
IniName = malloc(1024);
if (FindFileInPath(IniName, 1024, "wine.ini", NULL, inipath) == NULL)
{
free(IniName);
IniName = NULL;
return NULL;
}
IniName = realloc(IniName, strlen(IniName) + 1);
return IniName;
}
...@@ -20,7 +20,7 @@ HANDLE LoadLibrary(LPSTR libname) ...@@ -20,7 +20,7 @@ HANDLE LoadLibrary(LPSTR libname)
{ {
HANDLE hRet; HANDLE hRet;
printf("LoadLibrary '%s'\n", libname); printf("LoadLibrary '%s'\n", libname);
hRet = LoadImage(libname, NULL); hRet = LoadImage(libname);
printf("after LoadLibrary hRet=%04X\n", hRet); printf("after LoadLibrary hRet=%04X\n", hRet);
return hRet; return hRet;
} }
......
...@@ -14,7 +14,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; ...@@ -14,7 +14,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "gdi.h" #include "gdi.h"
#include "wine.h" #include "wine.h"
#include "icon.h" #include "icon.h"
#include "cursor.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MIN(a,b) ((a) < (b) ? (a) : (b))
...@@ -31,7 +30,6 @@ static int ResourceFd = -1; ...@@ -31,7 +30,6 @@ static int ResourceFd = -1;
static HANDLE ResourceInst = 0; static HANDLE ResourceInst = 0;
static struct w_files *ResourceFileInfo = NULL; static struct w_files *ResourceFileInfo = NULL;
static RESOURCE *Top = NULL; static RESOURCE *Top = NULL;
static HCURSOR hActiveCursor;
extern HINSTANCE hSysRes; extern HINSTANCE hSysRes;
HANDLE RSC_LoadResource(int instance, char *rsc_name, int type, int *image_size_ret); HANDLE RSC_LoadResource(int instance, char *rsc_name, int type, int *image_size_ret);
...@@ -313,23 +311,26 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name) ...@@ -313,23 +311,26 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name)
instance, icon_name); instance, icon_name);
#endif #endif
if (instance == (HANDLE)NULL) instance = hSysRes;
if (!(hdc = GetDC(GetDesktopWindow()))) return 0; if (!(hdc = GetDC(GetDesktopWindow()))) return 0;
if (instance == (HANDLE)NULL) instance = hSysRes;
rsc_mem = RSC_LoadResource(instance, icon_name, NE_RSCTYPE_GROUP_ICON, rsc_mem = RSC_LoadResource(instance, icon_name, NE_RSCTYPE_GROUP_ICON,
&image_size); &image_size);
if (rsc_mem == (HANDLE)NULL) { if (rsc_mem == (HANDLE)NULL) {
printf("LoadIcon / Icon %04X not Found !\n", icon_name); printf("LoadIcon / Icon %04X not Found !\n", icon_name);
ReleaseDC(GetDesktopWindow(), hdc);
return 0; return 0;
} }
lp = (WORD *)GlobalLock(rsc_mem); lp = (WORD *)GlobalLock(rsc_mem);
if (lp == NULL) { if (lp == NULL) {
GlobalFree(rsc_mem); GlobalFree(rsc_mem);
ReleaseDC(GetDesktopWindow(), hdc);
return 0; return 0;
} }
lpicodesc = (ICONDESCRIP *)(lp + 3); lpicodesc = (ICONDESCRIP *)(lp + 3);
hIcon = GlobalAlloc(GMEM_MOVEABLE, sizeof(ICONALLOC) + 1024); hIcon = GlobalAlloc(GMEM_MOVEABLE, sizeof(ICONALLOC) + 1024);
if (hIcon == (HICON)NULL) { if (hIcon == (HICON)NULL) {
GlobalFree(rsc_mem); GlobalFree(rsc_mem);
ReleaseDC(GetDesktopWindow(), hdc);
return 0; return 0;
} }
printf("LoadIcon Alloc hIcon=%X\n", hIcon); printf("LoadIcon Alloc hIcon=%X\n", hIcon);
...@@ -344,11 +345,13 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name) ...@@ -344,11 +345,13 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name)
NE_RSCTYPE_ICON, &image_size); NE_RSCTYPE_ICON, &image_size);
if (rsc_mem == (HANDLE)NULL) { if (rsc_mem == (HANDLE)NULL) {
printf("LoadIcon / Icon %04X Bitmaps not Found !\n", icon_name); printf("LoadIcon / Icon %04X Bitmaps not Found !\n", icon_name);
ReleaseDC(GetDesktopWindow(), hdc);
return 0; return 0;
} }
lp = (WORD *)GlobalLock(rsc_mem); lp = (WORD *)GlobalLock(rsc_mem);
if (lp == NULL) { if (lp == NULL) {
GlobalFree(rsc_mem); GlobalFree(rsc_mem);
ReleaseDC(GetDesktopWindow(), hdc);
return 0; return 0;
} }
bmi = (BITMAPINFO *)lp; bmi = (BITMAPINFO *)lp;
...@@ -378,7 +381,6 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name) ...@@ -378,7 +381,6 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name)
(BITMAPINFO *)bih, DIB_RGB_COLORS ); (BITMAPINFO *)bih, DIB_RGB_COLORS );
GlobalUnlock(rsc_mem); GlobalUnlock(rsc_mem);
GlobalFree(rsc_mem); GlobalFree(rsc_mem);
hMemDC = CreateCompatibleDC(hdc); hMemDC = CreateCompatibleDC(hdc);
hMemDC2 = CreateCompatibleDC(hdc); hMemDC2 = CreateCompatibleDC(hdc);
SelectObject(hMemDC, lpico->hBitmap); SelectObject(hMemDC, lpico->hBitmap);
...@@ -386,8 +388,7 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name) ...@@ -386,8 +388,7 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name)
BitBlt(hMemDC, 0, 0, bih->biWidth, bih->biHeight, hMemDC2, 0, 0, SRCINVERT); BitBlt(hMemDC, 0, 0, bih->biWidth, bih->biHeight, hMemDC2, 0, 0, SRCINVERT);
DeleteDC(hMemDC); DeleteDC(hMemDC);
DeleteDC(hMemDC2); DeleteDC(hMemDC2);
ReleaseDC(GetDesktopWindow(), hdc);
ReleaseDC(0, hdc);
return hIcon; return hIcon;
} }
...@@ -407,165 +408,6 @@ BOOL DestroyIcon(HICON hIcon) ...@@ -407,165 +408,6 @@ BOOL DestroyIcon(HICON hIcon)
/********************************************************************** /**********************************************************************
* LoadCursor [USER.173]
*/
HCURSOR LoadCursor(HANDLE instance, LPSTR cursor_name)
{
XColor bkcolor;
XColor fgcolor;
HCURSOR hCursor;
HANDLE rsc_mem;
WORD *lp;
CURSORDESCRIP *lpcurdesc;
CURSORALLOC *lpcur;
BITMAP BitMap;
HBITMAP hBitMap;
HDC hMemDC;
HDC hdc;
int i, j, image_size;
#ifdef DEBUG_RESOURCE
printf("LoadCursor: instance = %04x, name = %08x\n",
instance, cursor_name);
#endif
if (!(hdc = GetDC(GetDesktopWindow()))) return 0;
if (instance == (HANDLE)NULL) instance = hSysRes;
rsc_mem = RSC_LoadResource(instance, cursor_name, NE_RSCTYPE_GROUP_CURSOR,
&image_size);
if (rsc_mem == (HANDLE)NULL) {
printf("LoadCursor / Cursor %08X not Found !\n", cursor_name);
return 0;
}
lp = (WORD *)GlobalLock(rsc_mem);
if (lp == NULL) {
GlobalFree(rsc_mem);
return 0;
}
lpcurdesc = (CURSORDESCRIP *)(lp + 3);
#ifdef DEBUG_CURSOR
printf("LoadCursor / image_size=%d\n", image_size);
printf("LoadCursor / curReserved=%X\n", *lp);
printf("LoadCursor / curResourceType=%X\n", *(lp + 1));
printf("LoadCursor / curResourceCount=%X\n", *(lp + 2));
printf("LoadCursor / cursor Width=%d\n", (int)lpcurdesc->Width);
printf("LoadCursor / cursor Height=%d\n", (int)lpcurdesc->Height);
printf("LoadCursor / cursor curXHotspot=%d\n", (int)lpcurdesc->curXHotspot);
printf("LoadCursor / cursor curYHotspot=%d\n", (int)lpcurdesc->curYHotspot);
printf("LoadCursor / cursor curDIBSize=%lX\n", (DWORD)lpcurdesc->curDIBSize);
printf("LoadCursor / cursor curDIBOffset=%lX\n", (DWORD)lpcurdesc->curDIBOffset);
#endif
hCursor = GlobalAlloc(GMEM_MOVEABLE, sizeof(CURSORALLOC) + 1024L);
if (hCursor == (HCURSOR)NULL) {
GlobalFree(rsc_mem);
return 0;
}
printf("LoadCursor Alloc hCursor=%X\n", hCursor);
lpcur = (CURSORALLOC *)GlobalLock(hCursor);
lpcur->descriptor = *lpcurdesc;
GlobalUnlock(rsc_mem);
GlobalFree(rsc_mem);
rsc_mem = RSC_LoadResource(instance,
MAKEINTRESOURCE(lpcurdesc->curDIBOffset),
NE_RSCTYPE_CURSOR, &image_size);
if (rsc_mem == (HANDLE)NULL) {
printf("LoadCursor / Cursor %08X Bitmap not Found !\n", cursor_name);
return 0;
}
lp = (WORD *)GlobalLock(rsc_mem);
if (lp == NULL) {
GlobalFree(rsc_mem);
return 0;
}
lp += 2;
for (j = 0; j < 16; j++)
printf("%04X ", *(lp + j));
if (*lp == sizeof(BITMAPINFOHEADER))
lpcur->hBitmap = ConvertInfoBitmap(hdc, (BITMAPINFO *)lp);
else
lpcur->hBitmap = 0;
lp += sizeof(BITMAP);
for (i = 0; i < 81; i++) {
char temp = *((char *)lp + 162 + i);
*((char *)lp + 162 + i) = *((char *)lp + 324 - i);
*((char *)lp + 324 - i) = temp;
}
printf("LoadCursor / before XCreatePixmapFromBitmapData !\n");
lpcur->pixshape = XCreatePixmapFromBitmapData(
XT_display, DefaultRootWindow(XT_display),
((char *)lp + 211), 32, 32,
/*
lpcurdesc->Width / 2, lpcurdesc->Height / 4,
*/
WhitePixel(XT_display, DefaultScreen(XT_display)),
BlackPixel(XT_display, DefaultScreen(XT_display)), 1);
lpcur->pixmask = lpcur->pixshape;
bkcolor.pixel = WhitePixel(XT_display, DefaultScreen(XT_display));
fgcolor.pixel = BlackPixel(XT_display, DefaultScreen(XT_display));
printf("LoadCursor / before XCreatePixmapCursor !\n");
lpcur->xcursor = XCreatePixmapCursor(XT_display,
lpcur->pixshape, lpcur->pixmask,
&fgcolor, &bkcolor, lpcur->descriptor.curXHotspot,
lpcur->descriptor.curYHotspot);
ReleaseDC(0, hdc);
GlobalUnlock(rsc_mem);
GlobalFree(rsc_mem);
return hCursor;
}
/**********************************************************************
* DestroyCursor [USER.458]
*/
BOOL DestroyCursor(HCURSOR hCursor)
{
CURSORALLOC *lpcur;
if (hCursor == (HCURSOR)NULL) return FALSE;
lpcur = (CURSORALLOC *)GlobalLock(hCursor);
if (lpcur->hBitmap != (HBITMAP)NULL) DeleteObject(lpcur->hBitmap);
GlobalUnlock(hCursor);
GlobalFree(hCursor);
return TRUE;
}
/**********************************************************************
* SetCursor [USER.69]
*/
HCURSOR SetCursor(HCURSOR hCursor)
{
HDC hDC;
HDC hMemDC;
BITMAP bm;
CURSORALLOC *lpcur;
HCURSOR hOldCursor;
#ifdef DEBUG_CURSOR
printf("SetCursor / hCursor=%04X !\n", hCursor);
#endif
if (hCursor == (HCURSOR)NULL) return FALSE;
lpcur = (CURSORALLOC *)GlobalLock(hCursor);
hOldCursor = hActiveCursor;
printf("SetCursor / before XDefineCursor !\n");
XDefineCursor(XT_display, DefaultRootWindow(XT_display), lpcur->xcursor);
GlobalUnlock(hCursor);
hActiveCursor = hCursor;
return hOldCursor;
}
/**********************************************************************
* ShowCursor [USER.71]
*/
int ShowCursor(BOOL bShow)
{
if (bShow) {
}
return 0;
}
/**********************************************************************
* LoadAccelerators * LoadAccelerators
*/ */
HANDLE HANDLE
...@@ -586,6 +428,10 @@ HANDLE FindResource(HANDLE instance, LPSTR resource_name, LPSTR type_name) ...@@ -586,6 +428,10 @@ HANDLE FindResource(HANDLE instance, LPSTR resource_name, LPSTR type_name)
if (instance == 0) if (instance == 0)
return 0; return 0;
#ifdef DEBUG_RESOURCE
printf("FindResource hInst=%04X typename=%08X resname=%08X\n",
instance, type_name, resource_name);
#endif
if (OpenResourceFile(instance) < 0) if (OpenResourceFile(instance) < 0)
return 0; return 0;
...@@ -644,6 +490,8 @@ HANDLE LoadResource(HANDLE instance, HANDLE hResInfo) ...@@ -644,6 +490,8 @@ HANDLE LoadResource(HANDLE instance, HANDLE hResInfo)
h = r->rsc_mem = GlobalAlloc(GMEM_MOVEABLE, image_size); h = r->rsc_mem = GlobalAlloc(GMEM_MOVEABLE, image_size);
image = GlobalLock(h); image = GlobalLock(h);
lseek(ResourceFd, ((int) r->nameinfo.offset << r->size_shift), SEEK_SET);
if (image == NULL || read(ResourceFd, image, image_size) != image_size) if (image == NULL || read(ResourceFd, image, image_size) != image_size)
{ {
GlobalFree(h); GlobalFree(h);
......
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#ifdef __NetBSD__
#include <sys/syscall.h>
#else
#include <syscall.h> #include <syscall.h>
#endif
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
#ifdef linux #ifdef linux
...@@ -85,11 +89,11 @@ static void win_fault(int signal, int code, struct sigcontext *scp){ ...@@ -85,11 +89,11 @@ static void win_fault(int signal, int code, struct sigcontext *scp){
if(!do_int21(scp)) goto oops; if(!do_int21(scp)) goto oops;
break; break;
case 0x11: case 0x11:
scp->sc_eax = 0x00000000; /* get equipment list: we haven't */ scp->sc_eax = (scp->sc_eax & 0xffff0000L) | DOS_GetEquipment();
break; /* got anything */ break;
case 0x12: case 0x12:
scp->sc_eax = 640L; /* get base mem size */ scp->sc_eax = (scp->sc_eax & 0xffff0000L) | 640L;
break; break; /* get base mem size */
case 0x1A: case 0x1A:
if(!do_int1A(scp)) goto oops; if(!do_int1A(scp)) goto oops;
break; break;
......
...@@ -28,11 +28,14 @@ extern void CallTo32(); ...@@ -28,11 +28,14 @@ extern void CallTo32();
char * GetModuleName(struct w_files * wpnt, int index, char *buffer); char * GetModuleName(struct w_files * wpnt, int index, char *buffer);
extern unsigned char ran_out; extern unsigned char ran_out;
extern char WindowsPath[256];
unsigned short WIN_StackSize; unsigned short WIN_StackSize;
unsigned short WIN_HeapSize; unsigned short WIN_HeapSize;
struct w_files * wine_files = NULL; struct w_files * wine_files = NULL;
int WineForceFail = 0;
char **Argv; char **Argv;
int Argc; int Argc;
struct mz_header_s *CurrentMZHeader; struct mz_header_s *CurrentMZHeader;
...@@ -40,11 +43,9 @@ struct ne_header_s *CurrentNEHeader; ...@@ -40,11 +43,9 @@ struct ne_header_s *CurrentNEHeader;
int CurrentNEFile; int CurrentNEFile;
HINSTANCE hSysRes; HINSTANCE hSysRes;
static char *dllExtensions[] = { "dll", "exe", NULL }; static char *Extensions[] = { "dll", "exe", NULL };
static char *exeExtensions[] = { "exe", NULL };
static char *WinePath = NULL; static char *WinePath = NULL;
/********************************************************************** /**********************************************************************
* DebugPrintString * DebugPrintString
*/ */
...@@ -101,12 +102,13 @@ GetFileInfo(unsigned short instance) ...@@ -101,12 +102,13 @@ GetFileInfo(unsigned short instance)
* LoadImage * LoadImage
* Load one NE format executable into memory * Load one NE format executable into memory
*/ */
HINSTANCE LoadImage(char * filename, char * modulename) HINSTANCE LoadImage(char *modulename)
{ {
unsigned int read_size; unsigned int read_size;
int i; int i;
struct w_files * wpnt, *wpnt1; struct w_files * wpnt, *wpnt1;
unsigned int status; unsigned int status;
char buffer[256];
/* First allocate a spot to store the info we collect, and add it to /* First allocate a spot to store the info we collect, and add it to
* our linked list. * our linked list.
...@@ -123,9 +125,23 @@ HINSTANCE LoadImage(char * filename, char * modulename) ...@@ -123,9 +125,23 @@ HINSTANCE LoadImage(char * filename, char * modulename)
wpnt->next = NULL; wpnt->next = NULL;
/* /*
* search file
*/
if (FindFile(buffer, sizeof(buffer), modulename, Extensions, WindowsPath)
==NULL)
{
char temp[256];
sprintf(temp,"LoadImage: I can't find %s !\n",modulename);
myerror(temp);
}
fprintf(stderr,"LoadImage: loading %s (%s)\n", modulename, buffer);
/*
* Open file for reading. * Open file for reading.
*/ */
wpnt->fd = open(filename, O_RDONLY); wpnt->fd = open(buffer, O_RDONLY);
if (wpnt->fd < 0) if (wpnt->fd < 0)
{ {
myerror(NULL); myerror(NULL);
...@@ -133,7 +149,7 @@ HINSTANCE LoadImage(char * filename, char * modulename) ...@@ -133,7 +149,7 @@ HINSTANCE LoadImage(char * filename, char * modulename)
/* /*
* Establish header pointers. * Establish header pointers.
*/ */
wpnt->filename = strdup(filename); wpnt->filename = strdup(buffer);
wpnt->name = NULL; wpnt->name = NULL;
if(modulename) wpnt->name = strdup(modulename); if(modulename) wpnt->name = strdup(modulename);
...@@ -181,7 +197,7 @@ HINSTANCE LoadImage(char * filename, char * modulename) ...@@ -181,7 +197,7 @@ HINSTANCE LoadImage(char * filename, char * modulename)
wpnt->selector_table = CreateSelectors(wpnt); wpnt->selector_table = CreateSelectors(wpnt);
wpnt->hinstance wpnt->hinstance
= wpnt-> = wpnt->
selector_table[wine_files->ne_header->auto_data_seg-1].selector; selector_table[wpnt->ne_header->auto_data_seg-1].selector;
/* Get the lookup table. This is used for looking up the addresses /* Get the lookup table. This is used for looking up the addresses
of functions that are exported */ of functions that are exported */
...@@ -227,16 +243,10 @@ HINSTANCE LoadImage(char * filename, char * modulename) ...@@ -227,16 +243,10 @@ HINSTANCE LoadImage(char * filename, char * modulename)
if(FindDLLTable(buff)) continue; /* This module already loaded */ if(FindDLLTable(buff)) continue; /* This module already loaded */
if (FindFileInPath(buff2, sizeof(buff2), LoadImage(buff);
buff, dllExtensions, WinePath) != NULL && /*
(fd = open(buff2, O_RDONLY)) >= 0)
{
close(fd);
LoadImage(buff2, buff);
continue;
}
fprintf(stderr,"Unable to load:%s\n", buff); fprintf(stderr,"Unable to load:%s\n", buff);
*/
} }
return(wpnt->hinstance); return(wpnt->hinstance);
} }
...@@ -249,6 +259,8 @@ _WinMain(int argc, char **argv) ...@@ -249,6 +259,8 @@ _WinMain(int argc, char **argv)
{ {
int segment; int segment;
char *p; char *p;
char *sysresname;
char syspath[256];
char exe_path[256]; char exe_path[256];
#ifdef WINESTAT #ifdef WINESTAT
char * cp; char * cp;
...@@ -273,19 +285,20 @@ _WinMain(int argc, char **argv) ...@@ -273,19 +285,20 @@ _WinMain(int argc, char **argv)
strcat(WinePath, ";"); strcat(WinePath, ";");
strcat(WinePath, p); strcat(WinePath, p);
if (FindFileInPath(exe_path, 256, argv[1], exeExtensions, WinePath) LoadImage(argv[1]);
== NULL) hSysRes = LoadImage("sysres.dll");
{ if (hSysRes == (HINSTANCE)NULL)
fprintf(stderr, "Could not find file '%s'\n", argv[1]); printf("Error Loading System Resources !!!\n");
exit(1); else
} printf("System Resources Loaded // hSysRes='%04X'\n", hSysRes);
LoadImage(exe_path, NULL);
hSysRes = LoadImage("sysres.dll", NULL);
if(ran_out) exit(1); if(ran_out) exit(1);
#ifdef DEBUG #ifdef DEBUG
GetEntryDLLName("USER", "INITAPP", 0, 0); {
int dummy1, dummy2;
GetEntryDLLName("USER", "INITAPP", &dummy1, &dummy2);
}
for(i=0; i<1024; i++) { for(i=0; i<1024; i++) {
int j; int j;
j = GetEntryPointFromOrdinal(wine_files, i); j = GetEntryPointFromOrdinal(wine_files, i);
...@@ -327,6 +340,21 @@ _WinMain(int argc, char **argv) ...@@ -327,6 +340,21 @@ _WinMain(int argc, char **argv)
init_wine_signals(); init_wine_signals();
if (WineForceFail)
{
p = (char *) ((cs_reg << 16) | ip_reg);
*p++ = 0xcd;
*p++ = 0x20;
}
if (ss_reg == 0)
{
fprintf(stderr, "SS is 0. Send email to bob@amscons.com.\n");
fprintf(stderr, " No. Really. I want to know what programs\n");
fprintf(stderr, " do this.\n");
}
rv = CallToInit16(cs_reg << 16 | ip_reg, ss_reg << 16 | sp_reg, ds_reg); rv = CallToInit16(cs_reg << 16 | ip_reg, ss_reg << 16 | sp_reg, ds_reg);
printf ("rv = %x\n", rv); printf ("rv = %x\n", rv);
} }
...@@ -392,12 +420,11 @@ GetModuleName(struct w_files * wpnt, int index, char *buffer) ...@@ -392,12 +420,11 @@ GetModuleName(struct w_files * wpnt, int index, char *buffer)
int int
FixupSegment(struct w_files * wpnt, int segment_num) FixupSegment(struct w_files * wpnt, int segment_num)
{ {
int fd = wpnt->fd; int fd = wpnt->fd;
struct mz_header_s * mz_header = wpnt->mz_header; struct mz_header_s * mz_header = wpnt->mz_header;
struct ne_header_s *ne_header = wpnt->ne_header; struct ne_header_s *ne_header = wpnt->ne_header;
struct ne_segment_table_entry_s *seg_table = wpnt->seg_table; struct ne_segment_table_entry_s *seg_table = wpnt->seg_table;
struct segment_descriptor_s *selector_table = wpnt->selector_table; struct segment_descriptor_s *selector_table = wpnt->selector_table;
struct relocation_entry_s *rep, *rep1; struct relocation_entry_s *rep, *rep1;
struct ne_segment_table_entry_s *seg; struct ne_segment_table_entry_s *seg;
struct segment_descriptor_s *sel; struct segment_descriptor_s *sel;
...@@ -410,10 +437,14 @@ FixupSegment(struct w_files * wpnt, int segment_num) ...@@ -410,10 +437,14 @@ FixupSegment(struct w_files * wpnt, int segment_num)
char dll_name[257]; char dll_name[257];
char func_name[257]; char func_name[257];
int i, n_entries; int i, n_entries;
int additive;
seg = &seg_table[segment_num]; seg = &seg_table[segment_num];
sel = &selector_table[segment_num]; sel = &selector_table[segment_num];
fprintf(stderr, "Segment fixups for %s, segment %d, selector %x\n",
wpnt->name, segment_num, (int) sel->base_addr >> 16);
if ((seg->seg_data_offset == 0) || if ((seg->seg_data_offset == 0) ||
!(seg->seg_flags & NE_SEGFLAGS_RELOC_DATA)) !(seg->seg_flags & NE_SEGFLAGS_RELOC_DATA))
return 0; return 0;
...@@ -445,8 +476,13 @@ FixupSegment(struct w_files * wpnt, int segment_num) ...@@ -445,8 +476,13 @@ FixupSegment(struct w_files * wpnt, int segment_num)
/* /*
* Get the target address corresponding to this entry. * Get the target address corresponding to this entry.
*/ */
additive = 0;
switch (rep->relocation_type) switch (rep->relocation_type)
{ {
case NE_RELTYPE_ORDINALADD:
additive = 1;
case NE_RELTYPE_ORDINAL: case NE_RELTYPE_ORDINAL:
if (GetModuleName(wpnt, rep->target1, if (GetModuleName(wpnt, rep->target1,
dll_name) == NULL) dll_name) == NULL)
...@@ -474,6 +510,9 @@ FixupSegment(struct w_files * wpnt, int segment_num) ...@@ -474,6 +510,9 @@ FixupSegment(struct w_files * wpnt, int segment_num)
#endif #endif
break; break;
case NE_RELTYPE_NAMEADD:
additive = 1;
case NE_RELTYPE_NAME: case NE_RELTYPE_NAME:
if (GetModuleName(wpnt, rep->target1, dll_name) if (GetModuleName(wpnt, rep->target1, dll_name)
== NULL) == NULL)
...@@ -543,30 +582,50 @@ FixupSegment(struct w_files * wpnt, int segment_num) ...@@ -543,30 +582,50 @@ FixupSegment(struct w_files * wpnt, int segment_num)
continue; continue;
default: default:
#ifndef DEBUG_FIXUP
fprintf(stderr,"%d: ADDR TYPE %d, TYPE %d, OFFSET %04.4x, ", fprintf(stderr,"%d: ADDR TYPE %d, TYPE %d, OFFSET %04.4x, ",
i + 1, rep->address_type, rep->relocation_type, i + 1, rep->address_type, rep->relocation_type,
rep->offset); rep->offset);
fprintf(stderr,"TARGET %04.4x %04.4x\n", rep->target1, rep->target2); fprintf(stderr,"TARGET %04.4x %04.4x\n",
#endif rep->target1, rep->target2);
free(rep1); free(rep1);
return -1; return -1;
#if 0
sp = (unsigned short *) ((char *) sel->base_addr + rep->offset);
fprintf(stderr, " FIXUP ADDRESS %04.4x:%04.4x\n",
(int) sel->base_addr >> 16, rep->offset);
WineForceFail = 1;
continue;
#endif
} }
/* /*
* Stuff the right size result in. * Stuff the right size result in.
*/ */
sp = (unsigned short *) ((char *) sel->base_addr + rep->offset); sp = (unsigned short *) ((char *) sel->base_addr + rep->offset);
if (additive)
{
if (FindDLLTable(dll_name) == NULL)
additive = 2;
fprintf(stderr,"%d: ADDR TYPE %d, TYPE %d, OFFSET %04.4x, ",
i + 1, rep->address_type, rep->relocation_type,
rep->offset);
fprintf(stderr,"TARGET %04.4x %04.4x\n",
rep->target1, rep->target2);
fprintf(stderr, " Additive = %d\n", additive);
}
switch (rep->address_type) switch (rep->address_type)
{ {
case NE_RADDR_OFFSET16: case NE_RADDR_OFFSET16:
do { do {
next_addr = *sp; next_addr = *sp;
*sp = (unsigned short) address; *sp = (unsigned short) address;
if (additive == 2)
*sp += next_addr;
sp = (unsigned short *) ((char *) sel->base_addr + next_addr); sp = (unsigned short *) ((char *) sel->base_addr + next_addr);
} }
while (next_addr != 0xffff); while (next_addr != 0xffff && !additive);
break; break;
...@@ -574,10 +633,12 @@ FixupSegment(struct w_files * wpnt, int segment_num) ...@@ -574,10 +633,12 @@ FixupSegment(struct w_files * wpnt, int segment_num)
do { do {
next_addr = *sp; next_addr = *sp;
*sp = (unsigned short) address; *sp = (unsigned short) address;
if (additive == 2)
*sp += next_addr;
*(sp+1) = (unsigned short) selector; *(sp+1) = (unsigned short) selector;
sp = (unsigned short *) ((char *) sel->base_addr + next_addr); sp = (unsigned short *) ((char *) sel->base_addr + next_addr);
} }
while (next_addr != 0xffff); while (next_addr != 0xffff && !additive);
break; break;
...@@ -589,17 +650,15 @@ FixupSegment(struct w_files * wpnt, int segment_num) ...@@ -589,17 +650,15 @@ FixupSegment(struct w_files * wpnt, int segment_num)
if (rep->relocation_type == NE_RELTYPE_INT1) break; if (rep->relocation_type == NE_RELTYPE_INT1) break;
} }
while (next_addr != 0xffff); while (next_addr != 0xffff && !additive);
break; break;
default: default:
#ifndef DEBUG_FIXUP
printf("%d: ADDR TYPE %d, TYPE %d, OFFSET %04.4x, ", printf("%d: ADDR TYPE %d, TYPE %d, OFFSET %04.4x, ",
i + 1, rep->address_type, rep->relocation_type, i + 1, rep->address_type, rep->relocation_type,
rep->offset); rep->offset);
printf("TARGET %04.4x %04.4x\n", rep->target1, rep->target2); printf("TARGET %04.4x %04.4x\n", rep->target1, rep->target2);
#endif
free(rep1); free(rep1);
return -1; return -1;
} }
......
#include "../Wine.tmpl"
MODULE = memory
SRCS = \
global.c \
heap.c \
atom.c
OBJS = \
global.o \
heap.o \
atom.o
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
includes::
install::
CFLAGS=$(COPTS) $(DEBUGOPTS) -I$(INCLUDE_DIR) CFLAGS=$(COPTS) $(DEBUGOPTS) -I$(INCLUDE_DIR)
OBJS=global.o heap.o OBJS=global.o heap.o atom.o
default: memory.o default: memory.o
......
/*
* Atom table functions
*
* Copyright 1993 Alexandre Julliard
*/
/*
* Current limitations:
*
* - This code should work fine when called from the emulation library,
* but probably not when called from the Windows program. The reason
* is that everything is allocated on the current local heap, instead
* of taking into account the DS register. Correcting this will also
* require some changes in the local heap management to bring it closer
* to Windows.
*
* - The code assumes that LocalAlloc() returns a block aligned on a
* 4-bytes boundary (because of the shifting done in HANDLETOATOM).
* If this is not the case, the allocation code will have to be changed.
*
* - Integer atoms created with MAKEINTATOM are not supported. This is
* because they can't generally be differentiated from string constants
* located below 0x10000 in the emulation library. If you need
* integer atoms, use the "#1234" form.
*/
#include <stdlib.h>
#include <string.h>
#include "atom.h"
#define DEFAULT_ATOMTABLE_SIZE 37
#define MIN_STR_ATOM 0xc000
#define ATOMTOHANDLE(atom) ((HANDLE)(atom) << 2)
#define HANDLETOATOM(handle) ((ATOM)(0xc000 | ((handle) >> 2)))
static ATOMTABLE * localTable = NULL;
static ATOMTABLE * globalTable = NULL;
/***********************************************************************
* ATOM_InitTable
*/
static BOOL ATOM_InitTable( ATOMTABLE ** table, WORD entries )
{
int i;
HANDLE handle;
handle = LocalAlloc( LMEM_MOVEABLE, sizeof(ATOMTABLE) +
(entries-1) * sizeof(HANDLE) );
if (!handle) return FALSE;
*table = (ATOMTABLE *) LocalLock( handle );
(*table)->size = entries;
for (i = 0; i < entries; i++) (*table)->entries[i] = 0;
return TRUE;
}
/***********************************************************************
* ATOM_Init
*
* Global table initialisation.
*/
BOOL ATOM_Init()
{
return ATOM_InitTable( &globalTable, DEFAULT_ATOMTABLE_SIZE );
}
/***********************************************************************
* ATOM_MakePtr
*
* Make an ATOMENTRY pointer from a handle (obtained from GetAtomHandle()).
* Is is assumed that the atom is in the same segment as the table.
*/
static ATOMENTRY * ATOM_MakePtr( ATOMTABLE * table, HANDLE handle )
{
return (ATOMENTRY *) (((int)table & 0xffff0000) | (int)handle);
}
/***********************************************************************
* ATOM_Hash
*/
static WORD ATOM_Hash( WORD entries, LPCSTR str, WORD len )
{
WORD i, hash = 0;
for (i = 0; i < len; i++) hash ^= str[i] + i;
return hash % entries;
}
/***********************************************************************
* ATOM_AddAtom
*/
static ATOM ATOM_AddAtom( ATOMTABLE * table, LPCSTR str )
{
WORD hash;
HANDLE entry;
ATOMENTRY * entryPtr;
int len;
if ((len = strlen( str )) > 255) len = 255;
/* Check for integer atom */
/* if (!((int)str & 0xffff0000)) return (ATOM)((int)str & 0xffff); */
if (str[0] == '#') return atoi( &str[1] );
hash = ATOM_Hash( table->size, str, len );
entry = table->entries[hash];
while (entry)
{
entryPtr = ATOM_MakePtr( table, entry );
if ((entryPtr->length == len) &&
(!strncasecmp( entryPtr->str, str, len )))
{
entryPtr->refCount++;
return HANDLETOATOM( entry );
}
entry = entryPtr->next;
}
entry = (int)LocalAlloc( LMEM_MOVEABLE, sizeof(ATOMENTRY)+len-1 ) & 0xffff;
if (!entry) return 0;
entryPtr = ATOM_MakePtr( table, entry );
entryPtr->next = table->entries[hash];
entryPtr->refCount = 1;
entryPtr->length = len;
memcpy( entryPtr->str, str, len );
table->entries[hash] = entry;
return HANDLETOATOM( entry );
}
/***********************************************************************
* ATOM_DeleteAtom
*/
static ATOM ATOM_DeleteAtom( ATOMTABLE * table, ATOM atom )
{
ATOMENTRY * entryPtr;
HANDLE entry, *prevEntry;
WORD hash;
if (atom < MIN_STR_ATOM) return 0; /* Integer atom */
entry = ATOMTOHANDLE( atom );
entryPtr = ATOM_MakePtr( table, entry );
/* Find previous atom */
hash = ATOM_Hash( table->size, entryPtr->str, entryPtr->length );
prevEntry = &table->entries[hash];
while (*prevEntry && *prevEntry != entry)
{
ATOMENTRY * prevEntryPtr = ATOM_MakePtr( table, *prevEntry );
prevEntry = &prevEntryPtr->next;
}
if (!*prevEntry) return atom;
/* Delete atom */
if (--entryPtr->refCount == 0)
{
*prevEntry = entryPtr->next;
LocalFree( entry );
}
return 0;
}
/***********************************************************************
* ATOM_FindAtom
*/
static ATOM ATOM_FindAtom( ATOMTABLE * table, LPCSTR str )
{
WORD hash;
HANDLE entry;
int len;
if ((len = strlen( str )) > 255) len = 255;
/* Check for integer atom */
/* if (!((int)str & 0xffff0000)) return (ATOM)((int)str & 0xffff); */
if (str[0] == '#') return atoi( &str[1] );
hash = ATOM_Hash( table->size, str, len );
entry = table->entries[hash];
while (entry)
{
ATOMENTRY * entryPtr = ATOM_MakePtr( table, entry );
if ((entryPtr->length == len) &&
(!strncasecmp( entryPtr->str, str, len )))
return HANDLETOATOM( entry );
entry = entryPtr->next;
}
return 0;
}
/***********************************************************************
* ATOM_GetAtomName
*/
static WORD ATOM_GetAtomName( ATOMTABLE * table, ATOM atom,
LPSTR buffer, short count )
{
ATOMENTRY * entryPtr;
HANDLE entry;
char * strPtr;
int len;
char text[8];
if (!count) return 0;
if (atom < MIN_STR_ATOM)
{
sprintf( text, "#%d", atom );
len = strlen(text);
strPtr = text;
}
else
{
entry = ATOMTOHANDLE( atom );
entryPtr = ATOM_MakePtr( table, entry );
len = entryPtr->length;
strPtr = entryPtr->str;
}
if (len >= count) len = count-1;
memcpy( buffer, strPtr, len );
buffer[len] = '\0';
return len;
}
/***********************************************************************
* InitAtomTable (KERNEL.68)
*/
BOOL InitAtomTable( WORD entries )
{
return ATOM_InitTable( &localTable, entries );
}
/***********************************************************************
* GetAtomHandle (KERNEL.73)
*/
HANDLE GetAtomHandle( ATOM atom )
{
if (atom < MIN_STR_ATOM) return 0;
return ATOMTOHANDLE( atom );
}
/***********************************************************************
* AddAtom (KERNEL.70)
*/
ATOM AddAtom( LPCSTR str )
{
if (!localTable) InitAtomTable( DEFAULT_ATOMTABLE_SIZE );
return ATOM_AddAtom( localTable, str );
}
/***********************************************************************
* DeleteAtom (KERNEL.71)
*/
ATOM DeleteAtom( ATOM atom )
{
if (!localTable) InitAtomTable( DEFAULT_ATOMTABLE_SIZE );
return ATOM_DeleteAtom( localTable, atom );
}
/***********************************************************************
* FindAtom (KERNEL.69)
*/
ATOM FindAtom( LPCSTR str )
{
if (!localTable) InitAtomTable( DEFAULT_ATOMTABLE_SIZE );
return ATOM_FindAtom( localTable, str );
}
/***********************************************************************
* GetAtomName (KERNEL.72)
*/
WORD GetAtomName( ATOM atom, LPSTR buffer, short count )
{
if (!localTable) InitAtomTable( DEFAULT_ATOMTABLE_SIZE );
return ATOM_GetAtomName( localTable, atom, buffer, count );
}
/***********************************************************************
* GlobalAddAtom (USER.268)
*/
ATOM GlobalAddAtom( LPCSTR str )
{
return ATOM_AddAtom( globalTable, str );
}
/***********************************************************************
* GlobalDeleteAtom (USER.269)
*/
ATOM GlobalDeleteAtom( ATOM atom )
{
return ATOM_DeleteAtom( globalTable, atom );
}
/***********************************************************************
* GlobalFindAtom (USER.270)
*/
ATOM GlobalFindAtom( LPCSTR str )
{
return ATOM_FindAtom( globalTable, str );
}
/***********************************************************************
* GlobalGetAtomName (USER.271)
*/
WORD GlobalGetAtomName( ATOM atom, LPSTR buffer, short count )
{
return ATOM_GetAtomName( globalTable, atom, buffer, count );
}
...@@ -75,7 +75,7 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments) ...@@ -75,7 +75,7 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments)
else if (count) else if (count)
count = 0; count = 0;
} }
/* /*
* If we couldn't find enough segments, then we need to create some. * If we couldn't find enough segments, then we need to create some.
*/ */
...@@ -87,18 +87,22 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments) ...@@ -87,18 +87,22 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments)
g_prev = NULL; g_prev = NULL;
for (g = GlobalList; g != NULL; g = g->next) for (g = GlobalList; g != NULL; g = g->next)
g_prev = g; g_prev = g;
/* /*
* Allocate segments. * Allocate segments.
*/ */
for (count = 0; count < n_segments; count++) for (count = 0; count < n_segments; count++)
{ {
s = GetNextSegment(flags, 0x10000); s = GetNextSegment(flags, 0x10000);
if (s == NULL) if (s == NULL) {
printf("GlobalGetFreeSegments // bad GetNextSegment !\n");
return NULL; return NULL;
}
g = (GDESC *) malloc(sizeof(*g)); g = (GDESC *) malloc(sizeof(*g));
if (g == NULL) {
printf("GlobalGetFreeSegments // bad GDESC malloc !\n");
return NULL;
}
g->prev = g_prev; g->prev = g_prev;
g->next = NULL; g->next = NULL;
g->handle = s->selector; g->handle = s->selector;
...@@ -110,18 +114,15 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments) ...@@ -110,18 +114,15 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments)
else else
g->lock_count = 0; g->lock_count = 0;
free(s); if (count == 0) g_start = g;
if (count == 0)
g_start = g;
if (g_prev != NULL) if (g_prev != NULL)
{ {
g_prev->next = g; g_prev->next = g;
g->prev = g_prev;
} }
else else
GlobalList = g; GlobalList = g;
g_prev = g;
} }
} }
...@@ -131,6 +132,10 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments) ...@@ -131,6 +132,10 @@ GlobalGetFreeSegments(unsigned int flags, int n_segments)
g = g_start; g = g_start;
for (i = 0; i < n_segments; i++, g = g->next) for (i = 0; i < n_segments; i++, g = g->next)
{ {
if (g == NULL) {
printf("GlobalGetFreeSegments // bad Segments chain !\n");
return NULL;
}
g->sequence = i + 1; g->sequence = i + 1;
g->length = n_segments; g->length = n_segments;
} }
......
#include "../Wine.tmpl"
MODULE = misc
SRCS = \
kernel.c \
user.c \
rect.c \
file.c \
sound.c \
emulate.c \
keyboard.c \
profile.c \
lstr.c \
exec.c \
message.c \
int1a.c \
int21.c \
dos_fs.c \
xt.c
OBJS = \
kernel.o \
user.o \
rect.o \
file.o \
sound.o \
emulate.o \
keyboard.o \
profile.o \
lstr.o \
exec.o \
message.o \
int1a.o \
int21.o \
dos_fs.o \
xt.o
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
includes::
install::
CFLAGS=$(COPTS) $(DEBUGOPTS) -I$(INCLUDE_DIR) CFLAGS=$(COPTS) $(DEBUGOPTS) -I../include
OBJS=dos.o kernel.o user.o xt.o rect.o file.o sound.o emulate.o \ OBJS=kernel.o user.o xt.o rect.o file.o sound.o emulate.o \
keyboard.o profile.o lstr.o exec.o message.o keyboard.o profile.o lstr.o exec.o message.o int1a.o int21.o \
dos_fs.o comm.o
default: misc.o default: misc.o
......
This diff is collapsed. Click to expand it.
static char RCSId[] = "$Id$";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "prototypes.h"
#include "regfunc.h"
static void
GetTimeDate(int time_flag)
{
struct tm *now;
time_t ltime;
ltime = time(NULL);
now = localtime(&ltime);
if (time_flag)
{
_CX = (now->tm_hour << 8) | now->tm_min;
_DX = now->tm_sec << 8;
}
else
{
_CX = now->tm_year + 1900;
_DX = ((now->tm_mon + 1) << 8) | now->tm_mday;
_AX &= 0xff00;
_AX |= now->tm_wday;
}
#ifdef DEBUG_DOS
printf("GetTimeDate: AX = %04x, CX = %04x, DX = %04x\n", _AX, _CX, _DX);
#endif
ReturnFromRegisterFunc();
/* Function does not return */
}
/**********************************************************************
* KERNEL_DOS3Call
*/
int
KERNEL_DOS3Call()
{
switch ((_AX >> 8) & 0xff)
{
case 0x30:
_AX = 0x0303;
ReturnFromRegisterFunc();
/* Function does not return */
case 0x25:
case 0x35:
return 0;
case 0x2a:
GetTimeDate(0);
/* Function does not return */
case 0x2c:
GetTimeDate(1);
/* Function does not return */
case 0x4c:
exit(_AX & 0xff);
default:
fprintf(stderr, "DOS: AX %04x, BX %04x, CX %04x, DX %04x\n",
_AX, _BX, _CX, _DX);
fprintf(stderr, " SP %04x, BP %04x, SI %04x, DI %04x\n",
_SP, _BP, _SI, _DI);
fprintf(stderr, " DS %04x, ES %04x\n",
_DS, _ES);
}
return 0;
}
This diff is collapsed. Click to expand it.
...@@ -51,7 +51,7 @@ int do_int1A(struct sigcontext_struct * context){ ...@@ -51,7 +51,7 @@ int do_int1A(struct sigcontext_struct * context){
break; break;
default: default:
fprintf(stderr,"Unable to handle int 0x1A AX %x\n", context->sc_eax); fprintf(stderr,"Unable to handle int 0x1A AX %04x\n", context->sc_eax & 0xffffL);
return 1; return 1;
}; };
return 1; return 1;
......
...@@ -21,6 +21,8 @@ typedef struct tagMSGBOX { ...@@ -21,6 +21,8 @@ typedef struct tagMSGBOX {
HWND hWndNo; HWND hWndNo;
HWND hWndCancel; HWND hWndCancel;
HICON hIcon; HICON hIcon;
RECT rectIcon;
RECT rectStr;
} MSGBOX; } MSGBOX;
typedef MSGBOX FAR* LPMSGBOX; typedef MSGBOX FAR* LPMSGBOX;
...@@ -46,7 +48,7 @@ int MessageBox( HWND hWnd, LPSTR str, LPSTR title, WORD type ) ...@@ -46,7 +48,7 @@ int MessageBox( HWND hWnd, LPSTR str, LPSTR title, WORD type )
wndClass.cbWndExtra = 0; wndClass.cbWndExtra = 0;
wndClass.hInstance = wndPtr->hInstance; wndClass.hInstance = wndPtr->hInstance;
wndClass.hIcon = (HICON)NULL; wndClass.hIcon = (HICON)NULL;
wndClass.hCursor = LoadCursor((HANDLE)NULL, IDC_ARROW); wndClass.hCursor = LoadCursor((HANDLE)NULL, IDC_ARROW);
wndClass.hbrBackground = GetStockObject(WHITE_BRUSH); wndClass.hbrBackground = GetStockObject(WHITE_BRUSH);
wndClass.lpszMenuName = NULL; wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = "MESSAGEBOX"; wndClass.lpszClassName = "MESSAGEBOX";
...@@ -57,7 +59,7 @@ int MessageBox( HWND hWnd, LPSTR str, LPSTR title, WORD type ) ...@@ -57,7 +59,7 @@ int MessageBox( HWND hWnd, LPSTR str, LPSTR title, WORD type )
mb.wType = type; mb.wType = type;
mb.ActiveFlg = TRUE; mb.ActiveFlg = TRUE;
hDlg = CreateWindow("MESSAGEBOX", title, hDlg = CreateWindow("MESSAGEBOX", title,
WS_POPUP | WS_DLGFRAME | WS_VISIBLE, 100, 150, 320, 120, WS_POPUP | WS_DLGFRAME | WS_VISIBLE, 100, 150, 400, 120,
(HWND)NULL, (HMENU)NULL, wndPtr->hInstance, (LPSTR)&mb); (HWND)NULL, (HMENU)NULL, wndPtr->hInstance, (LPSTR)&mb);
if (hDlg == 0) return 0; if (hDlg == 0) return 0;
while(TRUE) { while(TRUE) {
...@@ -113,47 +115,63 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam) ...@@ -113,47 +115,63 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
*((LPMSGBOX *)&wndPtr->wExtra[1]) = lpmbInit; *((LPMSGBOX *)&wndPtr->wExtra[1]) = lpmbInit;
lpmb = MsgBoxGetStorageHeader(hWnd); lpmb = MsgBoxGetStorageHeader(hWnd);
GetClientRect(hWnd, &rect); GetClientRect(hWnd, &rect);
CopyRect(&lpmb->rectStr, &rect);
lpmb->rectStr.bottom -= 32;
switch(lpmb->wType & MB_TYPEMASK) { switch(lpmb->wType & MB_TYPEMASK) {
case MB_OK : case MB_OK :
lpmb->hWndYes = CreateWindow("BUTTON", "&Ok", lpmb->hWndYes = CreateWindow("BUTTON", "&Ok",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON, WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 70, rect.bottom - 25, rect.right / 2 - 30, rect.bottom - 25,
60, 18, hWnd, 1, wndPtr->hInstance, 0L); 60, 18, hWnd, 1, wndPtr->hInstance, 0L);
break; break;
case MB_OKCANCEL : case MB_OKCANCEL :
lpmb->hWndYes = CreateWindow("BUTTON", "&Ok", lpmb->hWndYes = CreateWindow("BUTTON", "&Ok",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON, WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 70, rect.bottom - 25, rect.right / 2 - 65, rect.bottom - 25,
60, 18, hWnd, 1, wndPtr->hInstance, 0L); 60, 18, hWnd, 1, wndPtr->hInstance, 0L);
lpmb->hWndCancel = CreateWindow("BUTTON", "&Cancel", lpmb->hWndCancel = CreateWindow("BUTTON", "&Cancel",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON, WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 10, rect.bottom - 25, rect.right / 2 + 5, rect.bottom - 25,
60, 18, hWnd, 2, wndPtr->hInstance, 0L); 60, 18, hWnd, 2, wndPtr->hInstance, 0L);
break; break;
case MB_ABORTRETRYIGNORE : case MB_ABORTRETRYIGNORE :
lpmb->hWndYes = CreateWindow("BUTTON", "&Retry", lpmb->hWndYes = CreateWindow("BUTTON", "&Retry",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON, WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 70, rect.bottom - 25, rect.right / 2 - 100, rect.bottom - 25,
60, 18, hWnd, 1, wndPtr->hInstance, 0L); 60, 18, hWnd, 1, wndPtr->hInstance, 0L);
lpmb->hWndNo = CreateWindow("BUTTON", "&Ignore", lpmb->hWndNo = CreateWindow("BUTTON", "&Ignore",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON, WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 10, rect.bottom - 25, rect.right / 2 - 30, rect.bottom - 25,
60, 18, hWnd, 2, wndPtr->hInstance, 0L); 60, 18, hWnd, 2, wndPtr->hInstance, 0L);
lpmb->hWndCancel = CreateWindow("BUTTON", "&Abort", lpmb->hWndCancel = CreateWindow("BUTTON", "&Abort",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON, WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 80, rect.bottom - 25, rect.right / 2 + 40, rect.bottom - 25,
60, 18, hWnd, 3, wndPtr->hInstance, 0L); 60, 18, hWnd, 3, wndPtr->hInstance, 0L);
break; break;
case MB_YESNO : case MB_YESNO :
lpmb->hWndYes = CreateWindow("BUTTON", "&Yes", lpmb->hWndYes = CreateWindow("BUTTON", "&Yes",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON, WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 70, rect.bottom - 25, rect.right / 2 - 65, rect.bottom - 25,
60, 18, hWnd, 1, wndPtr->hInstance, 0L); 60, 18, hWnd, 1, wndPtr->hInstance, 0L);
lpmb->hWndNo = CreateWindow("BUTTON", "&No", lpmb->hWndNo = CreateWindow("BUTTON", "&No",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON, WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 10, rect.bottom - 25, rect.right / 2 + 5, rect.bottom - 25,
60, 18, hWnd, 2, wndPtr->hInstance, 0L); 60, 18, hWnd, 2, wndPtr->hInstance, 0L);
break; break;
case MB_YESNOCANCEL :
lpmb->hWndYes = CreateWindow("BUTTON", "&Yes",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 100, rect.bottom - 25,
60, 18, hWnd, 1, wndPtr->hInstance, 0L);
lpmb->hWndNo = CreateWindow("BUTTON", "&No",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 30, rect.bottom - 25,
60, 18, hWnd, 2, wndPtr->hInstance, 0L);
lpmb->hWndCancel = CreateWindow("BUTTON", "&Cancel",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 40, rect.bottom - 25,
60, 18, hWnd, 3, wndPtr->hInstance, 0L);
break;
} }
switch(lpmb->wType & MB_ICONMASK) { switch(lpmb->wType & MB_ICONMASK) {
case MB_ICONEXCLAMATION: case MB_ICONEXCLAMATION:
...@@ -173,16 +191,25 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam) ...@@ -173,16 +191,25 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
lpmb->hIcon = LoadIcon((HINSTANCE)NULL, IDI_HAND); lpmb->hIcon = LoadIcon((HINSTANCE)NULL, IDI_HAND);
break; break;
} }
if (lpmb->hIcon != (HICON)NULL) {
SetRect(&lpmb->rectIcon, 16,
lpmb->rectStr.bottom / 2 - 16, 48,
lpmb->rectStr.bottom / 2 + 16);
lpmb->rectStr.left += 64;
}
break; break;
case WM_PAINT: case WM_PAINT:
lpmb = MsgBoxGetStorageHeader(hWnd); lpmb = MsgBoxGetStorageHeader(hWnd);
GetClientRect(hWnd, &rect); CopyRect(&rect, &lpmb->rectStr);
hDC = BeginPaint(hWnd, &ps); hDC = BeginPaint(hWnd, &ps);
if (lpmb->hIcon) DrawIcon(hDC, 30, 20, lpmb->hIcon); if (lpmb->hIcon)
TextOut(hDC, rect.right / 2, 15, DrawIcon(hDC, lpmb->rectIcon.left,
lpmb->Title, strlen(lpmb->Title)); lpmb->rectIcon.top, lpmb->hIcon);
TextOut(hDC, rect.right / 2, 30, DrawText(hDC, lpmb->Str, -1, &rect,
lpmb->Str, strlen(lpmb->Str)); DT_CALCRECT | DT_CENTER | DT_WORDBREAK);
rect.top = lpmb->rectStr.bottom / 2 - rect.bottom / 2;
rect.bottom = lpmb->rectStr.bottom / 2 + rect.bottom / 2;
DrawText(hDC, lpmb->Str, -1, &rect, DT_CENTER | DT_WORDBREAK);
EndPaint(hWnd, &ps); EndPaint(hWnd, &ps);
break; break;
case WM_DESTROY: case WM_DESTROY:
...@@ -216,7 +243,7 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam) ...@@ -216,7 +243,7 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
DeleteDC(hMemDC); DeleteDC(hMemDC);
} }
*/ */
hBitMap = LoadBitmap((HINSTANCE)NULL, "SMILE"); hBitMap = LoadBitmap((HINSTANCE)NULL, "WINELOGO");
GetObject(hBitMap, sizeof(BITMAP), (LPSTR)&bm); GetObject(hBitMap, sizeof(BITMAP), (LPSTR)&bm);
printf("bm.bmWidth=%d bm.bmHeight=%d\n", printf("bm.bmWidth=%d bm.bmHeight=%d\n",
bm.bmWidth, bm.bmHeight); bm.bmWidth, bm.bmHeight);
...@@ -234,12 +261,15 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam) ...@@ -234,12 +261,15 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
break; break;
case 3: case 3:
hDC = GetDC(hWnd); hDC = GetDC(hWnd);
hInst2 = LoadImage("ev3lite.exe", NULL); hInst2 = LoadImage("ev3lite.exe");
printf("hInst2=%04X\n", hInst2);
hIcon = LoadIcon(hInst2, "EV3LITE"); hIcon = LoadIcon(hInst2, "EV3LITE");
DrawIcon(hDC, 20, 20, hIcon); DrawIcon(hDC, 20, 20, hIcon);
DestroyIcon(hIcon); DestroyIcon(hIcon);
hInst2 = LoadImage("sysres.dll", NULL); hInst2 = LoadImage("moricons.dll");
hIcon = LoadIcon(hInst2, "WINEICON"); printf("hInst2=%04X\n", hInst2);
hIcon = LoadIcon(hInst2, MAKEINTRESOURCE(1));
/* hIcon = LoadIcon(hInst2, "WINEICON"); */
DrawIcon(hDC, 60, 20, hIcon); DrawIcon(hDC, 60, 20, hIcon);
DestroyIcon(hIcon); DestroyIcon(hIcon);
hIcon = LoadIcon((HINSTANCE)NULL, IDI_EXCLAMATION); hIcon = LoadIcon((HINSTANCE)NULL, IDI_EXCLAMATION);
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
* *
* Copyright (c) 1993 Miguel de Icaza * Copyright (c) 1993 Miguel de Icaza
* *
* 1/Dec o Corrected return values for Get*ProfileString
*
* o Now, if AppName == NULL in Get*ProfileString it returns a list
* of the KeyNames (as documented in the MS-SDK).
*
* o if KeyValue == NULL now clears the value in Get*ProfileString
*/ */
static char Copyright [] = "Copyright (C) 1993 Miguel de Icaza"; static char Copyright [] = "Copyright (C) 1993 Miguel de Icaza";
...@@ -12,7 +18,8 @@ static char Copyright [] = "Copyright (C) 1993 Miguel de Icaza"; ...@@ -12,7 +18,8 @@ static char Copyright [] = "Copyright (C) 1993 Miguel de Icaza";
#include "windows.h" #include "windows.h"
#include "wine.h" #include "wine.h"
#define INIFILE GetSystemIniFilename() /* #define DEBUG */
#define STRSIZE 255 #define STRSIZE 255
#define xmalloc(x) malloc(x) #define xmalloc(x) malloc(x)
#define overflow (next == &CharBuffer [STRSIZE-1]) #define overflow (next == &CharBuffer [STRSIZE-1])
...@@ -63,9 +70,15 @@ static TSecHeader *load (char *file) ...@@ -63,9 +70,15 @@ static TSecHeader *load (char *file)
char *next; char *next;
char c; char c;
#ifdef DEBUG
printf("Load %s\n", file);
#endif
if ((f = fopen (file, "r"))==NULL) if ((f = fopen (file, "r"))==NULL)
return NULL; return NULL;
#ifdef DEBUG
printf("Loading %s\n", file);
#endif
state = FirstBrace; state = FirstBrace;
while ((c = getc (f)) != EOF){ while ((c = getc (f)) != EOF){
if (c == '\r') /* Ignore Carriage Return */ if (c == '\r') /* Ignore Carriage Return */
...@@ -79,6 +92,9 @@ static TSecHeader *load (char *file) ...@@ -79,6 +92,9 @@ static TSecHeader *load (char *file)
next = CharBuffer; next = CharBuffer;
SecHeader->AppName = strdup (CharBuffer); SecHeader->AppName = strdup (CharBuffer);
state = IgnoreToEOL; state = IgnoreToEOL;
#ifdef DEBUG
printf("%s: section %s\n", file, CharBuffer);
#endif
} else } else
*next++ = c; *next++ = c;
break; break;
...@@ -122,6 +138,9 @@ static TSecHeader *load (char *file) ...@@ -122,6 +138,9 @@ static TSecHeader *load (char *file)
SecHeader->Keys->KeyName = strdup (CharBuffer); SecHeader->Keys->KeyName = strdup (CharBuffer);
state = KeyValue; state = KeyValue;
next = CharBuffer; next = CharBuffer;
#ifdef DEBUG
printf("%s: key %s\n", file, CharBuffer);
#endif
} else } else
*next++ = c; *next++ = c;
break; break;
...@@ -175,22 +194,36 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName, ...@@ -175,22 +194,36 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
section = New->Section; section = New->Section;
Current = New; Current = New;
} }
/* Start search */ /* Start search */
for (; section; section = section->link){ for (; section; section = section->link){
if (strcasecmp (section->AppName, AppName)) if (strcasecmp (section->AppName, AppName))
continue; continue;
/* If no key value given, then list all the keys */
if ((!AppName) && (!set)){
char *p = ReturnedString;
int left = Size - 1;
int slen;
for (key = section->Keys; key; key = key->link){
strncpy (p, key->KeyName, left);
slen = strlen (key->KeyName) + 1;
left -= slen+1;
p += slen;
}
return left;
}
for (key = section->Keys; key; key = key->link){ for (key = section->Keys; key; key = key->link){
if (strcasecmp (key->KeyName, KeyName)) if (strcasecmp (key->KeyName, KeyName))
continue; continue;
if (set){ if (set){
free (key->Value); free (key->Value);
key->Value = strdup (Default); key->Value = strdup (Default ? Default : "");
return 1; return 1;
} }
ReturnedString [Size-1] = 0; ReturnedString [Size-1] = 0;
strncpy (ReturnedString, key->Value, Size-1); strncpy (ReturnedString, key->Value, Size-1);
return 1; return 1;
} }
/* If Getting the information, then don't write the information /* If Getting the information, then don't write the information
to the INI file, need to run a couple of tests with windog */ to the INI file, need to run a couple of tests with windog */
...@@ -222,14 +255,20 @@ short GetPrivateProfileString (LPSTR AppName, LPSTR KeyName, ...@@ -222,14 +255,20 @@ short GetPrivateProfileString (LPSTR AppName, LPSTR KeyName,
LPSTR Default, LPSTR ReturnedString, LPSTR Default, LPSTR ReturnedString,
short Size, LPSTR FileName) short Size, LPSTR FileName)
{ {
return (GetSetProfile (0, AppName, KeyName, Default, ReturnedString, Size, FileName)); int v;
v = GetSetProfile (0,AppName,KeyName,Default,ReturnedString,Size,FileName);
if (AppName)
return strlen (ReturnedString);
else
return Size - v;
} }
int GetProfileString (LPSTR AppName, LPSTR KeyName, LPSTR Default, int GetProfileString (LPSTR AppName, LPSTR KeyName, LPSTR Default,
LPSTR ReturnedString, int Size) LPSTR ReturnedString, int Size)
{ {
return GetPrivateProfileString (AppName, KeyName, Default, return GetPrivateProfileString (AppName, KeyName, Default,
ReturnedString, Size, INIFILE); ReturnedString, Size, WIN_INI);
} }
WORD GetPrivateProfileInt (LPSTR AppName, LPSTR KeyName, short Default, WORD GetPrivateProfileInt (LPSTR AppName, LPSTR KeyName, short Default,
...@@ -251,7 +290,7 @@ WORD GetPrivateProfileInt (LPSTR AppName, LPSTR KeyName, short Default, ...@@ -251,7 +290,7 @@ WORD GetPrivateProfileInt (LPSTR AppName, LPSTR KeyName, short Default,
WORD GetProfileInt (LPSTR AppName, LPSTR KeyName, int Default) WORD GetProfileInt (LPSTR AppName, LPSTR KeyName, int Default)
{ {
return GetPrivateProfileInt (AppName, KeyName, Default, INIFILE); return GetPrivateProfileInt (AppName, KeyName, Default, WIN_INI);
} }
BOOL WritePrivateProfileString (LPSTR AppName, LPSTR KeyName, LPSTR String, BOOL WritePrivateProfileString (LPSTR AppName, LPSTR KeyName, LPSTR String,
...@@ -262,7 +301,7 @@ BOOL WritePrivateProfileString (LPSTR AppName, LPSTR KeyName, LPSTR String, ...@@ -262,7 +301,7 @@ BOOL WritePrivateProfileString (LPSTR AppName, LPSTR KeyName, LPSTR String,
BOOL WriteProfileString (LPSTR AppName, LPSTR KeyName, LPSTR String) BOOL WriteProfileString (LPSTR AppName, LPSTR KeyName, LPSTR String)
{ {
return (WritePrivateProfileString (AppName, KeyName, String, INIFILE)); return (WritePrivateProfileString (AppName, KeyName, String, WIN_INI));
} }
static void dump_keys (FILE *profile, TKeys *p) static void dump_keys (FILE *profile, TKeys *p)
......
...@@ -6,8 +6,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; ...@@ -6,8 +6,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "prototypes.h" #include "prototypes.h"
#include "windows.h" #include "windows.h"
#include "user.h" #include "user.h"
#include "message.h"
#define DEFAULT_MSG_QUEUE_SIZE 8
#define USER_HEAP_SIZE 0x10000 #define USER_HEAP_SIZE 0x10000
...@@ -15,6 +14,9 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; ...@@ -15,6 +14,9 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
MDESC *USER_Heap = NULL; MDESC *USER_Heap = NULL;
extern BOOL ATOM_Init();
extern BOOL GDI_Init();
/*********************************************************************** /***********************************************************************
* USER_HeapInit * USER_HeapInit
*/ */
...@@ -24,7 +26,6 @@ static BOOL USER_HeapInit() ...@@ -24,7 +26,6 @@ static BOOL USER_HeapInit()
s = GetNextSegment( 0, 0x10000 ); s = GetNextSegment( 0, 0x10000 );
if (s == NULL) return FALSE; if (s == NULL) return FALSE;
HEAP_Init( &USER_Heap, s->base_addr, USER_HEAP_SIZE ); HEAP_Init( &USER_Heap, s->base_addr, USER_HEAP_SIZE );
free(s);
return TRUE; return TRUE;
} }
...@@ -37,6 +38,11 @@ static BOOL USER_HeapInit() ...@@ -37,6 +38,11 @@ static BOOL USER_HeapInit()
int int
USER_InitApp(int hInstance) USER_InitApp(int hInstance)
{ {
int queueSize;
/* Global atom table initialisation */
if (!ATOM_Init()) return 0;
/* GDI initialisation */ /* GDI initialisation */
if (!GDI_Init()) return 0; if (!GDI_Init()) return 0;
...@@ -54,9 +60,14 @@ USER_InitApp(int hInstance) ...@@ -54,9 +60,14 @@ USER_InitApp(int hInstance)
/* Initialize dialog manager */ /* Initialize dialog manager */
if (!DIALOG_Init()) return 0; if (!DIALOG_Init()) return 0;
/* Create system message queue */
queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
/* Create task message queue */ /* Create task message queue */
if (!SetMessageQueue( DEFAULT_MSG_QUEUE_SIZE )) return 0; queueSize = GetProfileInt( "windows", "DefaultQueueSize", 8 );
if (!SetMessageQueue( queueSize )) return 0;
return 1; return 1;
} }
...@@ -41,6 +41,8 @@ void main(int argc, char **argv) ...@@ -41,6 +41,8 @@ void main(int argc, char **argv)
XT_display = XtDisplay( topLevelWidget ); XT_display = XtDisplay( topLevelWidget );
XT_screen = XtScreen( topLevelWidget ); XT_screen = XtScreen( topLevelWidget );
DOS_InitFS();
Comm_Init();
_WinMain( argc, argv ); _WinMain( argc, argv );
} }
...@@ -58,12 +60,6 @@ void MessageBeep( WORD i ) ...@@ -58,12 +60,6 @@ void MessageBeep( WORD i )
XBell(XT_display, 100); XBell(XT_display, 100);
} }
WORD RegisterWindowMessage( LPSTR str )
{
printf( "RegisterWindowMessage: '%s'\n", str );
return 0xc000;
}
/*********************************************************************** /***********************************************************************
* GetTickCount (USER.13) * GetTickCount (USER.13)
*/ */
...@@ -94,11 +90,10 @@ void AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu ) ...@@ -94,11 +90,10 @@ void AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu )
{ {
printf( "AdjustWindowRect: (%d,%d)-(%d,%d) %d %d\n", rect->left, rect->top, printf( "AdjustWindowRect: (%d,%d)-(%d,%d) %d %d\n", rect->left, rect->top,
rect->right, rect->bottom, style, menu ); rect->right, rect->bottom, style, menu );
#ifdef USE_XLIB
rect->right += 8;
rect->bottom += 34;
#endif
} }
HMENU CreateMenu() { return 0; }
BOOL AppendMenu( HMENU hmenu, WORD flags, WORD id, LPSTR text ) { return TRUE;}
BOOL DestroyMenu( HMENU hmenu ) { return TRUE; }
#include "../Wine.tmpl"
MODULE = objects
SRCS = \
bitmap.c \
brush.c \
font.c \
gdiobj.c \
palette.c \
pen.c \
dib.c \
region.c \
text.c \
dcvalues.c \
clipping.c \
bitblt.c \
linedda.c \
color.c
OBJS = \
bitmap.o \
brush.o \
font.o \
gdiobj.o \
palette.o \
pen.o \
dib.o \
region.o \
text.o \
dcvalues.o \
clipping.o \
bitblt.o \
linedda.o \
color.o
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
includes::
install::
...@@ -38,10 +38,10 @@ BOOL PatBlt( HDC hdc, short left, short top, ...@@ -38,10 +38,10 @@ BOOL PatBlt( HDC hdc, short left, short top,
else rop = (rop & 0x03) | ((rop >> 4) & 0x0c); else rop = (rop & 0x03) | ((rop >> 4) & 0x0c);
XSetFunction( XT_display, dc->u.x.gc, DC_XROPfunction[rop] ); XSetFunction( XT_display, dc->u.x.gc, DC_XROPfunction[rop] );
x1 = XLPTODP( dc, left ); x1 = dc->w.DCOrgX + XLPTODP( dc, left );
x2 = XLPTODP( dc, left + width ); x2 = dc->w.DCOrgX + XLPTODP( dc, left + width );
y1 = YLPTODP( dc, top ); y1 = dc->w.DCOrgY + YLPTODP( dc, top );
y2 = YLPTODP( dc, top + height ); y2 = dc->w.DCOrgY + YLPTODP( dc, top + height );
XFillRectangle( XT_display, dc->u.x.drawable, dc->u.x.gc, XFillRectangle( XT_display, dc->u.x.drawable, dc->u.x.gc,
MIN(x1,x2), MIN(y1,y2), abs(x2-x1), abs(y2-y1) ); MIN(x1,x2), MIN(y1,y2), abs(x2-x1), abs(y2-y1) );
return TRUE; return TRUE;
...@@ -78,14 +78,14 @@ BOOL BitBlt( HDC hdcDest, short xDest, short yDest, short width, short height, ...@@ -78,14 +78,14 @@ BOOL BitBlt( HDC hdcDest, short xDest, short yDest, short width, short height,
dcSrc = (DC *) GDI_GetObjPtr( hdcSrc, DC_MAGIC ); dcSrc = (DC *) GDI_GetObjPtr( hdcSrc, DC_MAGIC );
if (!dcSrc) return FALSE; if (!dcSrc) return FALSE;
xs1 = XLPTODP( dcSrc, xSrc ); xs1 = dcSrc->w.DCOrgX + XLPTODP( dcSrc, xSrc );
xs2 = XLPTODP( dcSrc, xSrc + width ); xs2 = dcSrc->w.DCOrgX + XLPTODP( dcSrc, xSrc + width );
ys1 = YLPTODP( dcSrc, ySrc ); ys1 = dcSrc->w.DCOrgY + YLPTODP( dcSrc, ySrc );
ys2 = YLPTODP( dcSrc, ySrc + height ); ys2 = dcSrc->w.DCOrgY + YLPTODP( dcSrc, ySrc + height );
xd1 = XLPTODP( dcDest, xDest ); xd1 = dcDest->w.DCOrgX + XLPTODP( dcDest, xDest );
xd2 = XLPTODP( dcDest, xDest + width ); xd2 = dcDest->w.DCOrgX + XLPTODP( dcDest, xDest + width );
yd1 = YLPTODP( dcDest, yDest ); yd1 = dcDest->w.DCOrgY + YLPTODP( dcDest, yDest );
yd2 = YLPTODP( dcDest, yDest + height ); yd2 = dcDest->w.DCOrgY + YLPTODP( dcDest, yDest + height );
if ((abs(xs2-xs1) != abs(xd2-xd1)) || (abs(ys2-ys1) != abs(yd2-yd1))) if ((abs(xs2-xs1) != abs(xd2-xd1)) || (abs(ys2-ys1) != abs(yd2-yd1)))
return FALSE; /* Should call StretchBlt here */ return FALSE; /* Should call StretchBlt here */
...@@ -109,3 +109,78 @@ BOOL BitBlt( HDC hdcDest, short xDest, short yDest, short width, short height, ...@@ -109,3 +109,78 @@ BOOL BitBlt( HDC hdcDest, short xDest, short yDest, short width, short height,
} }
return TRUE; return TRUE;
} }
/***********************************************************************
* StrechBlt (GDI.35)
*/
BOOL StrechBlt( HDC hdcDest, short xDest, short yDest, short widthDest, short heightDest,
HDC hdcSrc, short xSrc, short ySrc, short widthSrc, short heightSrc, DWORD rop )
{
int xs1, xs2, ys1, ys2;
int xd1, xd2, yd1, yd2;
DC *dcDest, *dcSrc;
/*#ifdef DEBUG_GDI */
printf( "StrechBlt: %d %d,%d %dx%d %d %d,%d %dx%d %08x\n",
hdcDest, xDest, yDest, widthDest, heightDest, hdcSrc, xSrc,
ySrc, widthSrc, heightSrc, rop );
/*#endif */
if ((rop & 0xcc0000) == ((rop & 0x330000) << 2))
return PatBlt( hdcDest, xDest, yDest, widthDest, heightDest, rop );
printf("here\n");
rop >>= 16;
if ((rop & 0x0f) != (rop >> 4))
{
printf( "BitBlt: Unimplemented ROP %02x\n", rop );
return FALSE;
}
printf("here2\n");
dcDest = (DC *) GDI_GetObjPtr( hdcDest, DC_MAGIC );
if (!dcDest) return FALSE;
dcSrc = (DC *) GDI_GetObjPtr( hdcSrc, DC_MAGIC );
if (!dcSrc) return FALSE;
xs1 = XLPTODP( dcSrc, xSrc );
xs2 = XLPTODP( dcSrc, xSrc + widthSrc );
ys1 = YLPTODP( dcSrc, ySrc );
ys2 = YLPTODP( dcSrc, ySrc + heightSrc );
xd1 = XLPTODP( dcDest, xDest );
xd2 = XLPTODP( dcDest, xDest + widthDest );
yd1 = YLPTODP( dcDest, yDest );
yd2 = YLPTODP( dcDest, yDest + heightDest );
DC_SetupGCForText( dcDest );
XSetFunction( XT_display, dcDest->u.x.gc, DC_XROPfunction[rop & 0x0f] );
if (dcSrc->w.bitsPerPixel == dcDest->w.bitsPerPixel)
{
printf("XCopyArea\n");
XCopyArea( XT_display, dcSrc->u.x.drawable,
dcDest->u.x.drawable, dcDest->u.x.gc,
MIN(xs1,xs2), MIN(ys1,ys2), abs(xd2-xd1), abs(yd2-yd1),
MIN(xd1,xd2), MIN(yd1,yd2) );
}
else
{
printf("XCopyPlane\n");
if (dcSrc->w.bitsPerPixel != 1) return FALSE;
XCopyPlane( XT_display, dcSrc->u.x.drawable,
dcDest->u.x.drawable, dcDest->u.x.gc,
MIN(xs1,xs2), MIN(ys1,ys2), abs(xd2-xd1), abs(yd2-yd1),
MIN(xd1,xd2), MIN(yd1,yd2), 1 );
}
return TRUE;
}
...@@ -46,6 +46,7 @@ BOOL BITMAP_Init() ...@@ -46,6 +46,7 @@ BOOL BITMAP_Init()
if (tmpPixmap) if (tmpPixmap)
{ {
bitmapGC[i] = XCreateGC( XT_display, tmpPixmap, 0, NULL ); bitmapGC[i] = XCreateGC( XT_display, tmpPixmap, 0, NULL );
XSetGraphicsExposures( XT_display, bitmapGC[i], False );
XFreePixmap( XT_display, tmpPixmap ); XFreePixmap( XT_display, tmpPixmap );
} }
else bitmapGC[i] = 0; else bitmapGC[i] = 0;
...@@ -355,6 +356,8 @@ HBITMAP BITMAP_SelectObject( HDC hdc, DC * dc, HBITMAP hbitmap, ...@@ -355,6 +356,8 @@ HBITMAP BITMAP_SelectObject( HDC hdc, DC * dc, HBITMAP hbitmap,
DefaultRootWindow( XT_display ), DefaultRootWindow( XT_display ),
bmp->bmWidth, bmp->bmHeight, bmp->bmWidth, bmp->bmHeight,
bmp->bmBitsPixel ); bmp->bmBitsPixel );
dc->w.DCSizeX = bmp->bmWidth;
dc->w.DCSizeY = bmp->bmHeight;
BITMAP_CopyToPixmap( bmp, dc->u.x.drawable, BITMAP_CopyToPixmap( bmp, dc->u.x.drawable,
0, 0, bmp->bmWidth, bmp->bmHeight ); 0, 0, bmp->bmWidth, bmp->bmHeight );
......
...@@ -11,9 +11,32 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; ...@@ -11,9 +11,32 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
/*********************************************************************** /***********************************************************************
* CLIPPING_SetDeviceClipping
*
* Set the clip region of the physical device.
*/
void CLIPPING_SetDeviceClipping( DC * dc )
{
if (dc->w.hGCClipRgn)
{
RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr(dc->w.hGCClipRgn, REGION_MAGIC);
XSetClipMask( XT_display, dc->u.x.gc, obj->region.pixmap );
XSetClipOrigin( XT_display, dc->u.x.gc,
dc->w.DCOrgX + obj->region.box.left,
dc->w.DCOrgY + obj->region.box.top );
}
else
{
XSetClipMask( XT_display, dc->u.x.gc, None );
XSetClipOrigin( XT_display, dc->u.x.gc, dc->w.DCOrgX, dc->w.DCOrgY );
}
}
/***********************************************************************
* CLIPPING_UpdateGCRegion * CLIPPING_UpdateGCRegion
* *
* Update the GC clip region when the ClipRgn of VisRgn have changed. * Update the GC clip region when the ClipRgn or VisRgn have changed.
*/ */
static void CLIPPING_UpdateGCRegion( DC * dc ) static void CLIPPING_UpdateGCRegion( DC * dc )
{ {
...@@ -36,19 +59,7 @@ static void CLIPPING_UpdateGCRegion( DC * dc ) ...@@ -36,19 +59,7 @@ static void CLIPPING_UpdateGCRegion( DC * dc )
else else
CombineRgn( dc->w.hGCClipRgn, dc->w.hClipRgn, dc->w.hVisRgn, RGN_AND ); CombineRgn( dc->w.hGCClipRgn, dc->w.hClipRgn, dc->w.hVisRgn, RGN_AND );
} }
CLIPPING_SetDeviceClipping( dc );
if (dc->w.hGCClipRgn)
{
RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr( dc->w.hGCClipRgn, REGION_MAGIC );
XSetClipMask( XT_display, dc->u.x.gc, obj->region.pixmap );
XSetClipOrigin( XT_display, dc->u.x.gc,
obj->region.box.left, obj->region.box.top );
}
else
{
XSetClipMask( XT_display, dc->u.x.gc, None );
XSetClipOrigin( XT_display, dc->u.x.gc, 0, 0 );
}
} }
...@@ -157,26 +168,40 @@ int OffsetVisRgn( HDC hdc, short x, short y ) ...@@ -157,26 +168,40 @@ int OffsetVisRgn( HDC hdc, short x, short y )
int CLIPPING_IntersectRect( DC * dc, HRGN * hrgn, short left, short top, int CLIPPING_IntersectRect( DC * dc, HRGN * hrgn, short left, short top,
short right, short bottom, int exclude ) short right, short bottom, int exclude )
{ {
HRGN tempRgn, newRgn; HRGN tempRgn = 0, prevRgn = 0, newRgn = 0;
RGNOBJ *newObj, *prevObj; RGNOBJ *newObj, *prevObj;
int retval; int retval;
if (!*hrgn) return NULLREGION; if (!*hrgn)
if (!(newRgn = CreateRectRgn( 0, 0, 0, 0))) return ERROR;
if (!(tempRgn = CreateRectRgn( left, top, right, bottom )))
{ {
DeleteObject( newRgn ); if (!(*hrgn = CreateRectRgn( 0, 0, dc->w.DCSizeX, dc->w.DCSizeY )))
return ERROR; goto Error;
prevRgn = *hrgn;
} }
if (!(newRgn = CreateRectRgn( 0, 0, 0, 0))) goto Error;
if (!(tempRgn = CreateRectRgn( left, top, right, bottom ))) goto Error;
retval = CombineRgn( newRgn, *hrgn, tempRgn, exclude ? RGN_DIFF : RGN_AND); retval = CombineRgn( newRgn, *hrgn, tempRgn, exclude ? RGN_DIFF : RGN_AND);
if (retval == ERROR) goto Error;
newObj = (RGNOBJ *) GDI_GetObjPtr( newRgn, REGION_MAGIC ); newObj = (RGNOBJ *) GDI_GetObjPtr( newRgn, REGION_MAGIC );
prevObj = (RGNOBJ *) GDI_GetObjPtr( *hrgn, REGION_MAGIC ); prevObj = (RGNOBJ *) GDI_GetObjPtr( *hrgn, REGION_MAGIC );
if (newObj && prevObj) newObj->header.hNext = prevObj->header.hNext; if (newObj && prevObj) newObj->header.hNext = prevObj->header.hNext;
DeleteObject( tempRgn ); DeleteObject( tempRgn );
DeleteObject( *hrgn ); if (*hrgn) DeleteObject( *hrgn );
*hrgn = newRgn; *hrgn = newRgn;
CLIPPING_UpdateGCRegion( dc ); CLIPPING_UpdateGCRegion( dc );
return retval; return retval;
Error:
if (tempRgn) DeleteObject( tempRgn );
if (newRgn) DeleteObject( newRgn );
if (prevRgn)
{
DeleteObject( prevRgn );
*hrgn = 0;
}
return ERROR;
} }
...@@ -292,13 +317,9 @@ int GetClipBox( HDC hdc, LPRECT rect ) ...@@ -292,13 +317,9 @@ int GetClipBox( HDC hdc, LPRECT rect )
if (dc->w.hGCClipRgn) return GetRgnBox( dc->w.hGCClipRgn, rect ); if (dc->w.hGCClipRgn) return GetRgnBox( dc->w.hGCClipRgn, rect );
else else
{ {
Window root;
int width, height, x, y, border, depth;
XGetGeometry( XT_display, dc->u.x.drawable, &root, &x, &y,
&width, &height, &border, &depth );
rect->top = rect->left = 0; rect->top = rect->left = 0;
rect->right = width & 0xffff; rect->right = dc->w.DCSizeX;
rect->bottom = height & 0xffff; rect->bottom = dc->w.DCSizeY;
return SIMPLEREGION; return SIMPLEREGION;
} }
} }
......
...@@ -45,6 +45,8 @@ const WIN_DC_INFO DCVAL_defaultValues = ...@@ -45,6 +45,8 @@ const WIN_DC_INFO DCVAL_defaultValues =
MM_TEXT, /* MapMode */ MM_TEXT, /* MapMode */
0, /* DCOrgX */ 0, /* DCOrgX */
0, /* DCOrgY */ 0, /* DCOrgY */
0, /* DCSizeX */
0, /* DCSizeY */
0, /* CursPosX */ 0, /* CursPosX */
0, /* CursPosY */ 0, /* CursPosY */
0, /* WndOrgX */ 0, /* WndOrgX */
......
...@@ -331,6 +331,36 @@ BOOL GetTextMetrics( HDC hdc, LPTEXTMETRIC metrics ) ...@@ -331,6 +331,36 @@ BOOL GetTextMetrics( HDC hdc, LPTEXTMETRIC metrics )
} }
/***********************************************************************/
#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
(((cs)->rbearing|(cs)->lbearing| \
(cs)->ascent|(cs)->descent) == 0))
/*
* CI_GET_CHAR_INFO - return the charinfo struct for the indicated 8bit
* character. If the character is in the column and exists, then return the
* appropriate metrics (note that fonts with common per-character metrics will
* return min_bounds). If none of these hold true, try again with the default
* char.
*/
#define CI_GET_CHAR_INFO(fs,col,def,cs) \
{ \
cs = def; \
if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
cs = &fs->min_bounds; \
} else { \
cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
if (CI_NONEXISTCHAR(cs)) cs = def; \
} \
} \
}
#define CI_GET_DEFAULT_INFO(fs,cs) \
CI_GET_CHAR_INFO(fs, fs->default_char, NULL, cs)
/*********************************************************************** /***********************************************************************
* GetCharWidth (GDI.350) * GetCharWidth (GDI.350)
*/ */
...@@ -338,8 +368,7 @@ BOOL GetCharWidth(HDC hdc, WORD wFirstChar, WORD wLastChar, LPINT lpBuffer) ...@@ -338,8 +368,7 @@ BOOL GetCharWidth(HDC hdc, WORD wFirstChar, WORD wLastChar, LPINT lpBuffer)
{ {
int i, j; int i, j;
XFontStruct *xfont; XFontStruct *xfont;
XCharStruct *charPtr; XCharStruct *cs, *def;
int default_width;
DC *dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC); DC *dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC);
if (!dc) return FALSE; if (!dc) return FALSE;
...@@ -353,15 +382,12 @@ BOOL GetCharWidth(HDC hdc, WORD wFirstChar, WORD wLastChar, LPINT lpBuffer) ...@@ -353,15 +382,12 @@ BOOL GetCharWidth(HDC hdc, WORD wFirstChar, WORD wLastChar, LPINT lpBuffer)
return TRUE; return TRUE;
} }
charPtr = xfont->per_char; CI_GET_DEFAULT_INFO(xfont, def);
default_width = (charPtr + xfont->default_char)->width;
for (i = wFirstChar, j = 0; i <= wLastChar; i++, j++) for (i = wFirstChar, j = 0; i <= wLastChar; i++, j++)
{ {
if (i < xfont->min_char_or_byte2 || i > xfont->max_char_or_byte2) CI_GET_CHAR_INFO(xfont, i, def, cs);
*(lpBuffer + j) = default_width; *(lpBuffer + j) = cs->width;
else
*(lpBuffer + j) = charPtr->width;
} }
return TRUE; return TRUE;
} }
...@@ -153,7 +153,6 @@ BOOL GDI_Init() ...@@ -153,7 +153,6 @@ BOOL GDI_Init()
s = (struct segment_descriptor_s *)GetNextSegment( 0, 0x10000 ); s = (struct segment_descriptor_s *)GetNextSegment( 0, 0x10000 );
if (s == NULL) return FALSE; if (s == NULL) return FALSE;
HEAP_Init( &GDI_Heap, s->base_addr, GDI_HEAP_SIZE ); HEAP_Init( &GDI_Heap, s->base_addr, GDI_HEAP_SIZE );
free(s);
/* Create default palette */ /* Create default palette */
...@@ -200,8 +199,11 @@ HANDLE GDI_AllocObject( WORD size, WORD magic ) ...@@ -200,8 +199,11 @@ HANDLE GDI_AllocObject( WORD size, WORD magic )
GDIOBJHDR * obj; GDIOBJHDR * obj;
HANDLE handle = GDI_HEAP_ALLOC( GMEM_MOVEABLE, size ); HANDLE handle = GDI_HEAP_ALLOC( GMEM_MOVEABLE, size );
if (!handle) return 0; if (!handle) return 0;
obj = (GDIOBJHDR *) GDI_HEAP_ADDR( handle ); obj = (GDIOBJHDR *) GDI_HEAP_ADDR( handle );
if (obj == NULL) {
printf("GDI_AllocObject // Error trying to get GDI_HEAD_ADDR !\n");
return 0;
}
obj->hNext = 0; obj->hNext = 0;
obj->wMagic = magic; obj->wMagic = magic;
obj->dwCount = ++count; obj->dwCount = ++count;
......
...@@ -177,3 +177,21 @@ int PALETTE_GetObject( PALETTEOBJ * palette, int count, LPSTR buffer ) ...@@ -177,3 +177,21 @@ int PALETTE_GetObject( PALETTEOBJ * palette, int count, LPSTR buffer )
memcpy( buffer, &palette->logpalette.palNumEntries, count ); memcpy( buffer, &palette->logpalette.palNumEntries, count );
return count; return count;
} }
/***********************************************************************
* SelectPalette (USER.282)
*/
HPALETTE SelectPalette(HDC hDC, HPALETTE hPal, BOOL bForceBackground)
{
return (HPALETTE)NULL;
}
/***********************************************************************
* RealizePalette (USER.283)
*/
int RealizePalette(HDC hDC)
{
return 0;
}
...@@ -31,6 +31,7 @@ BOOL REGION_Init() ...@@ -31,6 +31,7 @@ BOOL REGION_Init()
XFreePixmap( XT_display, tmpPixmap ); XFreePixmap( XT_display, tmpPixmap );
if (!regionGC) return FALSE; if (!regionGC) return FALSE;
XSetForeground( XT_display, regionGC, 1 ); XSetForeground( XT_display, regionGC, 1 );
XSetGraphicsExposures( XT_display, regionGC, False );
return TRUE; return TRUE;
} }
else return FALSE; else return FALSE;
......
...@@ -229,7 +229,8 @@ int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags ) ...@@ -229,7 +229,8 @@ int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags )
else if (flags & DT_BOTTOM) y = rect->bottom - size.cy; else if (flags & DT_BOTTOM) y = rect->bottom - size.cy;
} }
if (!TextOut(hdc, x, y, line, len)) return 0; if (!(flags & DT_CALCRECT))
if (!TextOut(hdc, x, y, line, len)) return 0;
if (prefix_offset != -1) if (prefix_offset != -1)
{ {
MoveTo(hdc, x + prefix_x, y + size.cy); MoveTo(hdc, x + prefix_x, y + size.cy);
...@@ -247,7 +248,7 @@ int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags ) ...@@ -247,7 +248,7 @@ int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags )
} }
} }
while (strPtr); while (strPtr);
if (flags & DT_CALCRECT) rect->bottom = y;
return 1; return 1;
} }
...@@ -314,10 +315,10 @@ BOOL TextOut( HDC hdc, short x, short y, LPSTR str, short count ) ...@@ -314,10 +315,10 @@ BOOL TextOut( HDC hdc, short x, short y, LPSTR str, short count )
{ {
if (dc->w.backgroundMode == TRANSPARENT) if (dc->w.backgroundMode == TRANSPARENT)
XDrawString( XT_display, dc->u.x.drawable, dc->u.x.gc, XDrawString( XT_display, dc->u.x.drawable, dc->u.x.gc,
x, y, str, count ); dc->w.DCOrgX + x, dc->w.DCOrgY + y, str, count );
else else
XDrawImageString( XT_display, dc->u.x.drawable, dc->u.x.gc, XDrawImageString( XT_display, dc->u.x.drawable, dc->u.x.gc,
x, y, str, count ); dc->w.DCOrgX + x, dc->w.DCOrgY + y, str, count );
} }
else else
{ {
...@@ -340,14 +341,15 @@ BOOL TextOut( HDC hdc, short x, short y, LPSTR str, short count ) ...@@ -340,14 +341,15 @@ BOOL TextOut( HDC hdc, short x, short y, LPSTR str, short count )
if (dc->w.backgroundMode == TRANSPARENT) if (dc->w.backgroundMode == TRANSPARENT)
XDrawString( XT_display, dc->u.x.drawable, dc->u.x.gc, XDrawString( XT_display, dc->u.x.drawable, dc->u.x.gc,
xchar, y, p, 1 ); dc->w.DCOrgX + xchar, dc->w.DCOrgY + y, p, 1 );
else else
{ {
XDrawImageString( XT_display, dc->u.x.drawable, dc->u.x.gc, XDrawImageString( XT_display, dc->u.x.drawable, dc->u.x.gc,
xchar, y, p, 1 ); dc->w.DCOrgX + xchar, dc->w.DCOrgY + y, p, 1 );
XSetForeground( XT_display, dc->u.x.gc, dc->w.backgroundPixel); XSetForeground( XT_display, dc->u.x.gc, dc->w.backgroundPixel);
XFillRectangle( XT_display, dc->u.x.drawable, dc->u.x.gc, XFillRectangle( XT_display, dc->u.x.drawable, dc->u.x.gc,
xchar + charStr->width, y - font->ascent, dc->w.DCOrgX + xchar + charStr->width,
dc->w.DCOrgY + y - font->ascent,
extraWidth, font->ascent + font->descent ); extraWidth, font->ascent + font->descent );
XSetForeground( XT_display, dc->u.x.gc, dc->w.textPixel ); XSetForeground( XT_display, dc->u.x.gc, dc->w.textPixel );
} }
...@@ -368,7 +370,8 @@ BOOL TextOut( HDC hdc, short x, short y, LPSTR str, short count ) ...@@ -368,7 +370,8 @@ BOOL TextOut( HDC hdc, short x, short y, LPSTR str, short count )
XSetLineAttributes( XT_display, dc->u.x.gc, lineWidth, XSetLineAttributes( XT_display, dc->u.x.gc, lineWidth,
LineSolid, CapRound, JoinBevel ); LineSolid, CapRound, JoinBevel );
XDrawLine( XT_display, dc->u.x.drawable, dc->u.x.gc, XDrawLine( XT_display, dc->u.x.drawable, dc->u.x.gc,
x, y + linePos, x + info.width, y + linePos ); dc->w.DCOrgX + x, dc->w.DCOrgY + y + linePos,
dc->w.DCOrgX + x + info.width, dc->w.DCOrgY + y + linePos );
} }
if (dc->u.x.font.metrics.tmStruckOut) if (dc->u.x.font.metrics.tmStruckOut)
{ {
...@@ -380,7 +383,8 @@ BOOL TextOut( HDC hdc, short x, short y, LPSTR str, short count ) ...@@ -380,7 +383,8 @@ BOOL TextOut( HDC hdc, short x, short y, LPSTR str, short count )
XSetLineAttributes( XT_display, dc->u.x.gc, lineAscent + lineDescent, XSetLineAttributes( XT_display, dc->u.x.gc, lineAscent + lineDescent,
LineSolid, CapRound, JoinBevel ); LineSolid, CapRound, JoinBevel );
XDrawLine( XT_display, dc->u.x.drawable, dc->u.x.gc, XDrawLine( XT_display, dc->u.x.drawable, dc->u.x.gc,
x, y - lineAscent, x + info.width, y - lineAscent ); dc->w.DCOrgX + x, dc->w.DCOrgY + y - lineAscent,
dc->w.DCOrgX + x + info.width, dc->w.DCOrgY + y - lineAscent );
} }
return TRUE; return TRUE;
......
No preview for this file type
all::
depend::
clean::
includes::
This diff is collapsed. Click to expand it.
No preview for this file type
#include "../Wine.tmpl"
MODULE = tools
SimpleProgramTarget(build)
#include "../Wine.tmpl"
MODULE = windows
SRCS = \
class.c \
dc.c \
dce.c \
event.c \
message.c \
win.c \
timer.c \
graphics.c \
clipping.c \
mapping.c \
painting.c \
keyboard.c \
utility.c \
syscolor.c \
defwnd.c \
defdlg.c \
dialog.c \
focus.c \
scroll.c
OBJS = \
class.o \
dc.o \
dce.o \
event.o \
message.o \
win.o \
timer.o \
graphics.o \
clipping.o \
mapping.o \
painting.o \
keyboard.o \
utility.o \
syscolor.o \
defwnd.o \
defdlg.o \
dialog.o \
focus.o \
scroll.o
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
includes::
install::
...@@ -2,7 +2,7 @@ CFLAGS=$(COPTS) $(DEBUGOPTS) -I$(INCLUDE_DIR) ...@@ -2,7 +2,7 @@ CFLAGS=$(COPTS) $(DEBUGOPTS) -I$(INCLUDE_DIR)
OBJS=class.o dc.o dce.o event.o message.o win.o timer.o graphics.o \ OBJS=class.o dc.o dce.o event.o message.o win.o timer.o graphics.o \
clipping.o mapping.o painting.o keyboard.o utility.o syscolor.o \ clipping.o mapping.o painting.o keyboard.o utility.o syscolor.o \
defwnd.o defdlg.o dialog.o focus.o scroll.o defwnd.o defdlg.o dialog.o focus.o scroll.o caret.o winpos.o
default: windows.o default: windows.o
......
/*
* Caret functions
*
* Copyright 1993 David Metcalfe
*/
static char Copyright[] = "Copyright David Metcalfe, 1993";
#include <X11/Intrinsic.h>
#include "windows.h"
extern XtAppContext XT_app_context;
typedef struct
{
HWND hwnd;
short hidden;
BOOL on;
short x;
short y;
short width;
short height;
COLORREF color;
WORD timeout;
XtIntervalId xtid;
} CARET;
static CARET Caret;
static BOOL LockCaret;
static void CARET_Callback(XtPointer data, XtIntervalId *xtid);
static void CARET_HideCaret(CARET *pCaret);
/*****************************************************************
* CARET_Callback
*/
static void CARET_Callback(XtPointer data, XtIntervalId *xtid)
{
CARET *pCaret = (CARET *)data;
HDC hdc;
HBRUSH hBrush;
HRGN rgn;
#ifdef DEBUG_CARET
printf("CARET_Callback: LockCaret=%d, hidden=%d, on=%d\n",
LockCaret, pCaret->hidden, pCaret->on);
#endif
if (!LockCaret && (!pCaret->hidden || pCaret->on))
{
pCaret->on = (pCaret->on ? FALSE : TRUE);
hdc = GetDC(pCaret->hwnd);
hBrush = CreateSolidBrush(pCaret->color);
SelectObject(hdc, (HANDLE)hBrush);
SetROP2(hdc, R2_XORPEN);
rgn = CreateRectRgn(pCaret->x, pCaret->y,
pCaret->x + pCaret->width,
pCaret->y + pCaret->height);
FillRgn(hdc, rgn, hBrush);
DeleteObject((HANDLE)rgn);
DeleteObject((HANDLE)hBrush);
ReleaseDC(pCaret->hwnd, hdc);
}
pCaret->xtid = XtAppAddTimeOut(XT_app_context, pCaret->timeout,
CARET_Callback, pCaret);
}
/*****************************************************************
* CARET_HideCaret
*/
static void CARET_HideCaret(CARET *pCaret)
{
HDC hdc;
HBRUSH hBrush;
HRGN rgn;
pCaret->on = FALSE;
hdc = GetDC(pCaret->hwnd);
hBrush = CreateSolidBrush(pCaret->color);
SelectObject(hdc, (HANDLE)hBrush);
SetROP2(hdc, R2_XORPEN);
rgn = CreateRectRgn(pCaret->x, pCaret->y,
pCaret->x + pCaret->width,
pCaret->y + pCaret->height);
FillRgn(hdc, rgn, hBrush);
DeleteObject((HANDLE)rgn);
DeleteObject((HANDLE)hBrush);
ReleaseDC(pCaret->hwnd, hdc);
}
/*****************************************************************
* CreateCaret (USER.163)
*/
void CreateCaret(HWND hwnd, HBITMAP bitmap, short width, short height)
{
if (!hwnd) return;
/* if cursor already exists, destroy it */
/* if (Caret.hwnd)
DestroyCaret();
*/
if (bitmap)
{
printf("CreateCaret: Bitmaps are currently not supported\n");
return;
}
if (width)
Caret.width = width;
else
Caret.width = 3; /* should be SM_CXBORDER */
if (height)
Caret.height = height;
else
Caret.height = 3; /* should be SM_CYBORDER */
Caret.hwnd = hwnd;
Caret.hidden = 1;
Caret.on = FALSE;
Caret.x = 0;
Caret.y = 0;
Caret.color = GetSysColor(COLOR_WINDOWTEXT);
Caret.timeout = 750;
LockCaret = FALSE;
Caret.xtid = XtAppAddTimeOut(XT_app_context, Caret.timeout,
CARET_Callback, &Caret);
}
/*****************************************************************
* DestroyCaret (USER.164)
*/
void DestroyCaret()
{
/* if (!Caret.hwnd) return;
*/
XtRemoveTimeOut(Caret.xtid);
if (Caret.on)
CARET_HideCaret(&Caret);
Caret.hwnd = 0; /* cursor marked as not existing */
}
/*****************************************************************
* SetCaretPos (USER.165)
*/
void SetCaretPos(short x, short y)
{
HDC hdc;
HBRUSH hBrush;
HRGN rgn;
if (!Caret.hwnd) return;
#ifdef DEBUG_CARET
printf("SetCaretPos: x=%d, y=%d\n", x, y);
#endif
LockCaret = TRUE;
if (Caret.on)
CARET_HideCaret(&Caret);
Caret.x = x;
Caret.y = y;
LockCaret = FALSE;
}
/*****************************************************************
* HideCaret (USER.166)
*/
void HideCaret(HWND hwnd)
{
if (!Caret.hwnd) return;
if (hwnd && (Caret.hwnd != hwnd)) return;
LockCaret = TRUE;
if (Caret.on)
CARET_HideCaret(&Caret);
++Caret.hidden;
LockCaret = FALSE;
}
/*****************************************************************
* ShowCaret (USER.167)
*/
void ShowCaret(HWND hwnd)
{
if (!Caret.hwnd) return;
if (hwnd && (Caret.hwnd != hwnd)) return;
#ifdef DEBUG_CARET
printf("ShowCaret: hidden=%d\n", Caret.hidden);
#endif
if (Caret.hidden)
--Caret.hidden;
}
/*****************************************************************
* SetCaretBlinkTime (USER.168)
*/
void SetCaretBlinkTime(WORD msecs)
{
if (!Caret.hwnd) return;
Caret.timeout = msecs;
}
/*****************************************************************
* GetCaretBlinkTime (USER.169)
*/
WORD GetCaretBlinkTime()
{
if (!Caret.hwnd) return;
return Caret.timeout;
}
/*****************************************************************
* GetCaretPos (USER.183)
*/
void GetCaretPos(LPPOINT pt)
{
if (!Caret.hwnd || !pt) return;
pt->x = Caret.x;
pt->y = Caret.y;
}
...@@ -9,6 +9,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; ...@@ -9,6 +9,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "class.h" #include "class.h"
#include "user.h" #include "user.h"
#include "win.h" #include "win.h"
#include "dce.h"
static HCLASS firstClass = 0; static HCLASS firstClass = 0;
...@@ -18,19 +19,50 @@ static HCLASS firstClass = 0; ...@@ -18,19 +19,50 @@ static HCLASS firstClass = 0;
* CLASS_FindClassByName * CLASS_FindClassByName
* *
* Return a handle and a pointer to the class. * Return a handle and a pointer to the class.
* 'ptr' can be NULL if the pointer is not needed.
*/ */
HCLASS CLASS_FindClassByName( char * name, CLASS **ptr ) HCLASS CLASS_FindClassByName( char * name, CLASS **ptr )
{ {
HCLASS class = firstClass; ATOM atom;
while(class) HCLASS class;
CLASS * classPtr;
/* First search task-specific classes */
if ((atom = FindAtom( name )) != 0)
{
for (class = firstClass; (class); class = classPtr->hNext)
{
classPtr = (CLASS *) USER_HEAP_ADDR(class);
if (classPtr->wc.style & CS_GLOBALCLASS) continue;
if (classPtr->atomName == atom)
{
if (ptr) *ptr = classPtr;
return class;
}
}
}
/* Then search global classes */
if ((atom = GlobalFindAtom( name )) != 0)
{ {
*ptr = (CLASS *) USER_HEAP_ADDR(class); for (class = firstClass; (class); class = classPtr->hNext)
if (!strcasecmp( (*ptr)->wc.lpszClassName, name )) return class; {
class = (*ptr)->hNext; classPtr = (CLASS *) USER_HEAP_ADDR(class);
if (!(classPtr->wc.style & CS_GLOBALCLASS)) continue;
if (classPtr->atomName == atom)
{
if (ptr) *ptr = classPtr;
return class;
}
}
} }
return 0; return 0;
} }
/*********************************************************************** /***********************************************************************
* CLASS_FindClassPtr * CLASS_FindClassPtr
* *
...@@ -52,37 +84,50 @@ CLASS * CLASS_FindClassPtr( HCLASS hclass ) ...@@ -52,37 +84,50 @@ CLASS * CLASS_FindClassPtr( HCLASS hclass )
*/ */
ATOM RegisterClass( LPWNDCLASS class ) ATOM RegisterClass( LPWNDCLASS class )
{ {
CLASS * newClass; CLASS * newClass, * prevClassPtr;
HCLASS handle; HCLASS handle, prevClass;
#ifdef DEBUG_CLASS #ifdef DEBUG_CLASS
printf( "RegisterClass: wndproc=%08x hinst=%d name='%s'\n", printf( "RegisterClass: wndproc=%08x hinst=%d name='%s'\n",
class->lpfnWndProc, class->hInstance, class->lpszClassName ); class->lpfnWndProc, class->hInstance, class->lpszClassName );
#endif #endif
/* Check if a class with this name already exists */
prevClass = CLASS_FindClassByName( class->lpszClassName, &prevClassPtr );
if (prevClass)
{
/* Class can be created only if it is local and */
/* if the class with the same name is global. */
if (class->style & CS_GLOBALCLASS) return 0;
if (!(prevClassPtr->wc.style & CS_GLOBALCLASS)) return 0;
}
/* Create class */
handle = USER_HEAP_ALLOC( GMEM_MOVEABLE, sizeof(CLASS)+class->cbClsExtra ); handle = USER_HEAP_ALLOC( GMEM_MOVEABLE, sizeof(CLASS)+class->cbClsExtra );
if (!handle) return 0; if (!handle) return 0;
newClass = (CLASS *) USER_HEAP_ADDR( handle ); newClass = (CLASS *) USER_HEAP_ADDR( handle );
newClass->hNext = firstClass; newClass->hNext = firstClass;
newClass->wMagic = CLASS_MAGIC; newClass->wMagic = CLASS_MAGIC;
newClass->atomName = handle; /* Should be an atom */
newClass->cWindows = 0; newClass->cWindows = 0;
newClass->wc = *class; newClass->wc = *class;
if (newClass->wc.style & CS_GLOBALCLASS)
newClass->atomName = GlobalAddAtom( class->lpszClassName );
else newClass->atomName = AddAtom( class->lpszClassName );
if (newClass->wc.style & CS_CLASSDC) if (newClass->wc.style & CS_CLASSDC)
newClass->hdc = CreateDC( "DISPLAY", NULL, NULL, NULL ); newClass->hdce = DCE_AllocDCE( DCE_CLASS_DC );
else newClass->hdc = 0; else newClass->hdce = 0;
/* Class name should also be set to zero. For now we need the /* Menu name should also be set to zero. */
* name because we don't have atoms. newClass->wc.lpszClassName = NULL;
*/
newClass->wc.lpszClassName = (char *)malloc(strlen(class->lpszClassName)+1);
strcpy( newClass->wc.lpszClassName, class->lpszClassName );
if (class->cbClsExtra) memset( newClass->wExtra, 0, class->cbClsExtra ); if (class->cbClsExtra) memset( newClass->wExtra, 0, class->cbClsExtra );
firstClass = handle; firstClass = handle;
return handle; /* Should be an atom */ return newClass->atomName;
} }
...@@ -118,8 +163,10 @@ BOOL UnregisterClass( LPSTR className, HANDLE instance ) ...@@ -118,8 +163,10 @@ BOOL UnregisterClass( LPSTR className, HANDLE instance )
} }
/* Delete the class */ /* Delete the class */
if (classPtr->hdc) DeleteDC( classPtr->hdc ); if (classPtr->hdce) DCE_FreeDCE( classPtr->hdce );
if (classPtr->wc.hbrBackground) DeleteObject( classPtr->wc.hbrBackground ); if (classPtr->wc.hbrBackground) DeleteObject( classPtr->wc.hbrBackground );
if (classPtr->wc.style & CS_GLOBALCLASS) GlobalDeleteAtom( classPtr->atomName );
else DeleteAtom( classPtr->atomName );
USER_HEAP_FREE( class ); USER_HEAP_FREE( class );
return TRUE; return TRUE;
} }
...@@ -182,3 +229,34 @@ LONG SetClassLong( HWND hwnd, short offset, LONG newval ) ...@@ -182,3 +229,34 @@ LONG SetClassLong( HWND hwnd, short offset, LONG newval )
*ptr = newval; *ptr = newval;
return retval; return retval;
} }
/***********************************************************************
* GetClassName (USER.58)
*/
int GetClassName(HWND hwnd, LPSTR lpClassName, short maxCount)
{
WND *wndPtr;
CLASS *classPtr;
if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
if (!(classPtr = CLASS_FindClassPtr(wndPtr->hClass))) return 0;
return (GetAtomName(classPtr->atomName, lpClassName, maxCount));
}
/***********************************************************************
* GetClassInfo (USER.404)
*/
BOOL GetClassInfo(HANDLE hInstance, LPSTR lpClassName,
LPWNDCLASS lpWndClass)
{
CLASS *classPtr;
if (!(CLASS_FindClassByName(lpClassName, &classPtr))) return FALSE;
if (hInstance && (hInstance != classPtr->wc.hInstance)) return FALSE;
memcpy(lpWndClass, &(classPtr->wc), sizeof(WNDCLASS));
return TRUE;
}
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment