Commit 1e9ac798 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 960606

Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] [controls/listbox.c] Fixed wParam of WM_DRAWITEM message. * [if1632/Makefile.in] [loader/builtin.c] Remove WPROCS32 DLL, as the relay code can call Wine routines directly. * [loader/module.c] [loader/ne_image.c] Fixed initial stack layout for self-loading modules. * [tools/build.c] Fixed data segment building for Win16 modules. * [windows/defdlg.c] Implemented Win32 versions of DefDlgProc(). * [windows/dialog.c] Merged Win16 and Win32 dialog code. Added support for control extra data in dialog item template. * [windows/win.c] Unified Win16 and Win32 versions of CreateWindow(). Implemented Win32 version of GetWindowLong(). * [windows/winproc.c] Changed the implementation of window procedures, so that 16-bit winprocs are valid segmented pointers. Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [misc/registry.c] Fixed another bug in the w95 loader. Quietened some debug output. Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [windows/winproc.c] Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT. Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/TODO] [resources/sysres_It.rc] Updated font dialog box. Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de> * [include/commdlg.h] [misc/commdlg.c] ChooseFont() and ChooseColor(): Bugfixes and added more support for some CF_* and CC_* flags: dialog templates and font size control. Bugfix in structure definition of CHOOSECOLOR definition. * [ipc/dde_proc.c] [windows/event.c] Replaced SendMessage with SendMessage16 and added inclusion of dde_proc.h for error-free compilation of ipc module. Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/scroll.c] Made ScrollDC to save/restore current clipping region. * [misc/clipboard.c] [windows/event.c] Implemented most of the previously missing features (not tested), improved text pasting from/to X. * [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c] [objects/gdiobj.c] [objects/clipping.c] [windows/dce.c] [windows/winpos.c] [windows/painting.c] Updated DCE code, implemented dynamic invalidation of owned DCs. This fixes a lot of problems with scrolling in WinWord. Not sure about the effect on -desktop. Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [win32/time.c] [if1632/kernel32.spec] Added SetSystemTime and SetTimeZoneInformation. * [if1632/kernel32.spec] Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen. * [include/windows.h] Added SYSTEM_POWER_STATUS structure and prototypes for GetSystemPowerStatus, SetSystemPowerState, SetSystemTime. * [include/kernel32.h] Added a prototype for SetTimeZoneInformation. * [win32/environment.c] [if1632/kernel32.spec] Added GetSystemPowerStatus and SetSystemPowerState stubs.
parent ef702d89
This is release 960528 of Wine the MS Windows emulator. This is still a
This is release 960606 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960528: (see ChangeLog for details)
- First attempt at inter-task SendMessage(); still broken.
WHAT'S NEW with Wine-960606: (see ChangeLog for details)
- More Win32 code.
- Window repainting fixes.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -15,10 +16,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960528.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960528.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960528.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960528.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960606.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960606.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960606.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960606.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/listbox.c]
Fixed wParam of WM_DRAWITEM message.
* [if1632/Makefile.in] [loader/builtin.c]
Remove WPROCS32 DLL, as the relay code can call Wine routines
directly.
* [loader/module.c] [loader/ne_image.c]
Fixed initial stack layout for self-loading modules.
* [tools/build.c]
Fixed data segment building for Win16 modules.
* [windows/defdlg.c]
Implemented Win32 versions of DefDlgProc().
* [windows/dialog.c]
Merged Win16 and Win32 dialog code.
Added support for control extra data in dialog item template.
* [windows/win.c]
Unified Win16 and Win32 versions of CreateWindow().
Implemented Win32 version of GetWindowLong().
* [windows/winproc.c]
Changed the implementation of window procedures, so that 16-bit
winprocs are valid segmented pointers.
Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
Fixed another bug in the w95 loader. Quietened some debug output.
Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [windows/winproc.c]
Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT.
Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk>
* [resources/TODO] [resources/sysres_It.rc]
Updated font dialog box.
Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/commdlg.h] [misc/commdlg.c]
ChooseFont() and ChooseColor():
Bugfixes and added more support for some CF_* and CC_* flags:
dialog templates and font size control.
Bugfix in structure definition of CHOOSECOLOR definition.
* [ipc/dde_proc.c] [windows/event.c]
Replaced SendMessage with SendMessage16 and added inclusion of
dde_proc.h for error-free compilation of ipc module.
Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/scroll.c]
Made ScrollDC to save/restore current clipping region.
* [misc/clipboard.c] [windows/event.c]
Implemented most of the previously missing features (not tested),
improved text pasting from/to X.
* [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c]
[objects/gdiobj.c] [objects/clipping.c] [windows/dce.c]
[windows/winpos.c] [windows/painting.c]
Updated DCE code, implemented dynamic invalidation of owned DCs.
This fixes a lot of problems with scrolling in WinWord. Not
sure about the effect on -desktop.
Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [win32/time.c] [if1632/kernel32.spec]
Added SetSystemTime and SetTimeZoneInformation.
* [if1632/kernel32.spec]
Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen.
* [include/windows.h]
Added SYSTEM_POWER_STATUS structure and prototypes for
GetSystemPowerStatus, SetSystemPowerState, SetSystemTime.
* [include/kernel32.h]
Added a prototype for SetTimeZoneInformation.
* [win32/environment.c] [if1632/kernel32.spec]
Added GetSystemPowerStatus and SetSystemPowerState stubs.
----------------------------------------------------------------------
Tue May 28 19:36:36 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/combo.c]
......
......@@ -519,5 +519,6 @@ static void OB_Paint( WND *wndPtr, HDC hDC, WORD action )
dis.hDC = hDC;
dis.itemData = 0;
GetClientRect32( wndPtr->hwndSelf, &dis.rcItem );
SendMessage32A( GetParent(wndPtr->hwndSelf), WM_DRAWITEM, 1, (LPARAM)&dis);
SendMessage32A( GetParent(wndPtr->hwndSelf), WM_DRAWITEM,
wndPtr->wIDmenu, (LPARAM)&dis );
}
......@@ -60,12 +60,12 @@ static int COMBO_Init()
LPHEADCOMBO ComboGetStorageHeader(HWND hwnd)
{
return (LPHEADCOMBO)GetWindowLong(hwnd,4);
return (LPHEADCOMBO)GetWindowLong32A(hwnd,4);
}
LPHEADLIST ComboGetListHeader(HWND hwnd)
{
return (LPHEADLIST)GetWindowLong(hwnd,0);
return (LPHEADLIST)GetWindowLong32A(hwnd,0);
}
int CreateComboStruct(HWND hwnd, LONG style)
......@@ -118,7 +118,7 @@ static LRESULT CBCreate(HWND hwnd, WPARAM wParam, LPARAM lParam)
LPHEADLIST lphl;
LPHEADCOMBO lphc;
LONG style = 0;
LONG cstyle = GetWindowLong(hwnd,GWL_STYLE);
LONG cstyle = GetWindowLong32A(hwnd,GWL_STYLE);
RECT16 rect,lboxrect;
WND* wndPtr = WIN_FindWndPtr(hwnd);
char className[] = "COMBOLBOX"; /* Hack so that class names are > 0x10000 */
......@@ -172,21 +172,21 @@ static LRESULT CBCreate(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
if ((cstyle & 3) != CBS_DROPDOWNLIST)
lphc->hWndEdit = CreateWindow16(MAKE_SEGPTR(editName), (SEGPTR)0,
lphc->hWndEdit = CreateWindow16( editName, NULL,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | ES_LEFT,
0, 0, rect.right-6-CBitWidth,
lphl->StdItemHeight+2*SYSMETRICS_CYBORDER,
hwnd, (HMENU)ID_EDIT, WIN_GetWindowInstance(hwnd), 0L);
hwnd, (HMENU)ID_EDIT, WIN_GetWindowInstance(hwnd), NULL );
lboxrect.top+=lphc->LBoxTop;
lphc->hWndLBox = CreateWindow16(MAKE_SEGPTR(className), (SEGPTR)0, style |
lphc->hWndLBox = CreateWindow16( className, NULL, style |
((cstyle & WS_HSCROLL)? WS_HSCROLL : 0) |
((cstyle & WS_VSCROLL)? WS_VSCROLL : 0),
lboxrect.left, lboxrect.top,
lboxrect.right - lboxrect.left,
lboxrect.bottom - lboxrect.top,
hwndp,(HMENU)ID_CLB, WIN_GetWindowInstance(hwnd),
(SEGPTR)hwnd );
(LPVOID)(HWND32)hwnd );
wndPtr->dwStyle &= ~(WS_VSCROLL | WS_HSCROLL);
......@@ -628,7 +628,7 @@ static BOOL CBCheckSize(HWND hwnd)
{
LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
LPHEADLIST lphl = ComboGetListHeader(hwnd);
LONG cstyle = GetWindowLong(hwnd,GWL_STYLE);
LONG cstyle = GetWindowLong32A(hwnd,GWL_STYLE);
RECT16 cRect,wRect;
if (lphc->hWndLBox == 0) return FALSE;
......@@ -781,11 +781,7 @@ LRESULT ComboBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
HWND CLBoxGetCombo(HWND hwnd)
{
#ifdef WINELIB32
return (HWND)GetWindowLong(hwnd,0);
#else
return (HWND)GetWindowWord(hwnd,0);
#endif
return (HWND)GetWindowLong32A(hwnd,0);
}
LPHEADLIST CLBoxGetListHeader(HWND hwnd)
......@@ -799,11 +795,7 @@ LPHEADLIST CLBoxGetListHeader(HWND hwnd)
static LRESULT CBLCreate( HWND hwnd, WPARAM wParam, LPARAM lParam )
{
CREATESTRUCT16 *createStruct = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
#ifdef WINELIB32
SetWindowLong(hwnd,0,(LONG)createStruct->lpCreateParams);
#else
SetWindowWord(hwnd,0,LOWORD(createStruct->lpCreateParams));
#endif
SetWindowLong32A(hwnd,0,(LONG)createStruct->lpCreateParams);
return 0;
}
......
......@@ -95,9 +95,9 @@ void CreateListBoxStruct(HWND hwnd, WORD CtlType, LONG styles, HWND parent)
lphl->hSelf = hwnd;
if (CtlType==ODT_COMBOBOX) /* use the "faked" style for COMBOLBOX */
/* LBS_SORT instead CBS_SORT e.g. */
lphl->dwStyle = MAKELONG(LOWORD(styles),HIWORD(GetWindowLong(hwnd,GWL_STYLE)));
lphl->dwStyle = MAKELONG(LOWORD(styles),HIWORD(GetWindowLong32A(hwnd,GWL_STYLE)));
else
lphl->dwStyle = GetWindowLong(hwnd,GWL_STYLE); /* use original style dword */
lphl->dwStyle = GetWindowLong32A(hwnd,GWL_STYLE); /* use original style dword */
lphl->hParent = parent;
lphl->StdItemHeight = 15; /* FIXME: should get the font height */
lphl->OwnerDrawn = styles & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE);
......@@ -146,7 +146,7 @@ void DestroyListBoxStruct(LPHEADLIST lphl)
static LPHEADLIST ListBoxGetStorageHeader(HWND hwnd)
{
return (LPHEADLIST)GetWindowLong(hwnd,0);
return (LPHEADLIST)GetWindowLong32A(hwnd,0);
}
/* Send notification "code" as part of a WM_COMMAND-message if hwnd
......@@ -245,7 +245,7 @@ void ListBoxDrawItem (HWND hwnd, LPHEADLIST lphl, HDC hdc, LPLISTSTRUCT lpls,
dis.itemAction = itemAction;
dis.itemState = itemState;
CONV_RECT16TO32( rect, &dis.rcItem );
SendMessage32A( lphl->hParent, WM_DRAWITEM, 0, (LPARAM)&dis );
SendMessage32A( lphl->hParent, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis );
return;
}
if (itemAction == ODA_DRAWENTIRE || itemAction == ODA_SELECT) {
......@@ -315,7 +315,7 @@ void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls)
*lpmeasure = lpls->mis;
lpmeasure->itemHeight = lphl->StdItemHeight;
SendMessage16(lphl->hParent, WM_MEASUREITEM, 0, (LPARAM)USER_HEAP_SEG_ADDR(hTemp));
SendMessage16(lphl->hParent, WM_MEASUREITEM, lphl->CtlID, (LPARAM)USER_HEAP_SEG_ADDR(hTemp));
if (lphl->dwStyle & LBS_OWNERDRAWFIXED) {
if (lpmeasure->itemHeight > lphl->StdItemHeight)
......@@ -765,7 +765,7 @@ int ListBoxFindNextMatch(LPHEADLIST lphl, WORD wChar)
static LONG LBCreate(HWND hwnd, WORD wParam, LONG lParam)
{
LPHEADLIST lphl;
LONG dwStyle = GetWindowLong(hwnd,GWL_STYLE);
LONG dwStyle = GetWindowLong32A(hwnd,GWL_STYLE);
RECT16 rect;
CreateListBoxStruct(hwnd, ODT_LISTBOX, dwStyle, GetParent(hwnd));
......@@ -978,7 +978,7 @@ static LONG LBLButtonDown(HWND hwnd, WORD wParam, LONG lParam)
}
#ifndef WINELIB
if (GetWindowLong(lphl->hSelf,GWL_EXSTYLE) & WS_EX_DRAGDETECT)
if (GetWindowLong32A(lphl->hSelf,GWL_EXSTYLE) & WS_EX_DRAGDETECT)
if( DragDetect(lphl->hSelf,MAKEPOINT16(lParam)) )
SendMessage16(lphl->hParent, WM_BEGINDRAG,0,0L);
#endif
......
......@@ -774,11 +774,12 @@ static BOOL MENU_ShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, int x, int y)
if (!pTopPWnd)
{
pTopPWnd = WIN_FindWndPtr(CreateWindow16( POPUPMENU_CLASS_ATOM, (SEGPTR)0,
WS_POPUP | WS_BORDER, x, y,
menu->Width + 2*SYSMETRICS_CXBORDER,
menu->Height + 2*SYSMETRICS_CYBORDER,
0, 0, wndPtr->hInstance, (SEGPTR)hmenu ));
pTopPWnd = WIN_FindWndPtr(CreateWindow16( POPUPMENU_CLASS_ATOM, NULL,
WS_POPUP | WS_BORDER, x, y,
menu->Width + 2*SYSMETRICS_CXBORDER,
menu->Height + 2*SYSMETRICS_CYBORDER,
0, 0, wndPtr->hInstance,
(LPVOID)(HMENU32)hmenu ));
if (!pTopPWnd) return FALSE;
skip_init = TRUE;
}
......@@ -786,11 +787,12 @@ static BOOL MENU_ShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, int x, int y)
if( uSubPWndLevel )
{
/* create new window for the submenu */
HWND hWnd = CreateWindow16( POPUPMENU_CLASS_ATOM, (SEGPTR)0,
HWND hWnd = CreateWindow16( POPUPMENU_CLASS_ATOM, NULL,
WS_POPUP | WS_BORDER, x, y,
menu->Width + 2*SYSMETRICS_CXBORDER,
menu->Height + 2*SYSMETRICS_CYBORDER,
menu->hWnd, 0, wndPtr->hInstance, (SEGPTR)hmenu );
menu->hWnd, 0, wndPtr->hInstance,
(LPVOID)(HMENU32)hmenu );
if( !hWnd ) return FALSE;
menu->hWnd = hWnd;
}
......@@ -1832,13 +1834,7 @@ LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
case WM_CREATE:
{
CREATESTRUCT16 *cs = (CREATESTRUCT16*)PTR_SEG_TO_LIN(lParam);
#ifdef WINELIB32
HMENU hmenu = (HMENU) (cs->lpCreateParams);
SetWindowLong( hwnd, 0, hmenu );
#else
HMENU hmenu = (HMENU) ((int)cs->lpCreateParams & 0xffff);
SetWindowWord( hwnd, 0, hmenu );
#endif
SetWindowLong32A( hwnd, 0, (LONG)cs->lpCreateParams );
return 0;
}
......@@ -1850,12 +1846,7 @@ LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
PAINTSTRUCT16 ps;
BeginPaint16( hwnd, &ps );
MENU_DrawPopupMenu( hwnd, ps.hdc,
#ifdef WINELIB32
(HMENU)GetWindowLong( hwnd, 0 )
#else
(HMENU)GetWindowWord( hwnd, 0 )
#endif
);
(HMENU)GetWindowLong32A( hwnd, 0 ) );
EndPaint16( hwnd, &ps );
return 0;
}
......@@ -1872,12 +1863,7 @@ LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
break;
case WM_USER:
if( wParam )
#ifdef WINELIB32
SetWindowLong( hwnd, 0, (HMENU)wParam );
#else
SetWindowWord( hwnd, 0, (HMENU)wParam );
#endif
if (wParam) SetWindowLong32A( hwnd, 0, (HMENU)wParam );
break;
default:
return DefWindowProc16(hwnd, message, wParam, lParam);
......
......@@ -42,7 +42,6 @@ DLLS = \
winsock.spec \
winspool.spec \
wprocs.spec \
wprocs32.spec \
wsock32.spec
SPEC_FILES = $(DLLS:.spec=.S)
......
......@@ -156,9 +156,9 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
180 pascal16 SetDCState(word word) SetDCState
181 pascal16 RectInRegionOld(word ptr) RectInRegion16
188 stub GetTextExtentEx
190 stub SetDCHook
191 stub GetDCHook
192 stub SetHookFlags
190 pascal16 SetDCHook(word segptr long) SetDCHook
191 pascal GetDCHook(word ptr) GetDCHook
192 pascal16 SetHookFlags(word word) SetHookFlags
193 stub SetBoundsRect
194 stub GetBoundsRect
195 stub SelectBitmap
......
......@@ -510,7 +510,7 @@ base 1
0504 stub SetProcessShutdownParameters
0505 stub SetProcessWorkingSetSize
0506 stub SetStdHandle
0507 stub SetSystemTime
0507 stdcall SetSystemTime(ptr) SetSystemTime
0508 stub SetSystemTimeAdjustment
0509 stub SetTapeParameters
0510 stub SetTapePosition
......@@ -518,7 +518,7 @@ base 1
0512 stub SetThreadContext
0513 stub SetThreadLocale
0514 stub SetThreadPriority
0515 stub SetTimeZoneInformation
0515 stdcall SetTimeZoneInformation(ptr) SetTimeZoneInformation
0516 stdcall SetUnhandledExceptionFilter(ptr) SetUnhandledExceptionFilter
0517 stub SetVDMCurrentDirectories
0518 stub SetVolumeLabelA
......@@ -601,22 +601,22 @@ base 1
0595 stub _lopen
0596 stub _lread
0597 stub _lwrite
0598 stub lstrcat
0599 stub lstrcatA
0598 stdcall lstrcat(ptr ptr) strcat
0599 stdcall lstrcatA(ptr ptr) strcat
0600 stub lstrcatW
0601 stub lstrcmp
0602 stub lstrcmpA
0601 stdcall lstrcmp(ptr ptr) strcmp
0602 stdcall lstrcmpA(ptr ptr) strcmp
0603 stub lstrcmpW
0604 stub lstrcmpi
0605 stub lstrcmpiA
0606 stub lstrcmpiW
0607 stub lstrcpy
0607 stdcall lstrcpy(ptr ptr) strcpy
0608 stdcall lstrcpyA(ptr ptr) strcpy
0609 stub lstrcpyW
0610 stub lstrcpyn
0611 stub lstrcpynA
0612 stub lstrcpynW
0613 stub lstrlen
0613 stdcall lstrlen(ptr) strlen
0614 stdcall lstrlenA(ptr) strlen
0615 stub lstrlenW
#late additions
......@@ -625,7 +625,7 @@ base 1
0618 stub GetPrivateProfileStructA
0619 stub GetPrivateProfileStructW
0620 stub GetProcessVersion
0621 stub GetSystemPowerStatus
0621 stdcall GetSystemPowerStatus(ptr) GetSystemPowerStatus
0622 stub GetSystemTimeAsFileTime
0623 stub HeapCreateTagsW
0624 stub HeapExtend
......@@ -634,7 +634,7 @@ base 1
0627 stub HeapUsage
0628 stub IsDebuggerPresent
0629 stub PostQueuedCompletionStatus
0630 stub SetSystemPowerState
0630 stdcall SetSystemPowerState(byte byte) SetSystemPowerState
0631 stub WritePrivateProfileStructA
0632 stub WritePrivateProfileStructW
0633 stub MakeCriticalSectionGlobal
......@@ -40,7 +40,7 @@ heap 65520
38 pascal16 GetWindowTextLength(word) GetWindowTextLength
39 pascal16 BeginPaint(word ptr) BeginPaint16
40 pascal16 EndPaint(word ptr) EndPaint16
41 pascal16 CreateWindow(segptr segptr long s_word s_word s_word s_word
41 pascal16 CreateWindow(ptr ptr long s_word s_word s_word s_word
word word word segptr) CreateWindow16
42 pascal16 ShowWindow(word word) ShowWindow
43 pascal16 CloseWindow(word) CloseWindow
......@@ -86,9 +86,9 @@ heap 65520
83 pascal16 FrameRect(word ptr word) FrameRect16
84 pascal16 DrawIcon(word s_word s_word word) DrawIcon
85 pascal16 DrawText(word ptr s_word ptr word) DrawText16
87 pascal16 DialogBox(word segptr word segptr) DialogBox
87 pascal16 DialogBox(word segptr word segptr) DialogBox16
88 pascal16 EndDialog(word s_word) EndDialog
89 pascal16 CreateDialog(word segptr word segptr) CreateDialog
89 pascal16 CreateDialog(word segptr word segptr) CreateDialog16
90 pascal16 IsDialogMessage(word ptr) IsDialogMessage
91 pascal16 GetDlgItem(word word) GetDlgItem
92 pascal16 SetDlgItemText(word word segptr) SetDlgItemText16
......@@ -134,7 +134,7 @@ heap 65520
132 pascal SetClassLong(word s_word long) SetClassLong16
133 pascal16 GetWindowWord(word s_word) GetWindowWord
134 pascal16 SetWindowWord(word s_word word) SetWindowWord
135 pascal GetWindowLong(word s_word) GetWindowLong
135 pascal GetWindowLong(word s_word) GetWindowLong16
136 pascal SetWindowLong(word s_word long) SetWindowLong16
137 pascal16 OpenClipboard(word) OpenClipboard
138 pascal16 CloseClipboard() CloseClipboard
......@@ -218,8 +218,8 @@ heap 65520
215 pascal16 FlushComm(word word) FlushComm
#216 USERSEEUSERDO
217 pascal16 LookupMenuHandle(word s_word) LookupMenuHandle
218 pascal16 DialogBoxIndirect(word word word segptr) DialogBoxIndirect
219 pascal16 CreateDialogIndirect(word segptr word segptr) CreateDialogIndirect
218 pascal16 DialogBoxIndirect(word word word segptr) DialogBoxIndirect16
219 pascal16 CreateDialogIndirect(word ptr word segptr) CreateDialogIndirect16
220 pascal16 LoadMenuIndirect(ptr) LoadMenuIndirect16
221 pascal16 ScrollDC(word s_word s_word ptr ptr word ptr) ScrollDC
222 pascal16 GetKeyboardState(ptr) GetKeyboardState
......@@ -239,12 +239,12 @@ heap 65520
236 pascal16 GetCapture() GetCapture
237 pascal16 GetUpdateRgn(word word word) GetUpdateRgn
238 pascal16 ExcludeUpdateRgn(word word) ExcludeUpdateRgn
239 pascal16 DialogBoxParam(word segptr word segptr long) DialogBoxParam
239 pascal16 DialogBoxParam(word segptr word segptr long) DialogBoxParam16
240 pascal16 DialogBoxIndirectParam(word word word segptr long)
DialogBoxIndirectParam
241 pascal16 CreateDialogParam(word segptr word segptr long) CreateDialogParam
242 pascal16 CreateDialogIndirectParam(word segptr word segptr long)
CreateDialogIndirectParam
DialogBoxIndirectParam16
241 pascal16 CreateDialogParam(word segptr word segptr long) CreateDialogParam16
242 pascal16 CreateDialogIndirectParam(word ptr word segptr long)
CreateDialogIndirectParam16
243 pascal GetDialogBaseUnits() GetDialogBaseUnits
244 pascal16 EqualRect(ptr ptr) EqualRect16
245 stub EnableCommNotification
......@@ -302,7 +302,7 @@ heap 65520
300 stub UnloadInstalledDrivers
#301 BOZOSLIVEHERE :-)) <- this is actually EditWndProc
#306 BEAR306
308 pascal DefDlgProc(word word word long) DefDlgProc
308 pascal DefDlgProc(word word word long) DefDlgProc16
309 pascal16 GetClipCursor(ptr) GetClipCursor16
314 stub SignalProc
319 pascal16 ScrollWindowEx(word s_word s_word ptr ptr word ptr word)
......@@ -327,7 +327,7 @@ heap 65520
357 stub LoadDIBIconHandler
358 pascal16 IsMenu(word) IsMenu
359 pascal16 GetDCEx(word word long) GetDCEx
362 stub DCHook
362 pascal16 DCHook(word word long long) DCHook
364 stub LookupIconIDFromDirectoryEx
368 pascal16 CopyIcon(word word) CopyIcon
369 pascal16 CopyCursor(word word) CopyCursor
......@@ -397,7 +397,7 @@ heap 65520
449 stub DrawState
450 stub CreateIconFromResourceEx
451 pascal16 TranslateMDISysAccel(word ptr) TranslateMDISysAccel
452 pascal16 CreateWindowEx(long segptr segptr long s_word s_word s_word s_word
452 pascal16 CreateWindowEx(long ptr ptr long s_word s_word s_word s_word
word word word segptr) CreateWindowEx16
454 pascal16 AdjustWindowRectEx(ptr long word long) AdjustWindowRectEx16
455 pascal16 GetIconID(word long) GetIconID
......
......@@ -71,15 +71,11 @@ base 1
0066 stub CreateCursor
0067 stub CreateDesktopA
0068 stub CreateDesktopW
0069 stdcall CreateDialogIndirectParamA(long ptr long ptr long)
USER32_CreateDialogIndirectParamA
0069 stdcall CreateDialogIndirectParamA(long ptr long ptr long) CreateDialogIndirectParam32A
0070 stub CreateDialogIndirectParamAorW
0071 stdcall CreateDialogIndirectParamW(long ptr long ptr long)
USER32_CreateDialogIndirectParamW
0072 stdcall CreateDialogParamA(long ptr long ptr long)
USER32_CreateDialogParamA
0073 stdcall CreateDialogParamW(long ptr long ptr long)
USER32_CreateDialogParamW
0071 stdcall CreateDialogIndirectParamW(long ptr long ptr long) CreateDialogIndirectParam32W
0072 stdcall CreateDialogParamA(long ptr long ptr long) CreateDialogParam32A
0073 stdcall CreateDialogParamW(long ptr long ptr long) CreateDialogParam32W
0074 stub CreateIcon
0075 stub CreateIconFromResource
0076 stub CreateIconFromResourceEx
......@@ -127,8 +123,8 @@ base 1
0116 stub DdeSetUserHandle
0117 stub DdeUnaccessData
0118 stub DdeUninitialize
0119 stub DefDlgProcA
0120 stub DefDlgProcW
0119 stdcall DefDlgProcA(long long long long) DefDlgProc32A
0120 stdcall DefDlgProcW(long long long long) DefDlgProc32W
0121 stdcall DefFrameProcA(long long long long long) DefFrameProc32A
0122 stdcall DefFrameProcW(long long long long long) DefFrameProc32W
0123 stdcall DefMDIChildProcA(long long long long) DefMDIChildProc32A
......@@ -143,13 +139,11 @@ base 1
0132 stub DestroyIcon
0133 stub DestroyMenu
0134 stub DestroyWindow
0135 stdcall DialogBoxIndirectParamA(long ptr long ptr long)
USER32_DialogBoxIndirectParamA
0135 stdcall DialogBoxIndirectParamA(long ptr long ptr long) DialogBoxIndirectParam32A
0136 stub DialogBoxIndirectParamAorW
0137 stdcall DialogBoxIndirectParamW(long ptr long ptr long)
USER32_DialogBoxIndirectParamW
0138 stdcall DialogBoxParamA(long ptr long ptr long) USER32_DialogBoxParamA
0139 stdcall DialogBoxParamW(long ptr long ptr long) USER32_DialogBoxParamW
0137 stdcall DialogBoxIndirectParamW(long ptr long ptr long) DialogBoxIndirectParam32W
0138 stdcall DialogBoxParamA(long ptr long ptr long) DialogBoxParam32A
0139 stdcall DialogBoxParamW(long ptr long ptr long) DialogBoxParam32W
0140 stdcall DispatchMessageA(ptr) USER32_DispatchMessageA
0141 stub DispatchMessageW
0142 stub DlgDirListA
......@@ -314,8 +308,8 @@ base 1
0301 stdcall GetWindow(long long) GetWindow
0302 stub GetWindowContextHelpId
0303 stdcall GetWindowDC(long) GetWindowDC
0304 stub GetWindowLongA
0305 stub GetWindowLongW
0304 stdcall GetWindowLongA(long long) GetWindowLong32A
0305 stdcall GetWindowLongW(long long) GetWindowLong32W
0306 stdcall GetWindowPlacement(long ptr) GetWindowPlacement32
0307 stdcall GetWindowRect(long ptr) GetWindowRect32
0308 stdcall GetWindowTextA(long ptr long) GetWindowText32A
......
......@@ -7,7 +7,7 @@ type win16
5 pascal ComboBoxWndProc(word word word long) ComboBoxWndProc
6 pascal EditWndProc(word word word long) EditWndProc
7 pascal PopupMenuWndProc(word word word long) PopupMenuWndProc
9 pascal DefDlgProc(word word word long) DefDlgProc
9 pascal DefDlgProc(word word word long) DefDlgProc16
10 pascal MDIClientWndProc(word word word long) MDIClientWndProc
13 pascal SystemMessageBoxProc(word word word long) SystemMessageBoxProc
14 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc
......
name wprocs32
type win32
2 stdcall StaticWndProc(long long long long) StaticWndProc32
3 stdcall ScrollBarWndProc(long long long long) ScrollBarWndProc32
4 stdcall ListBoxWndProc(long long long long) ListBoxWndProc32
5 stdcall ComboBoxWndProc(long long long long) ComboBoxWndProc32
6 stdcall EditWndProc(long long long long) EditWndProc32
7 stdcall PopupMenuWndProc(long long long long) PopupMenuWndProc32
9 stdcall DefDlgProc(long long long long) DefDlgProc32
10 stdcall MDIClientWndProc(long long long long) MDIClientWndProc32
11 stdcall DefWindowProc(long long long long) DefWindowProc32A
13 stdcall SystemMessageBoxProc(long long long long) SystemMessageBoxProc32
14 stdcall FileOpenDlgProc(long long long long) FileOpenDlgProc32
15 stdcall FileSaveDlgProc(long long long long) FileSaveDlgProc32
16 stdcall ColorDlgProc(long long long long) ColorDlgProc32
17 stdcall FindTextDlgProc(long long long long) FindTextDlgProc32
18 stdcall ReplaceTextDlgProc(long long long long) ReplaceTextDlgProc32
19 stdcall PrintSetupDlgProc(long long long long) PrintSetupDlgProc32
20 stdcall PrintDlgProc(long long long long) PrintDlgProc32
21 stdcall AboutDlgProc(long long long long) AboutDlgProc32
22 stdcall ComboLBoxWndProc(long long long long) ComboLBoxWndProc32
23 stdcall CARET_Callback(long long long long) CARET_Callback
......@@ -39,7 +39,7 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
extern BOOL BITMAP_Init(void);
extern int BITMAP_GetObject( BITMAPOBJ * bmp, int count, LPSTR buffer );
extern BOOL BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bitmap );
extern HBITMAP BITMAP_SelectObject( HDC hdc, DC * dc, HBITMAP hbitmap,
extern HBITMAP BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
BITMAPOBJ * bmp );
/* objects/dib.c */
......
......@@ -27,7 +27,6 @@ typedef struct
extern BOOL BRUSH_Init(void);
extern int BRUSH_GetObject( BRUSHOBJ * brush, int count, LPSTR buffer );
extern BOOL BRUSH_DeleteObject( HBRUSH hbrush, BRUSHOBJ * brush );
extern HBRUSH BRUSH_SelectObject( HDC hdc, DC * dc, HBRUSH hbrush,
BRUSHOBJ * brush );
extern HBRUSH BRUSH_SelectObject( DC * dc, HBRUSH hbrush, BRUSHOBJ * brush );
#endif /* __WINE_BRUSH_H */
......@@ -34,6 +34,7 @@ extern LONG CallTo16_long_wwl ( FARPROC, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_llwl ( FARPROC, WORD, LONG, LONG, WORD, LONG );
extern LONG CallTo16_long_wwwl ( FARPROC, WORD, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_lwww ( FARPROC, WORD, LONG, WORD, WORD, WORD );
extern WORD CallTo16_word_wwll ( FARPROC, WORD, WORD, WORD, LONG, LONG);
extern WORD CallTo16_word_wllwl( FARPROC, WORD, WORD, LONG, LONG, WORD, LONG );
extern WORD CallTo16_word_wwlll( FARPROC, WORD, WORD, WORD, LONG, LONG, LONG );
extern LONG CallTo16_long_lllllllwlwwwl( FARPROC, WORD, LONG, LONG, LONG,
......@@ -71,6 +72,8 @@ extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD bp, WORD ax,
CallTo16_long_wwwl( func, ds, hwnd, msg, wParam, lParam )
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
CallTo16_word_lwww( func, CURRENT_DS, lpch, ichCurrent, cch, code )
#define CallDCHookProc( func, hdc, code, data, lparam) \
CallTo16_word_wwll( func, CURRENT_DS, hdc, code, data, lparam )
#define CallWndProcNCCREATE16( func, ds, exStyle, clsName, winName, style, \
x, y, cx, cy, hparent, hmenu, instance, \
params, hwnd, msg, wParam, lParam ) \
......@@ -124,6 +127,8 @@ extern LONG CallTo32_4( FARPROC32, DWORD, DWORD, DWORD, DWORD );
(*func)( hwnd, msg, wParam, lParam )
#define CallWndProc32( func, hwnd, msg, wParam, lParam ) \
(*func)( hwnd, msg, wParam, lParam )
#define CallDCHookProc( func, hdc, code, data, lparam ) \
(*func)( hdc, code, data, lparam )
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
(*func)( lpch, ichCurrent, cch, code )
......
......@@ -17,7 +17,7 @@ typedef struct tagCLASS
UINT32 magic; /* Magic number */
UINT32 cWindows; /* Count of existing windows */
UINT32 style; /* Class style */
WNDPROC16 lpfnWndProc; /* Window procedure */
HANDLE32 winproc; /* Window procedure */
INT32 cbClsExtra; /* Class extra bytes */
INT32 cbWndExtra; /* Window extra bytes */
LPSTR menuNameA; /* Default menu name (ASCII string) */
......
#ifndef __WINE_CLIPBOARD_H
#define __WINE_CLIPBOARD_H
extern void CLIPBOARD_ReadSelection(Window w,Atom prop);
void CLIPBOARD_ReadSelection(Window w,Atom prop);
void CLIPBOARD_ReleaseSelection(HWND hwnd);
void CLIPBOARD_DisOwn(HWND hWnd);
BOOL CLIPBOARD_IsPresent(WORD wFormat);
#endif /* __WINE_CLIPBOARD_H */
......@@ -2,8 +2,12 @@
* COMMDLG - Common Wine Dialog ... :-)
*/
#ifndef COMMDLG_H
#define COMMDLG_H
#ifndef __WINE_COMMDLG_H
#define __WINE_COMMDLG_H
#ifdef __cplusplus
extern "C" {
#endif
#include "wintypes.h" /* needed for CHOOSEFONT structure */
......@@ -87,7 +91,7 @@ typedef struct {
DWORD Flags;
LPARAM lCustData;
UINT (*lpfnHook)(HWND, UINT, WPARAM, LPARAM);
LPCSTR lpTemplateName;
SEGPTR lpTemplateName;
} CHOOSECOLOR;
typedef CHOOSECOLOR *LPCHOOSECOLOR;
......@@ -306,6 +310,8 @@ LRESULT FormatCharDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
#pragma pack(4)
#endif
#endif /* #ifdef COMMDLG_H */
#ifdef __cplusplus
}
#endif
#endif /* __WINE_COMMDLG_H */
......@@ -10,11 +10,12 @@
#include "gdi.h"
extern void DC_InitDC( HDC hdc );
extern void DC_InitDC( DC* dc );
extern BOOL DC_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors );
extern BOOL DC_SetupGCForBrush( DC * dc );
extern BOOL DC_SetupGCForPen( DC * dc );
extern BOOL DC_SetupGCForText( DC * dc );
extern BOOL DC_CallHookProc( DC * dc, WORD code, LPARAM lParam );
extern const int DC_XROPfunction[];
......
......@@ -9,6 +9,21 @@
#include "windows.h"
/* additional DCX flags
*/
#define DCX_NORESETATTR 0x00000004
#define DCX_EXCLUDEUPDATE 0x00000100
#define DCX_INTERSECTUPDATE 0x00000200
#define DCX_LOCKWINDOWUPDATE 0x00000400
#define DCX_NORECOMPUTE 0x00100000
#define DCX_VALIDATE 0x00200000
#define DCX_DCEBUSY 0x00001000
#define DCX_WINDOWPAINT 0x00020000
#define DCX_KEEPCLIPRGN 0x00040000
#define DCX_NOCLIPCHILDREN 0x00080000
typedef enum
{
DCE_CACHE_DC, /* This is a cached DC (allocated by USER) */
......@@ -20,17 +35,17 @@ typedef enum
typedef struct tagDCE
{
HANDLE hNext;
HDC hDC;
HWND hwndCurrent;
HDC hdc;
HWND hwndDC;
HRGN hClipRgn;
DCE_TYPE type;
BOOL inUse;
WORD xOrigin;
WORD yOrigin;
DWORD DCXflags;
} DCE;
extern void DCE_Init(void);
extern HANDLE DCE_AllocDCE( DCE_TYPE type );
extern void DCE_FreeDCE( HANDLE hdce );
extern void DCE_Init(void);
extern HANDLE DCE_AllocDCE( HWND hWnd, DCE_TYPE type );
extern void DCE_FreeDCE( HANDLE hdce );
#endif /* DCE_H */
......@@ -9,19 +9,14 @@
#include "windows.h"
extern BOOL DIALOG_Init(void);
extern HWND DIALOG_GetFirstTabItem( HWND hwndDlg );
#pragma pack(1)
/* Dialog info structure.
* This structure is stored into the window extra bytes (cbWndExtra).
* sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30).
*/
typedef struct
{
LONG msgResult; /* Result of EndDialog() / Default button id */
WNDPROC dlgProc; /* Dialog procedure */
INT32 msgResult; /* Result of EndDialog() / Default button id */
HANDLE32 dlgProc; /* Dialog procedure */
LONG userInfo; /* User information (for DWL_USER) */
HWND hwndFocus; /* Current control with focus */
HFONT hUserFont; /* Dialog font */
......@@ -32,38 +27,7 @@ typedef struct
HANDLE hDialogHeap;
} DIALOGINFO;
/* Dialog control header */
typedef struct
{
DWORD style;
WORD x;
WORD y;
WORD cx;
WORD cy;
WORD id;
} DLGCONTROLHEADER;
/* Dialog template */
typedef struct
{
DWORD style;
WORD nbItems;
WORD x;
WORD y;
WORD cx;
WORD cy;
SEGPTR menuName;
SEGPTR className;
SEGPTR caption;
WORD pointSize;
SEGPTR faceName;
} DLGTEMPLATE;
#pragma pack(4)
extern WORD xBaseUnit,yBaseUnit;
int DIALOG_DoDialogBox( HWND hwnd, HWND owner );
extern BOOL DIALOG_Init(void);
extern HWND DIALOG_GetFirstTabItem( HWND hwndDlg );
#endif /* DIALOG_H */
......@@ -185,6 +185,9 @@ typedef struct tagDC
{
GDIOBJHDR header;
WORD saveLevel;
DWORD dwHookData;
FARPROC16 hookProc;
HDC hSelf;
WIN_DC_INFO w;
union
{
......@@ -193,9 +196,18 @@ typedef struct tagDC
} u;
} DC;
/* DC hook codes */
#define DCHC_INVALIDVISRGN 0x0001
#define DCHC_DELETEDC 0x0002
#define DCHF_INVALIDATEVISRGN 0x0001
#define DCHF_VALIDATEVISRGN 0x0002
/* DC flags */
#define DC_MEMORY 1 /* It is a memory DC */
#define DC_SAVED 2 /* It is a saved DC */
#define DC_MEMORY 0x0001 /* It is a memory DC */
#define DC_SAVED 0x0002 /* It is a saved DC */
#define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
#define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
/* Last 32 bytes are reserved for stock object handles */
#define GDI_HEAP_SIZE 0xffe0
......@@ -267,6 +279,10 @@ extern BOOL GDI_Init(void);
extern HANDLE GDI_AllocObject( WORD, WORD );
extern BOOL GDI_FreeObject( HANDLE );
extern GDIOBJHDR * GDI_GetObjPtr( HANDLE, WORD );
extern FARPROC16 GDI_GetDefDCHook(void);
#define UpdateDirtyDC(dc) \
DC_CallHookProc(dc, DCHC_INVALIDVISRGN, 0)
extern Display * display;
extern Screen * screen;
......
......@@ -119,4 +119,6 @@ typedef struct
#define FILE_ATTRIBUTE_ATOMIC_WRITE 0x0200
#define FILE_ATTRIBUTE_XACTION_WRITE 0x0400
BOOL SetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
#endif /* __WINE_KERNEL32_H */
......@@ -127,7 +127,6 @@ extern WORD MODULE_GetOrdinal( HMODULE hModule, const char *name );
extern SEGPTR MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal );
extern BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC32 MODULE_GetWndProcEntry32( const char *name );
/* builtin.c */
extern BOOL BUILTIN_Init(void);
......
......@@ -35,16 +35,6 @@ typedef struct {
WORD cy WINE_PACKED;
} DLGTEMPLATE32;
typedef struct {
DWORD style;
DWORD dwExtendedStyle;
short x WINE_PACKED;
short y WINE_PACKED;
short cx WINE_PACKED;
short cy WINE_PACKED;
WORD id WINE_PACKED;
} DLGITEMTEMPLATE32;
typedef struct tagMSG32
{
DWORD hwnd;
......
......@@ -34,10 +34,10 @@ typedef struct tagWND
struct tagWND *parent; /* Window parent (from CreateWindow) */
struct tagWND *owner; /* Window owner */
CLASS *class; /* Window class */
HANDLE32 winproc; /* Window procedure */
DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
HWND16 hwndSelf; /* Handle of this window */
HINSTANCE16 hInstance; /* Window hInstance (from CreateWindow) */
WNDPROC16 lpfnWndProc; /* Window procedure */
RECT16 rectClient; /* Client area rel. to parent client area */
RECT16 rectWindow; /* Whole window rel. to parent client area */
RECT16 rectNormal; /* Window rect. when in normal state */
......@@ -57,6 +57,7 @@ typedef struct tagWND
Window window; /* X window (only for top-level windows) */
HMENU hSysMenu; /* window's copy of System Menu */
HANDLE hProp; /* Handle of Properties List */
DWORD userdata; /* User private data */
DWORD wExtra[1]; /* Window extra bytes */
} WND;
......
......@@ -17,9 +17,11 @@ typedef enum
WIN_PROC_32W
} WINDOWPROCTYPE;
extern WNDPROC16 WINPROC_AllocWinProc( WNDPROC32 func, WINDOWPROCTYPE type );
extern WINDOWPROCTYPE WINPROC_GetWinProcType( WNDPROC16 func );
extern WNDPROC32 WINPROC_GetWinProcFunc( WNDPROC16 func );
extern void WINPROC_FreeWinProc( WNDPROC16 func );
extern HANDLE32 WINPROC_AllocWinProc( UINT32 func, WINDOWPROCTYPE type );
extern HANDLE32 WINPROC_CopyWinProc( HANDLE32 handle );
extern void WINPROC_FreeWinProc( HANDLE32 handle );
extern WINDOWPROCTYPE WINPROC_GetWinProcType( HANDLE32 handle );
extern WNDPROC16 WINPROC_GetFunc16( HANDLE32 handle );
extern WNDPROC32 WINPROC_GetFunc32( HANDLE32 handle );
#endif /* __WINE_WINPROC_H */
......@@ -345,6 +345,7 @@ typedef FARPROC HOOKPROC;
(((DWORD)((WORD)(high))) << 16)))
#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high))
#define MAKEWPARAM(low,high) ((WPARAM32)MAKELONG(low,high))
#define MAKEINTATOM(atom) ((LPCSTR)MAKELONG((atom),0))
#define SELECTOROF(ptr) (HIWORD(ptr))
#define OFFSETOF(ptr) (LOWORD(ptr))
......
......@@ -452,7 +452,7 @@ int DDE_GetRemoteMessage()
remote_message->wParam, (int)remote_message->lParam);
/* execute the recieved message */
passed= SendMessage(dde_window, remote_message->message,
passed= SendMessage16(dde_window, remote_message->message,
remote_message->wParam, remote_message->lParam);
/* Tell the sended, that the message is here */
......@@ -481,7 +481,7 @@ int DDE_GetRemoteMessage()
{
if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION) {
if (was_sent)
SendMessage( wndPtr->hwndSelf, remote_message->message,
SendMessage16( wndPtr->hwndSelf, remote_message->message,
remote_message->wParam, remote_message->lParam );
else
PostMessage( wndPtr->hwndSelf, remote_message->message,
......@@ -528,7 +528,7 @@ void DDE_TestDDE(HWND hwnd)
if (hwnd==0)
hwnd=-1;
/* just send a message to see how things are going */
SendMessage( hwnd, WM_DDE_INITIATE, 0, 0);
SendMessage16( hwnd, WM_DDE_INITIATE, 0, 0);
}
void dde_proc_delete(int proc_idx)
......@@ -553,7 +553,7 @@ void stop_wait(int a)
static void print_dde_message(char *desc, MSG *msg)
{
extern const char *MessageTypeNames[];
/* extern const char *MessageTypeNames[];*/
extern int debug_last_handle_size;
WORD wStatus,hWord;
void *ptr;
......@@ -571,7 +571,7 @@ static void print_dde_message(char *desc, MSG *msg)
fprintf(stddeb,"%s", desc);
fprintf(stddeb,"%04x %04x==%s %04x %08lx ",
msg->hwnd, msg->message,MessageTypeNames[msg->message],
msg->hwnd, msg->message,"",/*MessageTypeNames[msg->message],*/
msg->wParam, msg->lParam);
switch(msg->message) {
case WM_DDE_INITIATE:
......
......@@ -103,16 +103,6 @@ WNDPROC MODULE_GetWndProcEntry16( char *name )
return ErrorProc;
}
/***********************************************************************
* MODULE_GetWndProcEntry32 (not a Windows API function)
*
* Return an entry point from the WPROCS32 dll.
*/
WNDPROC MODULE_GetWndProcEntry32( char *name )
{
return MODULE_GetWndProcEntry16( name );
}
void DEBUG_EnterDebugger(void)
{
}
......
......@@ -103,7 +103,6 @@ extern const DLL_DESCRIPTOR KERNEL32_Descriptor;
extern const DLL_DESCRIPTOR NTDLL_Descriptor;
extern const DLL_DESCRIPTOR SHELL32_Descriptor;
extern const DLL_DESCRIPTOR USER32_Descriptor;
extern const DLL_DESCRIPTOR WPROCS32_Descriptor;
extern const DLL_DESCRIPTOR WINSPOOL_Descriptor;
extern const DLL_DESCRIPTOR WSOCK32_Descriptor;
......@@ -151,7 +150,6 @@ static BUILTIN_DLL BuiltinDLLs[] =
{ &NTDLL_Descriptor, 0 },
{ &SHELL32_Descriptor, 0 },
{ &USER32_Descriptor, 0 },
{ &WPROCS32_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &WINSPOOL_Descriptor, 0 },
{ &WSOCK32_Descriptor, 0 },
/* Last entry */
......
......@@ -775,25 +775,6 @@ FARPROC16 MODULE_GetWndProcEntry16( const char *name )
/***********************************************************************
* MODULE_GetWndProcEntry32 (not a Windows API function)
*
* Return an entry point from the WPROCS32 dll.
*/
#ifndef WINELIB
FARPROC32 MODULE_GetWndProcEntry32( const char *name )
{
FARPROC32 ret;
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle( "WPROCS32" );
if (!(ret = PE_GetProcAddress( hModule, name )))
fprintf( stderr, "GetWndProc32: %s not found, please report\n", name );
return ret;
}
#endif
/***********************************************************************
* MODULE_GetModuleName
*/
LPSTR MODULE_GetModuleName( HMODULE hModule )
......@@ -1003,7 +984,7 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
char *p;
/* Try with prepending the path of the current module */
GetModuleFileName( hModule, buffer, 256 );
GetModuleFileName( hModule, buffer, sizeof(buffer) );
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
......@@ -1033,6 +1014,7 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
/* Handle self loading modules */
SEGTABLEENTRY * pSegTable = (SEGTABLEENTRY *) NE_SEG_TABLE(pModule);
SELFLOADHEADER *selfloadheader;
STACK16FRAME *stack16Top;
HMODULE hselfload = GetModuleHandle("WPROCS");
WORD oldss, oldsp, saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
fprintf (stderr, "Warning: %*.*s is a self-loading module\n"
......@@ -1054,7 +1036,18 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
oldss = IF1632_Saved16_ss;
oldsp = IF1632_Saved16_sp;
IF1632_Saved16_ss = pModule->self_loading_sel;
IF1632_Saved16_sp = 0xFF00;
IF1632_Saved16_sp = 0xFF00 - sizeof(*stack16Top);
stack16Top = CURRENT_STACK16;
stack16Top->saved_ss = 0;
stack16Top->saved_sp = 0;
stack16Top->ds = stack16Top->es = pModule->self_loading_sel;
stack16Top->entry_point = 0;
stack16Top->entry_ip = 0;
stack16Top->entry_cs = 0;
stack16Top->bp = 0;
stack16Top->ip = 0;
stack16Top->cs = 0;
if (!IF1632_Stack32_base) {
STACK32FRAME* frame32;
char *stack32Top;
......
......@@ -65,6 +65,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
#ifndef WINELIB
/* Implement self loading segments */
SELFLOADHEADER *selfloadheader;
STACK16FRAME *stack16Top;
WORD oldss, oldsp, oldselector, newselector;
selfloadheader = (SELFLOADHEADER *)
PTR_SEG_OFF_TO_LIN(pSegTable->selector,0);
......@@ -72,7 +73,17 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
oldsp = IF1632_Saved16_sp;
oldselector = pSeg->selector;
IF1632_Saved16_ss = pModule->self_loading_sel;
IF1632_Saved16_sp = 0xFF00;
IF1632_Saved16_sp = 0xFF00 - sizeof(*stack16Top);
stack16Top = CURRENT_STACK16;
stack16Top->saved_ss = 0;
stack16Top->saved_sp = 0;
stack16Top->ds = stack16Top->es = pModule->self_loading_sel;
stack16Top->entry_point = 0;
stack16Top->entry_ip = 0;
stack16Top->entry_cs = 0;
stack16Top->bp = 0;
stack16Top->ip = 0;
stack16Top->cs = 0;
/* FIXME: we probably need to pass a DOS file handle here */
newselector = CallTo16_word_www(selfloadheader->LoadAppSeg,
pModule->self_loading_sel, hModule, fd, segnum);
......
......@@ -170,6 +170,16 @@ void fixup_imports(struct pe_data *pe, HMODULE hModule)
char *name = (char*)load_addr+pe_imp->ModuleName;
mod_ptr[i] = LoadModule(name,(LPVOID)-1);
if(mod_ptr[i]<=(HMODULE)32)
{
char *p, buffer[256];
/* Try with prepending the path of the current module */
GetModuleFileName( hModule, buffer, sizeof(buffer) );
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
strcpy( p + 1, name );
mod_ptr[i] = LoadModule( buffer, (LPVOID)-1 );
}
if(mod_ptr[i]<=(HMODULE)32)
{
fprintf(stderr,"Module %s not found\n",name);
exit(0);
......
......@@ -13,6 +13,6 @@ static char Copyright[] = "Copyright Bob Amstadt, 1994";
INT Escape(HDC hdc, INT nEscape, INT cbInput,
LPCSTR lpszInData, LPVOID lpvOutData)
{
fprintf(stderr, "Escape(nEscape = %04x)\n", nEscape);
/* fprintf(stderr, "Escape(nEscape = %04x)\n", nEscape); */
return 0;
}
......@@ -880,11 +880,10 @@ _w95_walk_tree(LPKEYSTRUCT lpkey,struct _w95key *key) {
while (key) {
if (key->name == NULL) {
fprintf(stderr,"key with dkeaddr %lx not loaded, skipping hierarchy\n",
fprintf(stderr,"_w95_walk_tree:Please report: key with dkeaddr %lx not loaded, skipping hierarchy\n",
key->dkeaddr
);
key = key->next;
continue;
return;
}
lpxkey=_find_or_add_key(lpkey,strdupA2W(key->name));
......@@ -963,7 +962,9 @@ _w95dkelookup(unsigned long dkeaddr,int n,struct _w95nr2da *nr2da,struct _w95key
for (i=0;i<n;i++)
if (nr2da[(i+off)%n].dkeaddr == dkeaddr)
return keys+nr2da[(i+off)%n].nr;
fprintf(stderr,"search didn't found dkeaddr %lx?\n",dkeaddr);
/* 0x3C happens often, just report unusual values */
if (dkeaddr!=0x3c)
dprintf_reg(stddeb,"search hasn't found dkeaddr %lx?\n",dkeaddr);
return NULL;
}
......@@ -1043,7 +1044,7 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) {
where = 0x40;
end = rgdbsection;
nrofdkes = (end-where)/sizeof(struct dke);
nrofdkes = (end-where)/sizeof(struct dke)+100;
data = (char*)xmalloc(end-where);
if ((end-where)!=read(fd,data,end-where))
return;
......@@ -1052,6 +1053,7 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) {
keys = (struct _w95key*)xmalloc(nrofdkes * sizeof(struct _w95key));
memset(keys,'\0',nrofdkes*sizeof(struct _w95key));
nr2da= (struct _w95nr2da*)xmalloc(nrofdkes * sizeof(struct _w95nr2da));
memset(nr2da,'\0',nrofdkes*sizeof(struct _w95nr2da));
for (i=0;i<nrofdkes;i++) {
struct dke dke;
......@@ -1080,7 +1082,9 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) {
dkeaddr = dkeaddr & ~0xFFF;
}
if (nr>nrofdkes) {
dprintf_reg(stddeb,"nr %ld exceeds nrofdkes %d, skipping.\n",nr,nrofdkes);
/* 0xFFFFFFFF happens often, just report unusual values */
if (nr!=0xFFFFFFFF)
dprintf_reg(stddeb,"nr %ld exceeds nrofdkes %d, skipping.\n",nr,nrofdkes);
continue;
}
if (keys[nr].dkeaddr) {
......@@ -1091,8 +1095,13 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) {
break;
if (x==-1)
break; /* finished reading if we got only 0 */
if (nr)
dprintf_reg(stddeb,"key doubled? nr=%ld,key->dkeaddr=%lx,dkeaddr=%lx\n",nr,keys[nr].dkeaddr,dkeaddr);
if (nr) {
if ( (dke.next!=(long)keys[nr].next) ||
(dke.nextsub!=(long)keys[nr].nextsub) ||
(dke.prevlvl!=(long)keys[nr].prevlvl)
)
dprintf_reg(stddeb,"key doubled? nr=%ld,key->dkeaddr=%lx,dkeaddr=%lx\n",nr,keys[nr].dkeaddr,dkeaddr);
}
continue;
}
nr2da[i].nr = nr;
......@@ -1144,7 +1153,7 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) {
nextrgdb = curdata+off_next_rgdb;
curdata+=0x20;
} else {
dprintf_reg(stddeb,"at end of RGDB section, but no next header. Breaking.\n");
dprintf_reg(stddeb,"at end of RGDB section, but no next header (%x of %lx). Breaking.\n",curdata-data,end-rgdbsection);
break;
}
}
......@@ -1157,22 +1166,12 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) {
XREAD(&dkh,sizeof(dkh));
nr = dkh.nrLS + (dkh.nrMS<<8);
if (nr>nrofdkes) {
if ((nr>nrofdkes) || (dkh.nrLS == 0xFFFF)) {
if (dkh.nrLS == 0xFFFF) {
curdata+= dkh.nextkeyoff - bytesread;
XREAD(magic,4);
if (strcmp(magic,"RGDB")) {
if ((curdata-data)<end)
dprintf_reg(stddeb,"while skipping to next RGDB block found magic %s\n",magic);
break;
}
curdata+=0x1c;
/* skip over key using nextkeyoff */
curdata+=dkh.nextkeyoff-sizeof(struct dkh);
continue;
}
if (dkh.nrLS == 0xFFFE) {
dprintf_reg(stddeb,"0xFFFE at %x\n",curdata-data);
break;
}
dprintf_reg(stddeb,"haven't found nr %ld.\n",nr);
key = &xkey;
memset(key,'\0',sizeof(xkey));
......
......@@ -361,7 +361,7 @@ INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
if (!hIcon) hIcon = LoadIcon(0,MAKEINTRESOURCE(OIC_WINEICON));
handle = SYSRES_LoadResource( SYSRES_DIALOG_SHELL_ABOUT_MSGBOX );
if (!handle) return FALSE;
bRet = DialogBoxIndirectParam( WIN_GetWindowInstance( hWnd ),
bRet = DialogBoxIndirectParam16( WIN_GetWindowInstance( hWnd ),
handle, hWnd,
MODULE_GetWndProcEntry16("AboutDlgProc"),
(LONG)hIcon );
......
......@@ -191,9 +191,16 @@ static const char *MessageTypeNames[SPY_MAX_MSGNUM + 1] =
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x0130 */
NULL, "wm_lbtrackpoint",
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL,
"wm_lbtrackpoint", /* 0x0131 */
"WM_CTLCOLORMSGBOX", /* 0x0132 */
"WM_CTLCOLOREDIT", /* 0x0133 */
"WM_CTLCOLORLISTBOX", /* 0x0134 */
"WM_CTLCOLORBTN", /* 0x0135 */
"WM_CTLCOLORDLG", /* 0x0136 */
"WM_CTLCOLORSCROLLBAR", /* 0x0137 */
"WM_CTLCOLORSTATIC", /* 0x0138 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x0140 - Win32 Comboboxes */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
......
......@@ -35,6 +35,8 @@
#define MAX_OP_LEN 6 /* Longest opcode + 1 for the terminating 0 */
extern void CLIPPING_UpdateGCRegion(DC* );
static const unsigned char BITBLT_Opcodes[256][MAX_OP_LEN] =
{
{ OP(PAT,DST,GXclear) }, /* 0x00 0 */
......@@ -1031,6 +1033,9 @@ BOOL BITBLT_InternalStretchBlt( DC *dcDst, short xDst, short yDst,
useDst = (((rop >> 1) & 0x550000) != (rop & 0x550000));
if (!dcSrc && useSrc) return FALSE;
if (dcDst->w.flags & DC_DIRTY) CLIPPING_UpdateGCRegion( dcDst );
if (dcSrc && (dcSrc->w.flags & DC_DIRTY)) CLIPPING_UpdateGCRegion( dcSrc );
/* Map the coordinates to device coords */
xDst = dcDst->w.DCOrgX + XLPTODP( dcDst, xDst );
......@@ -1270,7 +1275,7 @@ BOOL BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width, INT height,
dcSrc = (DC *) GDI_GetObjPtr( hdcSrc, DC_MAGIC );
dprintf_bitblt(stddeb,
"BitBlt: %04x %d,%d %d bpp -> %04x %d,%d %dx%dx%d rop=%06lx\n",
"BitBlt: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
......
......@@ -122,11 +122,17 @@ HBITMAP CreateBitmap( INT width, INT height, UINT planes, UINT bpp, LPVOID bits
*/
HBITMAP CreateCompatibleBitmap( HDC hdc, INT width, INT height )
{
DC * dc;
dprintf_gdi(stddeb, "CreateCompatibleBitmap: %04x %dx%d\n",
HBITMAP hbmpRet = 0;
DC * dc;
dprintf_gdi(stddeb, "CreateCompatibleBitmap(%04x,%d,%d) = \n",
hdc, width, height );
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
return CreateBitmap( width, height, 1, dc->w.bitsPerPixel, NULL );
hbmpRet = CreateBitmap( width, height, 1, dc->w.bitsPerPixel, NULL );
dprintf_gdi(stddeb,"\t\t%04x\n", hbmpRet);
return hbmpRet;
}
......@@ -278,7 +284,7 @@ int BITMAP_GetObject( BITMAPOBJ * bmp, int count, LPSTR buffer )
/***********************************************************************
* BITMAP_SelectObject
*/
HBITMAP BITMAP_SelectObject( HDC hdc, DC * dc, HBITMAP hbitmap,
HBITMAP BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
BITMAPOBJ * bmp )
{
HRGN hrgn;
......@@ -300,7 +306,7 @@ HBITMAP BITMAP_SelectObject( HDC hdc, DC * dc, HBITMAP hbitmap,
XFreeGC( display, dc->u.x.gc );
dc->u.x.gc = XCreateGC( display, dc->u.x.drawable, 0, NULL );
dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel;
DC_InitDC( hdc );
DC_InitDC( dc );
}
else CLIPPING_UpdateGCRegion( dc ); /* Just update GC clip region */
return prevHandle;
......
......@@ -334,14 +334,14 @@ static BOOL BRUSH_SelectPatternBrush( DC * dc, HBITMAP hbitmap )
/***********************************************************************
* BRUSH_SelectObject
*/
HBRUSH BRUSH_SelectObject( HDC hdc, DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
HBRUSH BRUSH_SelectObject( DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
{
HBITMAP hBitmap;
BITMAPINFO * bmpInfo;
HBRUSH prevHandle = dc->w.hBrush;
dprintf_gdi(stddeb, "Brush_SelectObject: hdc=%04x hbrush=%04x\n",
hdc,hbrush);
dc->hSelf,hbrush);
if (dc->header.wMagic == METAFILE_DC_MAGIC)
{
switch (brush->logbrush.lbStyle)
......@@ -400,7 +400,7 @@ HBRUSH BRUSH_SelectObject( HDC hdc, DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
if ((bmpInfo = (BITMAPINFO *) GlobalLock16( (HANDLE)brush->logbrush.lbHatch )))
{
int size = DIB_BitmapInfoSize( bmpInfo, brush->logbrush.lbColor );
hBitmap = CreateDIBitmap( hdc, &bmpInfo->bmiHeader, CBM_INIT,
hBitmap = CreateDIBitmap( dc->hSelf, &bmpInfo->bmiHeader, CBM_INIT,
((char *)bmpInfo) + size, bmpInfo,
(WORD) brush->logbrush.lbColor );
BRUSH_SelectPatternBrush( dc, hBitmap );
......
......@@ -50,6 +50,13 @@ void CLIPPING_UpdateGCRegion( DC * dc )
fprintf( stderr, "UpdateGCRegion: hVisRgn is zero. Please report this.\n" );
exit(1);
}
if (dc->w.flags & DC_DIRTY)
{
UpdateDirtyDC(dc);
dc->w.flags &= ~DC_DIRTY;
}
if (!dc->w.hClipRgn)
CombineRgn( dc->w.hGCClipRgn, dc->w.hVisRgn, 0, RGN_COPY );
else
......@@ -80,6 +87,7 @@ int SelectClipRgn( HDC hdc, HRGN hrgn )
dc->w.hClipRgn = 0;
retval = SIMPLEREGION; /* Clip region == whole DC */
}
CLIPPING_UpdateGCRegion( dc );
return retval;
}
......@@ -96,6 +104,8 @@ int SelectVisRgn( HDC hdc, HRGN hrgn )
dprintf_clipping(stddeb, "SelectVisRgn: %04x %04x\n", hdc, hrgn );
dc->w.flags &= ~DC_DIRTY;
retval = CombineRgn( dc->w.hVisRgn, hrgn, 0, RGN_COPY );
CLIPPING_UpdateGCRegion( dc );
return retval;
......@@ -271,6 +281,7 @@ int ExcludeVisRect( HDC hdc, short left, short top, short right, short bottom )
if (!dc) return ERROR;
dprintf_clipping(stddeb, "ExcludeVisRect: %04x %dx%d,%dx%d\n",
hdc, left, top, right, bottom );
return CLIPPING_IntersectVisRect( dc, left, top, right, bottom, TRUE );
}
......@@ -285,6 +296,7 @@ int IntersectVisRect( HDC hdc, short left, short top,
if (!dc) return ERROR;
dprintf_clipping(stddeb, "IntersectVisRect: %04x %dx%d,%dx%d\n",
hdc, left, top, right, bottom );
return CLIPPING_IntersectVisRect( dc, left, top, right, bottom, FALSE );
}
......@@ -299,6 +311,10 @@ BOOL PtVisible( HDC hdc, short x, short y )
dprintf_clipping(stddeb, "PtVisible: %04x %d,%d\n", hdc, x, y );
if (!dc->w.hGCClipRgn) return FALSE;
if( dc->w.flags & DC_DIRTY ) UpdateDirtyDC(dc);
dc->w.flags &= ~DC_DIRTY;
return PtInRegion( dc->w.hGCClipRgn, XLPTODP(dc,x), YLPTODP(dc,y) );
}
......@@ -375,6 +391,9 @@ HRGN SaveVisRgn( HDC hdc )
fprintf( stderr, "SaveVisRgn: hVisRgn is zero. Please report this.\n" );
exit(1);
}
if( dc->w.flags & DC_DIRTY ) UpdateDirtyDC(dc);
dc->w.flags &= ~DC_DIRTY;
if (!(obj = (RGNOBJ *) GDI_GetObjPtr( dc->w.hVisRgn, REGION_MAGIC )))
return 0;
if (!(copy = CreateRectRgn( 0, 0, 0, 0 ))) return 0;
......
......@@ -14,11 +14,13 @@
#include "color.h"
#include "debug.h"
#include "font.h"
#include "callback.h"
#include "xmalloc.h"
static DeviceCaps * displayDevCaps = NULL;
extern void CLIPPING_UpdateGCRegion( DC * dc ); /* objects/clipping.c */
extern BOOL DCHook( HDC, WORD, DWORD, DWORD ); /* windows/dce.c */
/* Default DC values */
static const WIN_DC_INFO DC_defaultValues =
......@@ -142,15 +144,14 @@ void DC_FillDevCaps( DeviceCaps * caps )
*
* Setup device-specific DC values for a newly created DC.
*/
void DC_InitDC( HDC hdc )
void DC_InitDC( DC* dc )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
RealizeDefaultPalette( hdc );
SetTextColor( hdc, dc->w.textColor );
SetBkColor( hdc, dc->w.backgroundColor );
SelectObject( hdc, dc->w.hPen );
SelectObject( hdc, dc->w.hBrush );
SelectObject( hdc, dc->w.hFont );
RealizeDefaultPalette( dc->hSelf );
SetTextColor( dc->hSelf, dc->w.textColor );
SetBkColor( dc->hSelf, dc->w.backgroundColor );
SelectObject( dc->hSelf, dc->w.hPen );
SelectObject( dc->hSelf, dc->w.hBrush );
SelectObject( dc->hSelf, dc->w.hFont );
XSetGraphicsExposures( display, dc->u.x.gc, False );
XSetSubwindowMode( display, dc->u.x.gc, IncludeInferiors );
CLIPPING_UpdateGCRegion( dc );
......@@ -191,6 +192,8 @@ BOOL DC_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
val.background = COLOR_PixelToPalette[val.background];
}
if (dc->w.flags & DC_DIRTY) CLIPPING_UpdateGCRegion(dc);
val.function = DC_XROPfunction[dc->w.ROPmode-1];
val.fill_style = dc->u.x.brush.fillStyle;
switch(val.fill_style)
......@@ -262,6 +265,8 @@ BOOL DC_SetupGCForPen( DC * dc )
if (dc->u.x.pen.style == PS_NULL) return FALSE;
if (dc->w.flags & DC_DIRTY) CLIPPING_UpdateGCRegion(dc);
if ((screenDepth <= 8) && /* FIXME: Should check for palette instead */
((dc->w.ROPmode == R2_BLACK) || (dc->w.ROPmode == R2_WHITE)))
{
......@@ -309,6 +314,9 @@ BOOL DC_SetupGCForText( DC * dc )
fprintf( stderr, "DC_SetupGCForText: fstruct is NULL. Please report this\n" );
return FALSE;
}
if (dc->w.flags & DC_DIRTY) CLIPPING_UpdateGCRegion(dc);
val.function = GXcopy; /* Text is always GXcopy */
val.foreground = dc->w.textPixel;
val.background = dc->w.backgroundPixel;
......@@ -322,6 +330,26 @@ BOOL DC_SetupGCForText( DC * dc )
/***********************************************************************
* DC_CallHookProc
*/
BOOL DC_CallHookProc(DC* dc, WORD code, LPARAM lParam)
{
BOOL bRet = 0;
FARPROC ptr = GDI_GetDefDCHook();
dprintf_dc(stddeb,"CallDCHook: code %04x\n", code);
/* if 16-bit callback is, in fact, a thunk to DCHook simply call DCHook */
if( dc->hookProc && !(dc->w.flags & (DC_SAVED | DC_MEMORY)) )
bRet = (dc->hookProc == ptr) ?
DCHook(dc->hSelf, code, dc->dwHookData, lParam):
CallDCHookProc(dc->hookProc, dc->hSelf, code, dc->dwHookData, lParam);
return bRet;
}
/***********************************************************************
* GetDCState (GDI.179)
*/
HDC GetDCState( HDC hdc )
......@@ -338,6 +366,8 @@ HDC GetDCState( HDC hdc )
memset( &newdc->u.x, 0, sizeof(newdc->u.x) );
memcpy( &newdc->w, &dc->w, sizeof(dc->w) );
memcpy( &newdc->u.x.pen, &dc->u.x.pen, sizeof(dc->u.x.pen) );
newdc->hSelf = (HDC)handle;
newdc->saveLevel = 0;
newdc->w.flags |= DC_SAVED;
......@@ -474,7 +504,11 @@ HDC CreateDC( LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODE* initDa
DC_FillDevCaps( displayDevCaps );
}
dc->hSelf = (HDC)handle;
dc->saveLevel = 0;
dc->dwHookData = 0L;
dc->hookProc = (SEGPTR)NULL;
memcpy( &dc->w, &DC_defaultValues, sizeof(DC_defaultValues) );
memset( &dc->u.x, 0, sizeof(dc->u.x) );
......@@ -491,7 +525,7 @@ HDC CreateDC( LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODE* initDa
return 0;
}
DC_InitDC( handle );
DC_InitDC( dc );
return handle;
}
......@@ -530,8 +564,12 @@ HDC CreateCompatibleDC( HDC hdc )
return 0;
}
bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
dc->hSelf = (HDC)handle;
dc->saveLevel = 0;
dc->dwHookData = 0L;
dc->hookProc = (SEGPTR)NULL;
memcpy( &dc->w, &DC_defaultValues, sizeof(DC_defaultValues) );
memset( &dc->u.x, 0, sizeof(dc->u.x) );
......@@ -551,7 +589,7 @@ HDC CreateCompatibleDC( HDC hdc )
return 0;
}
DC_InitDC( handle );
DC_InitDC( dc );
return handle;
}
......@@ -713,3 +751,60 @@ DWORD SetDCOrg( HDC hdc, short x, short y )
dc->w.DCOrgY = y;
return prevOrg;
}
/***********************************************************************
* SetDCHook (GDI.190)
*/
BOOL SetDCHook( HDC hDC, FARPROC16 hookProc, DWORD dwHookData )
{
DC *dc = (DC *)GDI_GetObjPtr( hDC, DC_MAGIC );
dprintf_dc( stddeb, "SetDCHook: hookProc %08x, default is %08x\n",
(unsigned)hookProc,(unsigned)GDI_GetDefDCHook() );
if (!dc) return FALSE;
dc->hookProc = hookProc;
dc->dwHookData = dwHookData;
return TRUE;
}
/***********************************************************************
* GetDCHook (GDI.191)
*/
DWORD GetDCHook( HDC hDC, FARPROC16 *phookProc )
{
DC *dc = (DC *)GDI_GetObjPtr( hDC, DC_MAGIC );
if (!dc) return 0;
*phookProc = dc->hookProc;
return dc->dwHookData;
}
/***********************************************************************
* SetHookFlags (GDI.192)
*/
WORD SetHookFlags(HDC hDC, WORD flags)
{
DC* dc = (DC*)GDI_GetObjPtr( hDC, DC_MAGIC );
if( dc )
{
WORD wRet = dc->w.flags & DC_DIRTY;
/* "Undocumented Windows" info is slightly
* confusing
*/
dprintf_dc(stddeb,"SetHookFlags: hDC %04x, flags %04x\n",hDC,flags);
if( flags & DCHF_INVALIDATEVISRGN )
dc->w.flags |= DC_DIRTY;
else if( flags & DCHF_VALIDATEVISRGN || !flags )
dc->w.flags &= ~DC_DIRTY;
return wRet;
}
return 0;
}
......@@ -18,6 +18,7 @@
#include "debug.h"
#include "xmalloc.h"
extern void CLIPPING_UpdateGCRegion(DC* );
/***********************************************************************
* DIB_GetImageWidthBytes
......@@ -575,6 +576,8 @@ static int DIB_SetImageBits( DC *dc, WORD lines, WORD depth, LPSTR bits,
if (!(colorMapping = DIB_BuildColorMap( dc, coloruse, depth, info )))
return 0;
if( dc->w.flags & DC_DIRTY ) CLIPPING_UpdateGCRegion(dc);
/* Transfer the pixels */
XCREATEIMAGE(bmpImage, infoWidth, lines, depth );
......
......@@ -785,7 +785,12 @@ DWORD SetMapperFlags(HDC hDC, DWORD dwFlag)
*/
BOOL GetCharABCWidths(HDC hdc, UINT wFirstChar, UINT wLastChar, LPABC lpABC)
{
/* No TrueType fonts in Wine */
/* No TrueType fonts in Wine so far */
fprintf(stdnimp,"STUB: GetCharABCWidths(%04x,%04x,%04x,%08x)\n",
hdc,wFirstChar,wLastChar,(unsigned)lpABC);
return FALSE;
}
......
......@@ -12,6 +12,7 @@
#include "brush.h"
#include "font.h"
#include "heap.h"
#include "module.h"
#include "palette.h"
#include "pen.h"
#include "region.h"
......@@ -152,16 +153,23 @@ static GDIOBJHDR * StockObjects[NB_STOCK_OBJECTS] =
(GDIOBJHDR *) &SystemFixedFont
};
static FARPROC16 defDCHookCallback;
/***********************************************************************
* GDI_Init
*
* GDI initialisation.
* GDI initialization.
*/
BOOL GDI_Init(void)
{
HPALETTE16 hpalette;
defDCHookCallback = (FARPROC16)MODULE_GetEntryPoint(GetModuleHandle("USER"),
362 /* DCHook */ );
dprintf_gdi( stddeb, "DCHook: 16-bit callback is %08x\n",
(unsigned)defDCHookCallback );
/* Create default palette */
if (!(hpalette = COLOR_Init())) return FALSE;
......@@ -171,11 +179,11 @@ BOOL GDI_Init(void)
if (!BITMAP_Init()) return FALSE;
/* Initialise brush dithering */
/* Initialize brush dithering */
if (!BRUSH_Init()) return FALSE;
/* Initialise fonts */
/* Initialize fonts */
if (!FONT_Init()) return FALSE;
......@@ -184,6 +192,15 @@ BOOL GDI_Init(void)
/***********************************************************************
* GDI_GetDefDCHook
*/
FARPROC16 GDI_GetDefDCHook(void)
{
return defDCHookCallback;
}
/***********************************************************************
* GDI_AllocObject
*/
HANDLE GDI_AllocObject( WORD size, WORD magic )
......@@ -321,7 +338,7 @@ HANDLE SelectObject( HDC hdc, HANDLE handle )
GDIOBJHDR * ptr = NULL;
DC * dc;
dprintf_gdi(stddeb, "SelectObject: %04x %04x\n", hdc, handle );
dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", hdc, handle );
if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE))
ptr = StockObjects[handle - FIRST_STOCK_HANDLE];
else
......@@ -340,9 +357,9 @@ HANDLE SelectObject( HDC hdc, HANDLE handle )
case PEN_MAGIC:
return PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
case BRUSH_MAGIC:
return BRUSH_SelectObject( hdc, dc, handle, (BRUSHOBJ *)ptr );
return BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
case BITMAP_MAGIC:
return BITMAP_SelectObject( hdc, dc, handle, (BITMAPOBJ *)ptr );
return BITMAP_SelectObject( dc, handle, (BITMAPOBJ *)ptr );
case FONT_MAGIC:
return FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );
case REGION_MAGIC:
......
......@@ -338,9 +338,9 @@ BOOL16 ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
if (!DC_SetupGCForText( dc )) return TRUE;
font = dc->u.x.font.fstruct;
dprintf_text(stddeb,"ExtTextOut: %d,%d '%*.*s', %d flags=%d\n",
x, y, count, count, str, count, flags);
if (lprect != NULL) dprintf_text(stddeb, "rect %d %d %d %d\n",
dprintf_text(stddeb,"ExtTextOut: hdc=%04x %d,%d '%*.*s', %d flags=%d\n",
hdc, x, y, count, count, str, count, flags);
if (lprect != NULL) dprintf_text(stddeb, "\trect=(%d,%d- %d,%d)\n",
lprect->left, lprect->top,
lprect->right, lprect->bottom );
......@@ -363,6 +363,9 @@ BOOL16 ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
if (rect.bottom < rect.top) SWAP_INT( rect.top, rect.bottom );
}
dprintf_text(stddeb,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n",
x, y, rect.left, rect.top, rect.right, rect.bottom);
/* Draw the rectangle */
if (flags & ETO_OPAQUE)
......@@ -394,6 +397,7 @@ BOOL16 ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
x -= info.width / 2;
break;
}
switch( dc->w.textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE) )
{
case TA_TOP:
......
Sun Jun 2 13:14:55 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* Program icons: repaint on WM_NCPAINT or WM_PAINTICON
Sun Apr 14 20:09:19 1996 Pablo Saratxaga <srtxg@linux.chanae.stben.be>
* [Fr.rc] (new)
......
......@@ -32,7 +32,8 @@ static LRESULT PROGRAM_ProgramWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARA
return(0);
}
case WM_PAINT:
case WM_PAINTICON:
case WM_NCPAINT:
{
PROGRAM *program;
PAINTSTRUCT ps;
......@@ -205,6 +206,7 @@ HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
SetWindowLong(program->hWnd, 0, (LONG) hProgram);
ShowWindow (program->hWnd, SW_SHOWMINIMIZED);
SetWindowPos (program->hWnd, 0, x, y, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);
UpdateWindow (program->hWnd);
return hProgram;
......
......@@ -63,6 +63,7 @@ and translate it to your language. It's okay for:
* English
* German
* Finnish
* Italian
.....
Thank you.
......
......@@ -38,7 +38,6 @@ FONT 10, "System"
ICON "", 1088, 195, 10, 18, 20
}
OPEN_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Apri"
......@@ -131,16 +130,32 @@ FONT 8, "Helv"
COMBOBOX 1138, 168, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
}
CHOOSE_FONT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134
CHOOSE_FONT DIALOG DISCARDABLE 13, 54, 264, 147
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Font"
FONT 8, "Helv"
{
LTEXT "Font:", 1088, 6, 6, 40, 9
LTEXT "", 1089, 60, 6, 150, 9
DEFPUSHBUTTON "Ok", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Annulla", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP
LTEXT "&Font:",1088 ,6,3,40,9
COMBOBOX 1136 ,6,13,94,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL |
CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE
LTEXT "St&ile:",1089 ,108,3,44,9
COMBOBOX 1137,108,13,64,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL |
WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE
LTEXT "&Dimensione:",1090,179,3,30,9
COMBOBOX 1138,179,13,32,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL |
WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE | CBS_SORT
DEFPUSHBUTTON "OK",IDOK,218,6,40,14,WS_GROUP
PUSHBUTTON "Annulla",IDCANCEL,218,23,40,14,WS_GROUP
PUSHBUTTON "A&pplica", 1026,218,40,40,14,WS_GROUP
PUSHBUTTON "&Aiuto" , 1038,218,57,40,14,WS_GROUP
GROUPBOX "Effetti",1072,6,72,84,34,WS_GROUP
CHECKBOX "&Barrato", 1040, 10,82,50,10, BS_AUTOCHECKBOX | WS_TABSTOP
CHECKBOX "&Sottolineato", 1041, 10,94,50,10, BS_AUTOCHECKBOX
LTEXT "&Colore:", 1091 ,6,110,30,9
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Esempio",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",1093,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
}
CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200
......
......@@ -1016,21 +1016,18 @@ static void BuildSpec16Files(void)
break;
case TYPE_BYTE:
printf( "/* %s.%d */\n", DLLName, i);
odp->offset = data_offset;
data_offset += StoreVariableCode( data, 1, odp);
data_offset += StoreVariableCode( data + data_offset, 1, odp);
break;
case TYPE_WORD:
printf( "/* %s.%d */\n", DLLName, i);
odp->offset = data_offset;
data_offset += StoreVariableCode( data, 2, odp);
data_offset += StoreVariableCode( data + data_offset, 2, odp);
break;
case TYPE_LONG:
printf( "/* %s.%d */\n", DLLName, i);
odp->offset = data_offset;
data_offset += StoreVariableCode( data, 4, odp);
data_offset += StoreVariableCode( data + data_offset, 4, odp);
break;
case TYPE_RETURN:
......
......@@ -21,8 +21,7 @@ C_SRCS = \
struct32.c \
thread.c \
time.c \
user32.c \
winprocs.c
user32.c
all: $(MODULE).o
......
......@@ -37,3 +37,33 @@ LPSTR GetCommandLineA(void)
return buffer;
}
/***********************************************************************
* GetSystemPowerStatus (KERNEL32.621)
*/
BOOL GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
{
return FALSE; /* no power management support */
}
/***********************************************************************
* SetSystemPowerState (KERNEL32.630)
*/
BOOL SetSystemPowerState(BOOL suspend_or_hibernate, BOOL force_flag)
{
/* suspend_or_hibernate flag: w95 does not support
this feature anyway */
for ( ;0; )
{
if ( force_flag )
{
}
else
{
}
}
return TRUE;
}
......@@ -60,6 +60,43 @@ VOID GetSystemTime(LPSYSTEMTIME systime)
systime->wMilliseconds = (tv.tv_usec / 1000) % 1000;
}
/***********************************************************************
* SetSystemTime (KERNEL32.507)
*/
BOOL SetSystemTime(const SYSTEMTIME *systime)
{
struct timeval tv;
struct timezone tz;
struct tm t;
time_t sec;
/* call gettimeofday to get the current timezone */
gettimeofday(&tv, &tz);
/* get the number of seconds */
t.tm_sec = systime->wSecond;
t.tm_min = systime->wMinute;
t.tm_hour = systime->wHour;
t.tm_mday = systime->wDay;
t.tm_mon = systime->wMonth;
t.tm_year = systime->wYear;
sec = mktime (&t);
/* set the new time */
tv.tv_sec = sec;
tv.tv_usec = systime->wMilliseconds * 1000;
if (settimeofday(&tv, &tz))
{
return FALSE;
}
else
{
return TRUE;
}
}
/***********************************************************************
* GetTimeZoneInformation (KERNEL32.302)
*/
......@@ -78,6 +115,27 @@ DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION tzinfo)
return TIME_ZONE_ID_UNKNOWN;
}
/***********************************************************************
* SetTimeZoneInformation (KERNEL32.515)
*/
BOOL SetTimeZoneInformation(const TIME_ZONE_INFORMATION *tzinfo)
{
struct timezone tz;
tz.tz_minuteswest = tzinfo->Bias;
tz.tz_dsttime = DST_NONE;
if (settimeofday(NULL, &tz))
{
return FALSE;
}
else
{
return TRUE;
}
}
/***********************************************************************
* Sleep (KERNEL32.523)
*/
......
......@@ -18,7 +18,6 @@
#include "struct32.h"
#include "resource32.h"
#include "string32.h"
#include "dialog.h"
#include "win.h"
#include "winproc.h"
#include "debug.h"
......@@ -68,275 +67,6 @@ UINT USER32_SetTimer(HWND hwnd, UINT id, UINT timeout, void *proc)
return SetTimer( hwnd, id, timeout, MAKE_SEGPTR(proc));
}
/* WARNING: It has not been verified that the signature or semantics
of the corresponding NT function is the same */
HWND USER32_CreateDialogIndirectParamAorW(HINSTANCE hInst,LPVOID templ,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam,int A)
{
DLGTEMPLATE32 *dlgTempl=templ;
DLGITEMTEMPLATE32 *dlgitem;
WORD *ptr;
DWORD MenuName=0;
DWORD ClassName=0;
DWORD szFontName=0;
WORD wPointSize;
HFONT hFont=0;
HMENU hMenu=0;
DWORD exStyle;
DWORD szCaption;
RECT16 rect;
DIALOGINFO *dlgInfo;
WND *wndPtr;
WORD xUnit = xBaseUnit;
WORD yUnit = yBaseUnit;
int i;
DWORD ClassId;
DWORD Text;
HWND hwnd,hwndCtrl;
HWND hwndDefButton=0;
WCHAR buffer[200];
/* parse the dialog template header*/
exStyle = dlgTempl->dwExtendedStyle;
ptr = (WORD*)(dlgTempl+1);
switch(*ptr){
case 0: MenuName=0;ptr++;break;
case 0xFFFF: MenuName=*(ptr+1);ptr+=2;break;
default: MenuName = (DWORD)ptr;
ptr += STRING32_lstrlenW(ptr)+1;
}
switch(*ptr){
case 0: ClassName = DIALOG_CLASS_ATOM;ptr++;break;
case 0xFFFF: ClassName = *(ptr+1);ptr+=2;break;
default: ClassName = (DWORD)ptr;
ptr += STRING32_lstrlenW(ptr)+1;
}
szCaption=(DWORD)ptr;
ptr+=STRING32_lstrlenW(ptr)+1;
if(dlgTempl->style & DS_SETFONT)
{
wPointSize = *ptr;
ptr++;
szFontName = (DWORD)ptr;
ptr+=STRING32_lstrlenW(ptr)+1;
}
if(MenuName) hMenu=WIN32_LoadMenuW(hInst,(LPWSTR)MenuName);
if(dlgTempl->style & DS_SETFONT)
{
fprintf(stderr,"Win32: dialog fonts not supported yet\n");
}
/* Create dialog main window */
rect.left = rect.top = 0;
rect.right = dlgTempl->cx * xUnit / 4;
rect.bottom = dlgTempl->cy * yUnit / 8;
/* FIXME: proper modalframe handling ??*/
if (dlgTempl->style & DS_MODALFRAME) exStyle |= WS_EX_DLGMODALFRAME;
AdjustWindowRectEx16( &rect, dlgTempl->style,
hMenu ? TRUE : FALSE , exStyle );
rect.right -= rect.left;
rect.bottom -= rect.top;
if(dlgTempl->x == CW_USEDEFAULT16)
rect.left = rect.top = CW_USEDEFAULT16;
else{
rect.left += dlgTempl->x * xUnit / 4;
rect.top += dlgTempl->y * yUnit / 8;
if (!(dlgTempl->style & DS_ABSALIGN))
ClientToScreen16(hWndParent, (POINT16 *)&rect );
}
/* FIXME: Here is the place to consider A */
hwnd = CreateWindowEx32W(exStyle, (LPWSTR)ClassName, (LPWSTR)szCaption,
dlgTempl->style & ~WS_VISIBLE,
rect.left, rect.top, rect.right, rect.bottom,
hWndParent, hMenu, hInst, 0);
if(!hwnd)
{
if(hFont)DeleteObject(hFont);
if(hMenu)DeleteObject(hMenu);
return 0;
}
wndPtr = WIN_FindWndPtr(hwnd);
/* FIXME: should purge junk from system menu, but windows/dialog.c
says this does not belong here */
/* Create control windows */
dprintf_dialog(stddeb, " BEGIN\n" );
dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
dlgInfo->msgResult = 0; /* This is used to store the default button id */
dlgInfo->hDialogHeap = 0;
for (i = 0; i < dlgTempl->noOfItems; i++)
{
if((int)ptr&3)
ptr++;
dlgitem = (DLGITEMTEMPLATE32*)ptr;
ptr = (WORD*)(dlgitem+1);
if(*ptr == 0xFFFF) {
/* FIXME: ignore HIBYTE? */
ClassId = *(ptr+1);
ptr+=2;
}else{
ClassId = (DWORD)ptr;
ptr += STRING32_lstrlenW(ptr)+1;
}
if(*ptr == 0xFFFF) {
Text = *(ptr+1);
ptr+=2;
}else{
Text = (DWORD)ptr;
ptr += STRING32_lstrlenW(ptr)+1;
}
if(!HIWORD(ClassId))
{
switch(LOWORD(ClassId))
{
case 0x80: STRING32_AnsiToUni(buffer,"BUTTON" ); break;
case 0x81: STRING32_AnsiToUni( buffer, "EDIT" ); break;
case 0x82: STRING32_AnsiToUni( buffer, "STATIC" ); break;
case 0x83: STRING32_AnsiToUni( buffer, "LISTBOX" ); break;
case 0x84: STRING32_AnsiToUni( buffer, "SCROLLBAR" ); break;
case 0x85: STRING32_AnsiToUni( buffer, "COMBOBOX" ); break;
default: buffer[0] = '\0'; break;
}
ClassId = (DWORD)buffer;
}
/*FIXME: debugging output*/
/*FIXME: local edit ?*/
exStyle = dlgitem->dwExtendedStyle|WS_EX_NOPARENTNOTIFY;
if(*ptr)
{
fprintf(stderr,"having data\n");
}
ptr++;
hwndCtrl = CreateWindowEx32W(WS_EX_NOPARENTNOTIFY,
(LPWSTR)ClassId, (LPWSTR)Text,
dlgitem->style | WS_CHILD,
dlgitem->x * xUnit / 4,
dlgitem->y * yUnit / 8,
dlgitem->cx * xUnit / 4,
dlgitem->cy * yUnit / 8,
hwnd, (HMENU)((DWORD)dlgitem->id),
hInst, (SEGPTR)0 );
SetWindowPos( hwndCtrl, HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
/* Send initialisation messages to the control */
if (hFont) SendMessage32A( hwndCtrl, WM_SETFONT, (WPARAM)hFont, 0 );
if (SendMessage32A( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
{
/* If there's already a default push-button, set it back */
/* to normal and use this one instead. */
if (hwndDefButton)
SendMessage32A( hwndDefButton, BM_SETSTYLE32, BS_PUSHBUTTON, FALSE);
hwndDefButton = hwndCtrl;
dlgInfo->msgResult = GetWindowWord( hwndCtrl, GWW_ID );
}
}
dprintf_dialog(stddeb, " END\n" );
/* Initialise dialog extra data */
dlgInfo->dlgProc = WINPROC_AllocWinProc(lpDialogFunc,WIN_PROC_32A);
dlgInfo->hUserFont = hFont;
dlgInfo->hMenu = hMenu;
dlgInfo->xBaseUnit = xUnit;
dlgInfo->yBaseUnit = yUnit;
dlgInfo->hwndFocus = DIALOG_GetFirstTabItem( hwnd );
/* Send initialisation messages and set focus */
if (dlgInfo->hUserFont)
SendMessage32A( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 );
if (SendMessage32A( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, dwInitParam ))
SetFocus( dlgInfo->hwndFocus );
if (dlgTempl->style & WS_VISIBLE) ShowWindow(hwnd, SW_SHOW);
return hwnd;
}
HWND USER32_CreateDialogIndirectParamW(HINSTANCE hInst,LPVOID dlgTempl,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
{
return USER32_CreateDialogIndirectParamAorW(hInst,dlgTempl,hWndParent,
lpDialogFunc,dwInitParam,0);
}
HWND USER32_CreateDialogIndirectParamA(HINSTANCE hInst,LPVOID dlgTempl,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
{
return USER32_CreateDialogIndirectParamAorW(hInst,dlgTempl,hWndParent,
lpDialogFunc,dwInitParam,1);
}
HWND USER32_CreateDialogParamW(HINSTANCE hInst,LPCWSTR lpszName,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
{
HANDLE32 hrsrc;
hrsrc=FindResource32(hInst,lpszName,(LPWSTR)RT_DIALOG);
if(!hrsrc)return 0;
return USER32_CreateDialogIndirectParamW(hInst,
LoadResource32(hInst, hrsrc),hWndParent,lpDialogFunc,dwInitParam);
}
HWND USER32_CreateDialogParamA(HINSTANCE hInst,LPCSTR lpszName,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
{
HWND res;
if(!HIWORD(lpszName))
res = USER32_CreateDialogParamW(hInst,(LPCWSTR)lpszName,hWndParent,
lpDialogFunc,dwInitParam);
else{
LPWSTR uni=STRING32_DupAnsiToUni(lpszName);
res=USER32_CreateDialogParamW(hInst,uni,hWndParent,
lpDialogFunc,dwInitParam);
}
return res;
}
int USER32_DialogBoxIndirectParamW(HINSTANCE hInstance,LPVOID dlgTempl,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
{
HWND hwnd;
hwnd = USER32_CreateDialogIndirectParamW(hInstance,dlgTempl,
hWndParent,lpDialogFunc,dwInitParam);
if(hwnd)return DIALOG_DoDialogBox(hwnd,hWndParent);
return -1;
}
int USER32_DialogBoxIndirectParamA(HINSTANCE hInstance,LPVOID dlgTempl,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
{
HWND hwnd;
hwnd = USER32_CreateDialogIndirectParamA(hInstance,dlgTempl,
hWndParent,lpDialogFunc,dwInitParam);
if(hwnd)return DIALOG_DoDialogBox(hwnd,hWndParent);
return -1;
}
int USER32_DialogBoxParamW(HINSTANCE hInstance,LPCWSTR lpszName,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
{
HWND hwnd;
hwnd = USER32_CreateDialogParamW(hInstance,lpszName,
hWndParent,lpDialogFunc,dwInitParam);
if(hwnd)return DIALOG_DoDialogBox(hwnd,hWndParent);
return -1;
}
int USER32_DialogBoxParamA(HINSTANCE hInstance,LPCSTR lpszName,
HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
{
HWND hwnd;
hwnd = USER32_CreateDialogParamA(hInstance,lpszName,
hWndParent,lpDialogFunc,dwInitParam);
if(hwnd)return DIALOG_DoDialogBox(hwnd,hWndParent);
return -1;
}
int USER32_wsprintfA( int *args )
{
......
/*
* Win32 WndProc function stubs
*
* Copyright 1995 Thomas Sandford (tdgsandf@prds-grn.demon.co.uk)
*
* These functions are simply lParam fixers for the Win16 routines
*/
#include <stdio.h>
#include "windows.h"
#ifndef WINELIB32
#include "winerror.h"
#include "kernel32.h"
#include "wintypes.h"
#include "struct32.h"
#include "wincon.h"
#include "stackframe.h"
#include "stddebug.h"
#include "debug.h"
BOOL UsesLParamPtr(DWORD message)
{
switch (message) {
case WM_NCCREATE:
case WM_NCCALCSIZE:
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
case WM_GETTEXT:
case WM_SETTEXT:
case WM_GETMINMAXINFO:
return TRUE;
default:
return FALSE;
}
}
BOOL WIN32_CallWindowProcTo16(LRESULT(*func)(HWND,UINT,WPARAM,LPARAM),
HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
WINDOWPOS16 wp;
union{
MINMAXINFO16 mmi;
NCCALCSIZE_PARAMS16 nccs;
CREATESTRUCT16 cs;
} st;
WINDOWPOS32 *pwp;
CREATESTRUCT32A *pcs;
LONG result;
if(!lParam || !UsesLParamPtr(msg))
return func(hwnd,msg,wParam,lParam);
switch(msg)
{
case WM_GETMINMAXINFO:
STRUCT32_MINMAXINFO32to16((void*)lParam,&st.mmi);
result=func(hwnd,msg,wParam,MAKE_SEGPTR(&st.mmi));
STRUCT32_MINMAXINFO16to32(&st.mmi,(void*)lParam);
return result;
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
STRUCT32_WINDOWPOS32to16((void*)lParam,&wp);
result=func(hwnd,msg,wParam,MAKE_SEGPTR(&wp));
STRUCT32_WINDOWPOS16to32(&wp,(void*)lParam);
return result;
case WM_NCCALCSIZE:
pwp=((NCCALCSIZE_PARAMS32*)lParam)->lppos;
STRUCT32_NCCALCSIZE32to16Flat((void*)lParam,&st.nccs,wParam);
if (wParam && pwp) {
STRUCT32_WINDOWPOS32to16(pwp,&wp);
st.nccs.lppos = &wp;
}else
st.nccs.lppos = 0;
result=func(hwnd,msg,wParam,MAKE_SEGPTR(&st.nccs));
STRUCT32_NCCALCSIZE16to32Flat(&st.nccs,(void*)lParam,wParam);
if (wParam && pwp)
STRUCT32_WINDOWPOS16to32(&wp,pwp);
return result;
case WM_NCCREATE:
pcs = (CREATESTRUCT32A*)lParam;
STRUCT32_CREATESTRUCT32Ato16((void*)lParam,&st.cs);
st.cs.lpszName = HIWORD(pcs->lpszName) ?
MAKE_SEGPTR(pcs->lpszName) : pcs->lpszName;
st.cs.lpszClass = HIWORD(pcs->lpszClass) ?
MAKE_SEGPTR(pcs->lpszClass) : pcs->lpszClass;
result=func(hwnd,msg,wParam,MAKE_SEGPTR(&st.cs));
STRUCT32_CREATESTRUCT16to32A(&st.cs,(void*)lParam);
pcs->lpszName = HIWORD(pcs->lpszName) ?
PTR_SEG_TO_LIN(st.cs.lpszName) : pcs->lpszName;
pcs->lpszClass = HIWORD(pcs-> lpszClass) ?
PTR_SEG_TO_LIN(st.cs.lpszClass) : pcs-> lpszClass;
return result;
case WM_GETTEXT:
case WM_SETTEXT:
return func(hwnd,msg,wParam,MAKE_SEGPTR((void*)lParam));
default:
fprintf(stderr,"No support for 32-16 msg 0x%x\n",msg);
}
return func(hwnd,msg,wParam,MAKE_SEGPTR((void*)lParam));
}
extern LRESULT AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ColorDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ComboBoxWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT EditWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT FileOpenDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT FileSaveDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT FindTextDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ListBoxWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT MDIClientWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT PopupMenuWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT PrintDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT PrintSetupDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ReplaceTextDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ScrollBarWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT StaticWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT SystemMessageBoxProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ComboLBoxWndProc(HWND,UINT,WPARAM,LPARAM);
LRESULT StaticWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(StaticWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT ScrollBarWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(ScrollBarWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT ListBoxWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(ListBoxWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT ComboBoxWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(ComboBoxWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT EditWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(EditWndProc,(HWND)hwnd, msg, wParam,lParam);
}
LRESULT PopupMenuWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(PopupMenuWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT DefDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(DefDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT MDIClientWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(MDIClientWndProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT SystemMessageBoxProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(SystemMessageBoxProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT FileOpenDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(FileOpenDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT FileSaveDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(FileSaveDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT ColorDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(ColorDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT FindTextDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(FindTextDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT ReplaceTextDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(ReplaceTextDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT PrintSetupDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(PrintSetupDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT PrintDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(PrintDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT AboutDlgProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(AboutDlgProc,(HWND)hwnd, msg, wParam, lParam);
}
LRESULT ComboLBoxWndProc32(DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
{
return WIN32_CallWindowProcTo16(ComboLBoxWndProc,(HWND)hwnd, msg, wParam, lParam);
}
#endif
/*
* Default dialog procedure
*
* Copyright 1993 Alexandre Julliard
* Copyright 1993, 1996 Alexandre Julliard
*
*/
#include "windows.h"
#include "dialog.h"
#include "win.h"
#include "stddebug.h"
/* #define DEBUG_DIALOG */
#include "debug.h"
#include "winproc.h"
/***********************************************************************
* DEFDLG_SetFocus
......@@ -110,37 +109,22 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo,
/***********************************************************************
* DefDlgProc (USER.308)
* DEFDLG_Proc
*
* Implementation of DefDlgProc(). Only handle messages that need special
* handling for dialogs.
*/
LRESULT DefDlgProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
static LRESULT DEFDLG_Proc( HWND32 hwnd, UINT32 msg, WPARAM32 wParam,
LPARAM lParam, DIALOGINFO *dlgInfo )
{
DIALOGINFO * dlgInfo;
BOOL result = FALSE;
WND * wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
dlgInfo = (DIALOGINFO *)&wndPtr->wExtra;
dlgInfo->msgResult = 0;
if (dlgInfo->dlgProc)
{
/* Call dialog procedure */
result = (BOOL)CallWindowProc16( dlgInfo->dlgProc, hwnd,
msg, wParam, lParam );
/* Check if window destroyed by dialog procedure */
wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return result;
}
if (!result) switch(msg)
switch(msg)
{
case WM_INITDIALOG:
break;
return 0;
case WM_ERASEBKGND:
FillWindow( hwnd, hwnd, (HDC)wParam, (HBRUSH)CTLCOLOR_DLG );
return TRUE;
return 1;
case WM_NCDESTROY:
......@@ -166,28 +150,34 @@ LRESULT DefDlgProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
dlgInfo->hMenu = 0;
}
/* Delete window procedure */
if (dlgInfo->dlgProc)
{
WINPROC_FreeWinProc( dlgInfo->dlgProc );
dlgInfo->dlgProc = 0;
}
/* Window clean-up */
DefWindowProc16( hwnd, msg, wParam, lParam );
break;
return DefWindowProc32A( hwnd, msg, wParam, lParam );
case WM_SHOWWINDOW:
if (!wParam) DEFDLG_SaveFocus( hwnd, dlgInfo );
return DefWindowProc16( hwnd, msg, wParam, lParam );
return DefWindowProc32A( hwnd, msg, wParam, lParam );
case WM_ACTIVATE:
if (wParam) DEFDLG_RestoreFocus( hwnd, dlgInfo );
else DEFDLG_SaveFocus( hwnd, dlgInfo );
break;
return 0;
case WM_SETFOCUS:
DEFDLG_RestoreFocus( hwnd, dlgInfo );
break;
return 0;
case DM_SETDEFID:
if (dlgInfo->fEnd) return TRUE;
if (dlgInfo->fEnd) return 1;
DEFDLG_SetDefButton( hwnd, dlgInfo,
wParam ? GetDlgItem( hwnd, wParam ) : 0 );
return TRUE;
return 1;
case DM_GETDEFID:
if (dlgInfo->fEnd || !dlgInfo->msgResult) return 0;
......@@ -207,16 +197,142 @@ LRESULT DefDlgProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
if (hwndDest) DEFDLG_SetFocus( hwnd, hwndDest );
DEFDLG_SetDefButton( hwnd, dlgInfo, hwndDest );
}
break;
return 0;
case WM_CLOSE:
EndDialog( hwnd, TRUE );
DestroyWindow( hwnd );
return 0;
}
return 0;
}
/***********************************************************************
* DefDlgProc16 (USER.308)
*/
LRESULT DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam )
{
DIALOGINFO * dlgInfo;
BOOL16 result = FALSE;
WND * wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
dlgInfo = (DIALOGINFO *)&wndPtr->wExtra;
dlgInfo->msgResult = 0;
if (dlgInfo->dlgProc)
{
/* Call dialog procedure */
result = (BOOL16)CallWindowProc16( (WNDPROC16)dlgInfo->dlgProc, hwnd,
msg, wParam, lParam );
/* Check if window was destroyed by dialog procedure */
if (result || !IsWindow( hwnd )) return result;
}
switch(msg)
{
case WM_INITDIALOG:
case WM_ERASEBKGND:
case WM_NCDESTROY:
case WM_SHOWWINDOW:
case WM_ACTIVATE:
case WM_SETFOCUS:
case DM_SETDEFID:
case DM_GETDEFID:
case WM_NEXTDLGCTL:
case WM_CLOSE:
return DEFDLG_Proc( (HWND32)hwnd, msg, (WPARAM32)wParam,
lParam, dlgInfo );
default:
return DefWindowProc16( hwnd, msg, wParam, lParam );
}
return result;
}
/***********************************************************************
* DefDlgProc32A (USER32.119)
*/
LRESULT DefDlgProc32A( HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
{
DIALOGINFO * dlgInfo;
BOOL16 result = FALSE;
WND * wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
dlgInfo = (DIALOGINFO *)&wndPtr->wExtra;
dlgInfo->msgResult = 0;
if (dlgInfo->dlgProc)
{
/* Call dialog procedure */
result = (BOOL16)CallWindowProc32A( (WNDPROC32)dlgInfo->dlgProc, hwnd,
msg, wParam, lParam );
/* Check if window was destroyed by dialog procedure */
if (result || !IsWindow( hwnd )) return result;
}
switch(msg)
{
case WM_INITDIALOG:
case WM_ERASEBKGND:
case WM_NCDESTROY:
case WM_SHOWWINDOW:
case WM_ACTIVATE:
case WM_SETFOCUS:
case DM_SETDEFID:
case DM_GETDEFID:
case WM_NEXTDLGCTL:
case WM_CLOSE:
return DEFDLG_Proc( hwnd, msg, wParam, lParam, dlgInfo );
default:
return DefWindowProc32A( hwnd, msg, wParam, lParam );
}
}
/***********************************************************************
* DefDlgProc32W (USER32.120)
*/
LRESULT DefDlgProc32W( HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
{
DIALOGINFO * dlgInfo;
BOOL16 result = FALSE;
WND * wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
dlgInfo = (DIALOGINFO *)&wndPtr->wExtra;
dlgInfo->msgResult = 0;
if (dlgInfo->dlgProc)
{
/* Call dialog procedure */
result = (BOOL16)CallWindowProc32W( (WNDPROC32)dlgInfo->dlgProc, hwnd,
msg, wParam, lParam );
/* Check if window was destroyed by dialog procedure */
if (result || !IsWindow( hwnd )) return result;
}
switch(msg)
{
case WM_INITDIALOG:
case WM_ERASEBKGND:
case WM_NCDESTROY:
case WM_SHOWWINDOW:
case WM_ACTIVATE:
case WM_SETFOCUS:
case DM_SETDEFID:
case DM_GETDEFID:
case WM_NEXTDLGCTL:
case WM_CLOSE:
return DEFDLG_Proc( hwnd, msg, wParam, lParam, dlgInfo );
default:
return DefWindowProc32W( hwnd, msg, wParam, lParam );
}
}
......@@ -377,7 +377,7 @@ LRESULT DefWindowProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
if (wParam && wndPtr->text)
{
lstrcpyn( (LPSTR)PTR_SEG_TO_LIN(lParam), wndPtr->text, wParam );
return (LRESULT)strlen( (LPSTR)PTR_SEG_TO_LIN(lParam) ) + 1;
result = (LRESULT)strlen( (LPSTR)PTR_SEG_TO_LIN(lParam) ) + 1;
}
break;
......@@ -442,7 +442,7 @@ LRESULT DefWindowProc32A( HWND32 hwnd, UINT32 msg, WPARAM32 wParam,
if (wParam && wndPtr->text)
{
lstrcpyn( (LPSTR)lParam, wndPtr->text, wParam );
return (LRESULT)strlen( (LPSTR)lParam ) + 1;
result = (LRESULT)strlen( (LPSTR)lParam ) + 1;
}
break;
......
......@@ -32,6 +32,7 @@
#include "registers.h"
#include "stddebug.h"
#include "debug.h"
#include "dde_proc.h"
#ifdef ndef
......@@ -628,14 +629,18 @@ static void EVENT_FocusOut( HWND hwnd, XFocusChangeEvent *event )
*/
static void EVENT_ConfigureNotify( HWND hwnd, XConfigureEvent *event )
{
if (hwnd == GetDesktopWindow())
/* FIXME: with -desktop xxx we get this event _before_ desktop
* window structure is created. WIN_GetDesktop() check is a hack.
*/
if ( !WIN_GetDesktop() || hwnd == GetDesktopWindow())
{
desktopX = event->x;
desktopY = event->y;
}
else
{
/* A managed window; most of this code is shamelessly
/* Managed window; most of this code is shamelessly
* stolen from SetWindowPos - FIXME: outdated
*/
......@@ -710,17 +715,20 @@ static void EVENT_ConfigureNotify( HWND hwnd, XConfigureEvent *event )
static void EVENT_SelectionRequest( HWND hwnd, XSelectionRequestEvent *event )
{
XSelectionEvent result;
Atom rprop;
Window request=event->requestor;
rprop=None;
Atom rprop = None;
Window request = event->requestor;
if(event->target == XA_STRING)
{
HANDLE hText;
LPSTR text;
rprop=event->property;
if(rprop == None)rprop=event->target;
if(event->selection!=XA_PRIMARY)rprop=None;
else if(!IsClipboardFormatAvailable(CF_TEXT))rprop=None;
rprop = event->property;
if(rprop == None) rprop = event->target;
if(event->selection!=XA_PRIMARY) rprop = None;
else if(!CLIPBOARD_IsPresent(CF_TEXT)) rprop = None;
else{
/* Don't worry if we can't open */
BOOL couldOpen=OpenClipboard(hwnd);
......@@ -733,8 +741,10 @@ static void EVENT_SelectionRequest( HWND hwnd, XSelectionRequestEvent *event )
if(couldOpen)CloseClipboard();
}
}
if(rprop==None) dprintf_event(stddeb,"Request for %s ignored\n",
XGetAtomName(display,event->target));
if(rprop==None)
dprintf_event(stddeb,"Request for %s ignored\n", XGetAtomName(display,event->target));
result.type=SelectionNotify;
result.display=display;
result.requestor=request;
......
......@@ -356,10 +356,11 @@ HWND MDICreateChild(WND *w, MDICLIENTINFO *ci, HWND parent, LPARAM lParam )
style |= (WS_VISIBLE | WS_OVERLAPPEDWINDOW);
}
hwnd = CreateWindow16( cs->szClass, cs->szTitle, style,
hwnd = CreateWindow16( (LPCSTR)PTR_SEG_TO_LIN(cs->szClass),
(LPCSTR)PTR_SEG_TO_LIN(cs->szTitle), style,
cs->x, cs->y, cs->cx, cs->cy, parent,
(HMENU)(DWORD)(WORD)wIDmenu, w->hInstance,
(SEGPTR)lParam);
(LPVOID)lParam);
if (hwnd)
{
......
......@@ -699,7 +699,8 @@ LRESULT SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam)
}
SPY_EnterMessage( SPY_SENDMESSAGE16, hwnd, msg, wParam, lParam );
ret = CallWindowProc16( wndPtr->lpfnWndProc, hwnd, msg, wParam, lParam );
ret = CallWindowProc16( (WNDPROC16)wndPtr->winproc,
hwnd, msg, wParam, lParam );
SPY_ExitMessage( SPY_RESULT_OK16, hwnd, msg, ret );
return ret;
}
......@@ -738,7 +739,7 @@ LRESULT SendMessage32A(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
}
SPY_EnterMessage( SPY_SENDMESSAGE32, hwnd, msg, wParam, lParam );
ret = CallWindowProc32A( (WNDPROC32)wndPtr->lpfnWndProc,
ret = CallWindowProc32A( (WNDPROC32)wndPtr->winproc,
hwnd, msg, wParam, lParam );
SPY_ExitMessage( SPY_RESULT_OK32, hwnd, msg, ret );
return ret;
......@@ -778,7 +779,7 @@ LRESULT SendMessage32W(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
}
SPY_EnterMessage( SPY_SENDMESSAGE32, hwnd, msg, wParam, lParam );
ret = CallWindowProc32W( (WNDPROC32)wndPtr->lpfnWndProc,
ret = CallWindowProc32W( (WNDPROC32)wndPtr->winproc,
hwnd, msg, wParam, lParam );
SPY_ExitMessage( SPY_RESULT_OK32, hwnd, msg, ret );
return ret;
......@@ -869,14 +870,14 @@ LONG DispatchMessage( const MSG* msg )
if (!msg->hwnd) return 0;
if (!(wndPtr = WIN_FindWndPtr( msg->hwnd ))) return 0;
if (!wndPtr->lpfnWndProc) return 0;
if (!wndPtr->winproc) return 0;
painting = (msg->message == WM_PAINT);
if (painting) wndPtr->flags |= WIN_NEEDS_BEGINPAINT;
/* HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
SPY_EnterMessage( SPY_DISPATCHMESSAGE16, msg->hwnd, msg->message,
msg->wParam, msg->lParam );
retval = CallWindowProc16( wndPtr->lpfnWndProc, msg->hwnd, msg->message,
retval = CallWindowProc16( wndPtr->winproc, msg->hwnd, msg->message,
msg->wParam, msg->lParam );
SPY_ExitMessage( SPY_RESULT_OK16, msg->hwnd, msg->message, retval );
......
......@@ -99,11 +99,10 @@ LRESULT SystemMessageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
bwidth = rect.left;
GetWindowRect16(GetDlgItem(hwnd, 1), &rect);
bwidth -= rect.left;
for (buttons = 0, i = 1; i < 8; i++) {
for (buttons = 0, i = 1; i < 8; i++)
{
hItem = GetDlgItem(hwnd, i);
if (GetWindowLong(hItem, GWL_STYLE) & WS_VISIBLE) {
buttons++;
}
if (GetWindowLong32A(hItem, GWL_STYLE) & WS_VISIBLE) buttons++;
}
/* Get the text size */
......@@ -141,7 +140,7 @@ LRESULT SystemMessageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
for (buttons = i = 0; i < 7; i++) {
/* some arithmetic to get the right order for YesNoCancel windows */
hItem = GetDlgItem(hwnd, (i + 5) % 7 + 1);
if (GetWindowLong(hItem, GWL_STYLE) & WS_VISIBLE) {
if (GetWindowLong32A(hItem, GWL_STYLE) & WS_VISIBLE) {
if (buttons++ == ((lpmb->type & MB_DEFMASK) >> 8)) {
SetFocus(hItem);
SendMessage32A( hItem, BM_SETSTYLE32, BS_DEFPUSHBUTTON, TRUE );
......@@ -187,7 +186,7 @@ int MessageBox(HWND hWnd, LPCSTR text, LPCSTR title, WORD type)
handle = SYSRES_LoadResource( SYSRES_DIALOG_MSGBOX );
if (!handle) return 0;
ret = DialogBoxIndirectParam( WIN_GetWindowInstance(hWnd),
ret = DialogBoxIndirectParam16( WIN_GetWindowInstance(hWnd),
handle, hWnd,
MODULE_GetWndProcEntry16("SystemMessageBoxProc"),
(LONG)&mbox );
......
......@@ -10,6 +10,7 @@
#include "win.h"
#include "queue.h"
#include "gdi.h"
#include "dce.h"
#include "stddebug.h"
/* #define DEBUG_WIN */
#include "debug.h"
......@@ -104,8 +105,14 @@ HDC16 BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
HideCaret( hwnd );
lps->hdc = GetDCEx( hwnd, hrgnUpdate, DCX_INTERSECTRGN | DCX_USESTYLE );
if(hrgnUpdate > 1) DeleteObject( hrgnUpdate );
dprintf_win(stddeb,"hrgnUpdate = %04x, ", hrgnUpdate);
lps->hdc = GetDCEx( hwnd, hrgnUpdate, DCX_INTERSECTRGN | DCX_WINDOWPAINT | DCX_USESTYLE );
dprintf_win(stddeb,"hdc = %04x\n", lps->hdc);
/* pseudocode from "Internals" doesn't delete hrgnUpdate - yet another clue
that ReleaseDC should take care of it (hence DCX_KEEPCLIPRGN) */
if (!lps->hdc)
{
......@@ -348,7 +355,7 @@ BOOL32 RedrawWindow32( HWND32 hwnd, const RECT32 *rectUpdate,
if (wndPtr->flags & WIN_NEEDS_ERASEBKGND)
{
HDC hdc = GetDCEx( hwnd, wndPtr->hrgnUpdate,
DCX_INTERSECTRGN | DCX_USESTYLE );
DCX_INTERSECTRGN | DCX_USESTYLE | DCX_KEEPCLIPRGN | DCX_WINDOWPAINT);
if (hdc)
{
/* Don't send WM_ERASEBKGND to icons */
......
......@@ -17,10 +17,9 @@
/* #define DEBUG_SCROLL */
#include "debug.h"
extern HRGN DCE_GetVisRgn(HWND, WORD);
extern HWND CARET_GetHwnd();
extern HRGN DCE_GetVisRgn(HWND, WORD); /* windows/dce.c */
extern HWND CARET_GetHwnd(); /* windows/caret.c */
extern void CLIPPING_UpdateGCRegion(DC* ); /* objects/clipping.c */
static int RgnType;
......@@ -112,9 +111,7 @@ BOOL SCROLL_ScrollChildren( HWND hScroll, short dx, short dy)
/*************************************************************************
* ScrollWindow (USER.61)
*
* FIXME: a bit broken
*/
void ScrollWindow(HWND hwnd, short dx, short dy, LPRECT16 rect, LPRECT16 clipRect)
{
HDC hdc;
......@@ -131,7 +128,7 @@ void ScrollWindow(HWND hwnd, short dx, short dy, LPRECT16 rect, LPRECT16 clipRec
/* if rect is NULL children have to be moved */
if ( !rect )
{
GetClientRect16(hwnd, &rc);
GetClientRect16(hwnd, &rc);
hrgnClip = CreateRectRgnIndirect16( &rc );
if ((hCaretWnd == hwnd) || IsChild(hwnd,hCaretWnd))
......@@ -192,14 +189,14 @@ void ScrollWindow(HWND hwnd, short dx, short dy, LPRECT16 rect, LPRECT16 clipRec
/*************************************************************************
* ScrollDC (USER.221)
*
* FIXME: half-broken
*/
BOOL ScrollDC(HDC hdc, short dx, short dy, LPRECT16 rc, LPRECT16 cliprc,
HRGN hrgnUpdate, LPRECT16 rcUpdate)
{
HRGN hrgnClip;
POINT16 src, dest;
HRGN hrgnClip = 0;
HRGN hrgnScrollClip = 0;
RECT16 rectClip;
POINT16 src, dest;
short width, height;
DC *dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC);
......@@ -207,20 +204,37 @@ BOOL ScrollDC(HDC hdc, short dx, short dy, LPRECT16 rc, LPRECT16 cliprc,
dx, dy, hrgnUpdate, rcUpdate, cliprc, rc ? rc->left : 0,
rc ? rc->top : 0, rc ? rc->right : 0, rc ? rc->bottom : 0 );
if (rc == NULL)
if (rc == NULL || !hdc || !dc)
return FALSE;
if (!dc)
{
fprintf(stdnimp,"ScrollDC: Invalid HDC\n");
return FALSE;
}
/* set clipping region */
if (cliprc)
{
hrgnClip = CreateRectRgnIndirect16(cliprc);
SelectClipRgn(hdc, hrgnClip);
}
IntersectRect16(&rectClip,rc,cliprc);
else
rectClip = *rc;
if( rectClip.left >= rectClip.right || rectClip.top >= rectClip.bottom )
return FALSE;
hrgnClip = GetClipRgn(hdc);
hrgnScrollClip = CreateRectRgnIndirect16(&rectClip);
if( hrgnClip )
{
/* call UpdateGCRegion directly to avoid
* one more temporary region
*/
CombineRgn( hrgnScrollClip, hrgnClip, 0, RGN_COPY );
SetRectRgn( hrgnClip, rectClip.left, rectClip.top, rectClip.right, rectClip.bottom );
CLIPPING_UpdateGCRegion( dc );
}
else
SelectClipRgn( hdc, hrgnScrollClip );
/* translate coordinates */
if (dx > 0)
{
......@@ -246,10 +260,14 @@ BOOL ScrollDC(HDC hdc, short dx, short dy, LPRECT16 rc, LPRECT16 cliprc,
width = rc->right - rc->left - abs(dx);
height = rc->bottom - rc->top - abs(dy);
/* copy bits */
if (!BitBlt(hdc, dest.x, dest.y, width, height, hdc, src.x, src.y,
SRCCOPY))
return FALSE;
/* compute update areas */
if (hrgnUpdate)
{
HRGN hrgn1,hrgn2;
......@@ -291,6 +309,11 @@ BOOL ScrollDC(HDC hdc, short dx, short dy, LPRECT16 rc, LPRECT16 cliprc,
UnionRect16( rcUpdate, &rx, &ry );
}
/* restore clipping region */
SelectClipRgn( hdc, (hrgnClip)?hrgnScrollClip:0 );
DeleteObject( hrgnScrollClip );
return TRUE;
}
......
......@@ -15,6 +15,7 @@
#include "queue.h"
#include "stackframe.h"
#include "winpos.h"
#include "dce.h"
#include "nonclient.h"
#include "stddebug.h"
/* #define DEBUG_WIN */
......@@ -27,6 +28,7 @@
extern void FOCUS_SwitchFocus( HWND , HWND );
extern HRGN DCE_GetVisRgn( HWND, WORD );
extern HWND CARET_GetHwnd();
extern BOOL DCE_InvalidateDCE(WND*, RECT16* );
/* ----- internal variables ----- */
......@@ -1346,10 +1348,10 @@ static void WINPOS_SizeMoveClean(WND* Wnd, HRGN oldVisRgn, LPRECT16 lpOldWndRect
OffsetRgn( newVisRgn, Wnd->rectClient.left, Wnd->rectClient.top);
CombineRgn( oldVisRgn, oldVisRgn, newVisRgn, RGN_OR );
hDC = GetDCEx( Wnd->parent->hwndSelf, oldVisRgn, DCX_INTERSECTRGN | DCX_CACHE | DCX_CLIPSIBLINGS);
hDC = GetDCEx( Wnd->parent->hwndSelf, oldVisRgn, DCX_KEEPCLIPRGN | DCX_INTERSECTRGN | DCX_CACHE | DCX_CLIPSIBLINGS);
BitBlt(hDC, xto, yto, lpOldClientRect->right - lpOldClientRect->left + 1,
lpOldClientRect->bottom - lpOldClientRect->top + 1,
BitBlt(hDC, xto, yto, lpOldClientRect->right - lpOldClientRect->left,
lpOldClientRect->bottom - lpOldClientRect->top,
hDC, xfrom, yfrom, SRCCOPY );
ReleaseDC( Wnd->parent->hwndSelf, hDC);
......@@ -1563,6 +1565,18 @@ BOOL SetWindowPos( HWND hwnd, HWND hwndInsertAfter, INT x, INT y,
newClientRect.top != wndPtr->rectClient.top) )
winpos.flags &= ~SWP_NOCLIENTMOVE;
/* Update active DCEs */
if( !(flags & SWP_NOZORDER) || (flags & SWP_HIDEWINDOW) || (flags & SWP_SHOWWINDOW)
|| (memcmp(&newWindowRect,&wndPtr->rectWindow,sizeof(RECT16))
&& wndPtr->dwStyle & WS_VISIBLE ) )
{
RECT16 rect;
UnionRect16(&rect,&newWindowRect,&wndPtr->rectWindow);
DCE_InvalidateDCE(wndPtr->parent, &rect);
}
/* Perform the moving and resizing */
if (wndPtr->window)
......@@ -1628,12 +1642,9 @@ BOOL SetWindowPos( HWND hwnd, HWND hwndInsertAfter, INT x, INT y,
(result >= WVR_HREDRAW && result < WVR_VALIDRECTS);
if( (winpos.flags & SWP_NOPOSCHANGE) != SWP_NOPOSCHANGE )
{
/* optimize cleanup by BitBlt'ing where possible */
WINPOS_SizeMoveClean(wndPtr, visRgn, &oldWindowRect, &oldClientRect, bNoCopy);
DeleteObject(visRgn);
}
else
if( winpos.flags & SWP_FRAMECHANGED )
RedrawWindow32( winpos.hwnd, NULL, 0, RDW_NOCHILDREN | RDW_FRAME );
......
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