Release 960309
Fri Mar 8 19:07:18 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure.in]
Quote '[' and ']' in the test program for the strength-reduce
bug. This should work much better...
* [files/file.c]
Augmented DOS_FILE structure. Most internal functions now return a
DOS_FILE* instead of a Unix handle.
Added a local file array to replace the PDB list upon startup, to
allow using file I/O functions before the first task is created.
Added FILE_SetDateTime() and FILE_Sync() functions.
* [loader/module.c]
Use the DOS file I/O functions in MODULE_LoadExeHeader().
* [objects/bitblt.c]
Use visible region instead of GC clip region to clip source
area. This fixes the card drawing bug in freecell.
* [objects/region.c]
Fixed CombineRgn() to allow src and dest regions to be the same.
Fri Mar 8 16:32:23 1996 Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl>
* [controls/EDIT.TODO]
Updated so it reflects the current status.
* [controls/edit.c]
Implemented internal EDIT_WordBreakProc().
Implemented ES_READONLY.
Implemented WM_LBUTTONDBLCLK to select whole words.
Fixed a lot of types in the function definitions.
Wed Mar 6 19:55:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [debugger/info.c]
Added "walk window" command to walk window list.
* [windows/mdi.c]
Added proper(?) WM_MDISETMENU message handling.
Wed Mar 6 09:27:12 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/callback.c][if1632/relay32.c]
RELAY32_CallWindowProcConvStruct: new function.
* [win32/struct32.c][win32/Makefile.in][win32/param.c][win32/user32.c]
struct32.c: new file. Moved all structure conversions into that file
PARAM32_POINT32to16,MSG16to32,USER32_RECT32to16:
renamed to STRUCT32_POINT32to16, ...
WIN32_POINT,WIN32_MSG,WIN32_RECT,WIN32_PAINTSTRUCT: renamed to
POINT32, ...
New conversion functions for NCCALCSIZE_PARAMS, WINDOWPOS,
CREATESTRUCT.
* [include/windows.h][misc/exec.c]
WINHELP, MULTIKEYHELP, HELPWININFO: new structures
WinHelp: Reimplemented. Thanks to Peter Balch
(100710.2566@compuserve.com) for his valuable research.
* [win32/winprocs.c]
WIN32_CallWindowProcTo16: new function, call in
USER32_DefWindowProcA,...
Mon Mar 4 23:22:40 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
* [include/wintypes.h]
Added "#define __export".
* [objects/bitblt.c]
Put in a few hacks to make bitblt-ing work when upside-down and/or
mirrored. BITBLT_StretchImage should really be checked over
thoroughly.
* [programs/progman/main.c]
Added "#include <resource.h>" for definition of HAVE_WINE_CONSTRUCTOR.
* [rc/parser.h] [rc/parser.l] [rc/parser.y] [rc/winerc.c]
Eliminated shift/reduce conflict in style definition.
Added crude error message support: "stdin:%d: parse error before '%s'".
Implemented string table support to the best of my ability (it works
with LoadString() calls).
* [windows/nonclient.c]
Fixed bug in NC_DoSizeMove() that made system menu pop up when title
bar of non-iconized window was clicked (checked for iconization).
Mon Mar 04 20:55:19 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [if1632/lzexpand.spec] [if1632/relay.c]
[include/lzexpand.h][misc/lzexpand.c]
LZEXPAND.DLL added.
Sun Mar 03 18:10:22 1996 Albrecht Kleine <kleine@ak.sax.de>
* [windows/win.c]
Prevent usage of invalid HWNDs in WIN_EnumChildWin(),
this prevents too early termination of EnumChildWindows().
diff --git a/windows/dce.c b/windows/dce.c
index 04d90ae..ed9c8b2 100644
--- a/windows/dce.c
+++ b/windows/dce.c
@@ -146,30 +146,28 @@
static HRGN DCE_ClipWindows( HWND hwndStart, HWND hwndEnd,
HRGN hrgn, int xoffset, int yoffset )
{
- HRGN hrgnTmp = 0, hrgnNew = 0;
+ HRGN hrgnNew;
WND *wndPtr;
if (!hwndStart) return hrgn;
+ if (!(hrgnNew = CreateRectRgn( 0, 0, 0, 0 )))
+ {
+ if (hrgn) DeleteObject( hrgn );
+ return 0;
+ }
for (; hwndStart != hwndEnd; hwndStart = wndPtr->hwndNext)
{
- hrgnTmp = hrgnNew = 0;
wndPtr = WIN_FindWndPtr( hwndStart );
if (!(wndPtr->dwStyle & WS_VISIBLE)) continue;
- if (!(hrgnTmp = CreateRectRgn( 0, 0, 0, 0 ))) break;
- if (!(hrgnNew = CreateRectRgn( wndPtr->rectWindow.left + xoffset,
- wndPtr->rectWindow.top + yoffset,
- wndPtr->rectWindow.right + xoffset,
- wndPtr->rectWindow.bottom + yoffset )))
- break;
- if (!CombineRgn( hrgnTmp, hrgn, hrgnNew, RGN_DIFF )) break;
- DeleteObject( hrgn );
- DeleteObject( hrgnNew );
- hrgn = hrgnTmp;
+ SetRectRgn( hrgnNew, wndPtr->rectWindow.left + xoffset,
+ wndPtr->rectWindow.top + yoffset,
+ wndPtr->rectWindow.right + xoffset,
+ wndPtr->rectWindow.bottom + yoffset );
+ if (!CombineRgn( hrgn, hrgn, hrgnNew, RGN_DIFF )) break;
}
if (hwndStart != hwndEnd) /* something went wrong */
{
- if (hrgnTmp) DeleteObject( hrgnTmp );
- if (hrgnNew) DeleteObject( hrgnNew );
+ DeleteObject( hrgnNew );
if (hrgn) DeleteObject( hrgn );
return 0;
}
@@ -380,14 +378,8 @@
if ((flags & DCX_INTERSECTRGN) || (flags & DCX_EXCLUDERGN))
{
- HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
- if (hrgn)
- {
- CombineRgn( hrgn, hrgnVisible, hrgnClip,
- (flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF );
- DeleteObject( hrgnVisible );
- hrgnVisible = hrgn;
- }
+ CombineRgn( hrgnVisible, hrgnVisible, hrgnClip,
+ (flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF );
}
SelectVisRgn( hdc, hrgnVisible );
DeleteObject( hrgnVisible );
diff --git a/windows/graphics.c b/windows/graphics.c
index 741b49f..ab5cdcc 100644
--- a/windows/graphics.c
+++ b/windows/graphics.c
@@ -659,6 +659,9 @@
oldDrawMode = SetROP2(hdc, R2_XORPEN);
oldBkMode = SetBkMode(hdc, TRANSPARENT);
+ /* Hack: make sure the XORPEN operation has an effect */
+ dc->u.x.pen.pixel = (1 << screenDepth) - 1;
+
if (DC_SetupGCForPen( dc ))
XDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
diff --git a/windows/mdi.c b/windows/mdi.c
index 7ed6727..37ba8f7 100644
--- a/windows/mdi.c
+++ b/windows/mdi.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <stdio.h>
#include <math.h>
+#include "xmalloc.h"
#include "windows.h"
#include "win.h"
#include "nonclient.h"
@@ -117,7 +118,7 @@
MDICLIENTINFO *clientInfo = (MDICLIENTINFO*)clientWnd->wExtra;
WND *wndPtr = WIN_FindWndPtr(hWndChild);
LPSTR lpWndText;
- INT index = 0,id,n;
+ UINT index = 0,id,n;
if( !clientInfo->nActiveChildren ||
!clientInfo->hWindowMenu ) return 0;
@@ -198,17 +199,71 @@
/**********************************************************************
* MDISetMenu
- * FIXME: This is not complete.
*/
HMENU MDISetMenu(HWND hwnd, BOOL fRefresh, HMENU hmenuFrame, HMENU hmenuWindow)
{
- dprintf_mdi(stddeb, "WM_MDISETMENU: "NPFMT" %04x "NPFMT" "NPFMT"\n", hwnd, fRefresh, hmenuFrame, hmenuWindow);
- if (!fRefresh) {
+ WND *w = WIN_FindWndPtr(hwnd);
+ MDICLIENTINFO *ci;
+
+ dprintf_mdi(stddeb, "WM_MDISETMENU: "NPFMT" %04x "NPFMT" "NPFMT"\n",
+ hwnd, fRefresh, hmenuFrame, hmenuWindow);
+
+ ci = (MDICLIENTINFO *) w->wExtra;
+
+ if (!fRefresh)
+ {
HWND hwndFrame = GetParent(hwnd);
HMENU oldFrameMenu = GetMenu(hwndFrame);
- SetMenu(hwndFrame, hmenuFrame);
- return oldFrameMenu;
- }
+
+ if( ci->flagChildMaximized && hmenuFrame && hmenuFrame!=oldFrameMenu )
+ MDI_RestoreFrameMenu(w->hwndParent, ci->flagChildMaximized );
+
+ if( hmenuWindow && hmenuWindow!=ci->hWindowMenu )
+ {
+ /* delete menu items from ci->hWindowMenu
+ * and add them to hmenuWindow */
+
+ INT i = GetMenuItemCount(ci->hWindowMenu) - 1;
+ INT pos = GetMenuItemCount(hmenuWindow) + 1;
+
+ AppendMenu(hmenuWindow,MF_SEPARATOR,0,(SEGPTR)0);
+
+ if( ci->nActiveChildren )
+ {
+ INT j = i - ci->nActiveChildren + 1;
+ char buffer[100];
+ UINT id,state;
+
+ for( ; i >= j ; i-- )
+ {
+ id = GetMenuItemID(ci->hWindowMenu,i );
+ state = GetMenuState(ci->hWindowMenu,i,MF_BYPOSITION);
+
+ GetMenuString(ci->hWindowMenu, i, buffer, 100, MF_BYPOSITION);
+
+ DeleteMenu(ci->hWindowMenu, i , MF_BYPOSITION);
+ InsertMenu(hmenuWindow, pos, MF_BYPOSITION | MF_STRING,
+ id, MAKE_SEGPTR(buffer));
+ CheckMenuItem(hmenuWindow ,pos , MF_BYPOSITION | (state & MF_CHECKED));
+ }
+ }
+
+ /* remove separator */
+ DeleteMenu(ci->hWindowMenu, i, MF_BYPOSITION);
+
+ ci->hWindowMenu = hmenuWindow;
+ }
+
+ if( hmenuFrame && hmenuFrame!=oldFrameMenu)
+ {
+ SetMenu(hwndFrame, hmenuFrame);
+ if( ci->flagChildMaximized )
+ MDI_AugmentFrameMenu(ci,
+ w->hwndParent, ci->flagChildMaximized );
+ return oldFrameMenu;
+ }
+
+ }
return 0;
}
@@ -236,11 +291,12 @@
HWND hwnd;
WORD wIDmenu = ci->idFirstChild + ci->nActiveChildren;
int spacing;
- char chDef = '\0';
+ char* lpstrDef="junk!";
/*
* Create child window
*/
+
cs->style &= (WS_MINIMIZE | WS_MAXIMIZE | WS_HSCROLL | WS_VSCROLL);
/* The child windows should probably */
@@ -250,8 +306,10 @@
cs->y = ci->nActiveChildren * spacing;
/* this menu is needed to set a check mark in MDI_ChildActivate */
- AppendMenu(ci->hWindowMenu ,MF_STRING ,wIDmenu, MAKE_SEGPTR(&chDef) );
+ AppendMenu(ci->hWindowMenu ,MF_STRING ,wIDmenu, MAKE_SEGPTR(lpstrDef) );
+ ci->nActiveChildren++;
+
hwnd = CreateWindow( cs->szClass, cs->szTitle,
WS_CHILD | WS_BORDER | WS_CAPTION | WS_CLIPSIBLINGS |
WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU |
@@ -262,12 +320,14 @@
if (hwnd)
{
- ci->nActiveChildren++;
MDI_MenuModifyItem(w ,hwnd);
-
+ dprintf_mdi(stddeb, "MDICreateChild: created child - "NPFMT"\n",hwnd);
}
else
+ {
+ ci->nActiveChildren--;
DeleteMenu(ci->hWindowMenu,wIDmenu,MF_BYCOMMAND);
+ }
return hwnd;
}
@@ -373,7 +433,7 @@
ci->nActiveChildren--;
- /* WM_MDISETMENU ? */
+ dprintf_mdi(stddeb,"MDIDestroyChild: child destroyed - "NPFMT"\n",child);
if (flagDestroy)
{
@@ -499,22 +559,8 @@
childWnd = WIN_FindWndPtr( listTop->hChild );
while( childWnd && childWnd->hwndNext )
{
- listNext = (MDIWCL*)malloc(sizeof(MDIWCL));
+ listNext = (MDIWCL*)xmalloc(sizeof(MDIWCL));
- if( !listNext )
- {
- /* quit gracefully */
- listNext = listTop->prev;
- while( listTop )
- {
- listNext = listTop->prev;
- free(listTop);
- listTop = listNext;
- }
- dprintf_mdi(stddeb,"MDICascade: allocation failed\n");
- return NULL;
- }
-
if( (childWnd->dwStyle & WS_DISABLED) ||
(childWnd->dwStyle & WS_MINIMIZE) ||
!(childWnd->dwStyle & WS_VISIBLE) )
@@ -921,6 +967,7 @@
ci->hWindowMenu = ccs->hWindowMenu;
ci->idFirstChild = ccs->idFirstChild;
ci->flagChildMaximized = 0;
+ ci->nActiveChildren = 0;
ci->hFrameTitle = frameWnd->hText;
ci->sbStop = 0;
ci->self = hwnd;
@@ -937,6 +984,8 @@
NC_HandleNCCalcSize(hwnd, (NCCALCSIZE_PARAMS*) &rect);
w->rectClient = rect;
+ dprintf_mdi(stddeb,"MDI: Client created - hwnd = "NPFMT", idFirst = %u\n",hwnd,ci->idFirstChild);
+
return 0;
case WM_DESTROY:
diff --git a/windows/nonclient.c b/windows/nonclient.c
index 15fbcf7..917de6c 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -1075,9 +1075,9 @@
SendMessage( hwnd, WM_EXITSIZEMOVE, 0, 0 );
SendMessage( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L);
- /* Single click brings up the system menu */
+ /* Single click brings up the system menu when iconized */
- if (!moved)
+ if (!moved && (wndPtr->dwStyle & WS_MINIMIZE))
{
NC_TrackSysMenu( hwnd, hdc, pt );
return;
diff --git a/windows/painting.c b/windows/painting.c
index 2e4c2b4..1c2b06a 100644
--- a/windows/painting.c
+++ b/windows/painting.c
@@ -133,7 +133,7 @@
*/
BOOL RedrawWindow( HWND hwnd, LPRECT rectUpdate, HRGN hrgnUpdate, UINT flags )
{
- HRGN tmpRgn, hrgn;
+ HRGN hrgn;
RECT rectClient;
WND * wndPtr;
@@ -159,13 +159,10 @@
{
if (wndPtr->hrgnUpdate) /* Is there already an update region? */
{
- tmpRgn = CreateRectRgn( 0, 0, 0, 0 );
if ((hrgn = hrgnUpdate) == 0)
hrgn = CreateRectRgnIndirect( rectUpdate ? rectUpdate :
&rectClient );
- CombineRgn( tmpRgn, wndPtr->hrgnUpdate, hrgn, RGN_OR );
- DeleteObject( wndPtr->hrgnUpdate );
- wndPtr->hrgnUpdate = tmpRgn;
+ CombineRgn( wndPtr->hrgnUpdate, wndPtr->hrgnUpdate, hrgn, RGN_OR );
if (!hrgnUpdate) DeleteObject( hrgn );
}
else /* No update region yet */
@@ -197,17 +194,14 @@
}
else
{
- tmpRgn = CreateRectRgn( 0, 0, 0, 0 );
if ((hrgn = hrgnUpdate) == 0)
hrgn = CreateRectRgnIndirect( rectUpdate );
- if (CombineRgn( tmpRgn, wndPtr->hrgnUpdate,
+ if (CombineRgn( wndPtr->hrgnUpdate, wndPtr->hrgnUpdate,
hrgn, RGN_DIFF ) == NULLREGION)
{
- DeleteObject( tmpRgn );
- tmpRgn = 0;
+ DeleteObject( wndPtr->hrgnUpdate );
+ wndPtr->hrgnUpdate = 0;
}
- DeleteObject( wndPtr->hrgnUpdate );
- wndPtr->hrgnUpdate = tmpRgn;
if (!hrgnUpdate) DeleteObject( hrgn );
}
if (!wndPtr->hrgnUpdate) /* No more update region */
diff --git a/windows/scroll.c b/windows/scroll.c
index 4aa0fce..95a88e8 100644
--- a/windows/scroll.c
+++ b/windows/scroll.c
@@ -182,16 +182,10 @@
HRGN hrgnInv = SCROLL_TraceChildren(hwnd,dx,dy,DCX_CLIPCHILDREN |
DCX_CLIPSIBLINGS );
if( hrgnInv )
- {
- HRGN hrgnCombine = CreateRectRgn(0,0,0,0);
-
- CombineRgn(hrgnCombine,hrgnInv,hrgnUpdate,RGN_OR);
- dprintf_scroll(stddeb,"ScrollWindow: hrgnComb="NPFMT" hrgnInv="NPFMT" hrgnUpd="NPFMT"\n",
- hrgnCombine,hrgnInv,hrgnUpdate);
-
- DeleteObject(hrgnUpdate); DeleteObject(hrgnInv);
- hrgnUpdate = hrgnCombine;
- }
+ {
+ CombineRgn(hrgnUpdate,hrgnInv,hrgnUpdate,RGN_OR);
+ DeleteObject(hrgnInv);
+ }
RedrawWindow( hwnd, NULL, hrgnUpdate, RDW_INVALIDATE | RDW_ERASE | RDW_ERASENOW);
}
diff --git a/windows/win.c b/windows/win.c
index 697bef1..a6609a8 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -306,7 +306,7 @@
{
HANDLE class, hwnd;
CLASS *classPtr;
- WND *wndPtr, *parentWndPtr;
+ WND *wndPtr;
POINT maxSize, maxPos, minTrack, maxTrack;
CREATESTRUCT createStruct;
int wmcreate;
@@ -1207,13 +1207,17 @@
static BOOL WIN_EnumChildWin(HWND hwnd, FARPROC wndenumprc, LPARAM lParam)
{
WND *wndPtr;
+ HWND hwndN,hwndCh;
while (hwnd)
{
if (!(wndPtr=WIN_FindWndPtr(hwnd))) return 0;
+ hwndN=wndPtr->hwndNext; /* storing hwnd is a way to avoid.. */
+ hwndCh=wndPtr->hwndChild; /* ..side effects after wndenumprc */
if (!CallEnumWindowsProc( wndenumprc, hwnd, lParam )) return 0;
- if (!WIN_EnumChildWin(wndPtr->hwndChild, wndenumprc, lParam)) return 0;
- hwnd=wndPtr->hwndNext;
+ if (IsWindow(hwndCh)) /* to prevent too early termination */
+ if (!WIN_EnumChildWin(hwndCh, wndenumprc, lParam)) return 0;
+ hwnd=hwndN;
}
return 1;
}