- Continuing the moving into WND structure with minor desktop structure changes.
- Tested: wine user32 tests, AbiWord 2.6.8, FF 3.5, OOo 2.4.3 and Seamonkey 2.0.
svn path=/trunk/; revision=44576
PWIN32HEAP pheapDesktop;
PSECTION_OBJECT DesktopHeapSection;
- PDESKTOPINFO DesktopInfo;
+ PDESKTOPINFO pDeskInfo;
PWND spwndMessage;
} DESKTOP, *PDESKTOP;
/* Pointer to the thread information */
PTHREADINFO pti; // Use Wnd->head.pti
- /* Pointer to the desktop */
- PDESKTOPINFO Desktop;
/* system menu handle. */
HMENU SystemMenu;
/* Entry in the thread's list of windows. */
/* Handle for the window. */
HWND hSelf;
/* Window flags. */
- ULONG Flags;
+ ULONG state;
/* Handle of region of the window to be updated. */
HANDLE UpdateRegion;
/* Handle of the window region. */
PWINDOW_SCROLLINFO Scroll;
PETHREAD OwnerThread; // Use Wnd->head.pti
HWND hWndLastPopup; /* handle to last active popup window (wine doesn't use pointer, for unk. reason)*/
- ULONG Status;
/* counter for tiled child windows */
ULONG TiledCounter;
/* WNDOBJ list */
} WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
/* Window flags. */
-#define WINDOWOBJECT_NEED_SIZE (0x00000001) // WNDS_SENDSIZEMOVEMSGS?
-#define WINDOWOBJECT_NEED_ERASEBKGND (0x00000002) // WNDS_ERASEBACKGROUND
-#define WINDOWOBJECT_NEED_NCPAINT (0x00000004) // WNDS_SENDNCPAINT
-#define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000008) // WNDS_INTERNALPAINT
+#define WINDOWOBJECT_NEED_SIZE WNDS_SENDSIZEMOVEMSGS
+#define WINDOWOBJECT_NEED_ERASEBKGND WNDS_ERASEBACKGROUND
+#define WINDOWOBJECT_NEED_NCPAINT WNDS_SENDNCPAINT
+#define WINDOWOBJECT_NEED_INTERNALPAINT WNDS_INTERNALPAINT
#define WINDOWOBJECT_RESTOREMAX (0x00000020) // Set/Clr WS_MAXIMIZE && Clr/Set WS_EX2_VERTICALLYMAXIMIZEDLEFT/RIGHT
-#define WINDOWSTATUS_DESTROYING (0x1) // WNDS2_INDESTROY
-#define WINDOWSTATUS_DESTROYED (0x2) // WNDS_DESTROYED
+#define WINDOWSTATUS_DESTROYING WNDS2_INDESTROY
+#define WINDOWSTATUS_DESTROYED WNDS_DESTROYED
#define HAS_DLGFRAME(Style, ExStyle) \
(((ExStyle) & WS_EX_DLGMODALFRAME) || \
DesktopInfoSize = FIELD_OFFSET(DESKTOPINFO,
szDesktopName[(lpszDesktopName->Length / sizeof(WCHAR)) + 1]);
- DesktopObject->DesktopInfo = RtlAllocateHeap(DesktopObject->pheapDesktop,
+ DesktopObject->pDeskInfo = RtlAllocateHeap(DesktopObject->pheapDesktop,
HEAP_NO_SERIALIZE,
DesktopInfoSize);
- if (DesktopObject->DesktopInfo == NULL)
+ if (DesktopObject->pDeskInfo == NULL)
{
ObDereferenceObject(DesktopObject);
DPRINT1("Failed to create the DESKTOP structure!\n");
RETURN(NULL);
}
- RtlZeroMemory(DesktopObject->DesktopInfo,
+ RtlZeroMemory(DesktopObject->pDeskInfo,
DesktopInfoSize);
- DesktopObject->DesktopInfo->pvDesktopBase = DesktopHeapSystemBase;
- DesktopObject->DesktopInfo->pvDesktopLimit = (PVOID)((ULONG_PTR)DesktopHeapSystemBase + HeapSize);
- RtlCopyMemory(DesktopObject->DesktopInfo->szDesktopName,
+ DesktopObject->pDeskInfo->pvDesktopBase = DesktopHeapSystemBase;
+ DesktopObject->pDeskInfo->pvDesktopLimit = (PVOID)((ULONG_PTR)DesktopHeapSystemBase + HeapSize);
+ RtlCopyMemory(DesktopObject->pDeskInfo->szDesktopName,
lpszDesktopName->Buffer,
lpszDesktopName->Length);
if (GetWin32ClientInfo()->pDeskInfo == NULL)
{
GetWin32ClientInfo()->pDeskInfo =
- (PVOID)((ULONG_PTR)DesktopObject->DesktopInfo -
+ (PVOID)((ULONG_PTR)DesktopObject->pDeskInfo -
GetWin32ClientInfo()->ulClientDelta);
}
}
pci->ulClientDelta = DesktopHeapGetUserDelta();
if (DesktopObject)
{
- pci->pDeskInfo = (PVOID)((ULONG_PTR)DesktopObject->DesktopInfo - pci->ulClientDelta);
+ pci->pDeskInfo = (PVOID)((ULONG_PTR)DesktopObject->pDeskInfo - pci->ulClientDelta);
}
}
Msg.hwnd = FocusMessageQueue->FocusWindow;
DPRINT("Msg.hwnd = %x\n", Msg.hwnd);
- FocusMessageQueue->Desktop->DesktopInfo->LastInputWasKbd = TRUE;
+ FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
IntGetCursorLocation(FocusMessageQueue->Desktop->WindowStation,
&Msg.pt);
{
/* post the message to the other window */
Msg->hwnd = Wnd->hSelf;
- if(!(Wnd->Status & WINDOWSTATUS_DESTROYING))
+ if(!(Wnd->state & WINDOWSTATUS_DESTROYING))
{
MsqPostMessage(Wnd->MessageQueue, Msg, FALSE,
Msg->message == WM_MOUSEMOVE ? QS_MOUSEMOVE :
return FALSE;
}
- if ( Window->Status & WINDOWSTATUS_DESTROYING )
+ if ( Window->state & WINDOWSTATUS_DESTROYING )
{
DPRINT1("Attempted to post message to window 0x%x that is being destroyed!\n", Wnd);
/* FIXME - last error code? */
RETURN( FALSE);
}
- if (Window->Status & WINDOWSTATUS_DESTROYING)
+ if (Window->state & WINDOWSTATUS_DESTROYING)
{
/* FIXME - last error? */
DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
}
/* Check for an exiting window. */
- if (Window && Window->Status & WINDOWSTATUS_DESTROYING)
+ if (Window && Window->state & WINDOWSTATUS_DESTROYING)
{
DPRINT1("co_IntDoSendMessage Window Exiting!\n");
}
if (pti->Desktop != NULL)
{
- pti->pDeskInfo = pti->Desktop->DesktopInfo;
+ pti->pDeskInfo = pti->Desktop->pDeskInfo;
}
else
{
Msg.hwnd = FocusMessageQueue->FocusWindow;
DPRINT("Msg.hwnd = %x\n", Msg.hwnd);
- FocusMessageQueue->Desktop->DesktopInfo->LastInputWasKbd = TRUE;
+ FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
IntGetCursorLocation(FocusMessageQueue->Desktop->WindowStation,
&Msg.pt);
GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess());
GreDeleteObject(Window->UpdateRegion);
Window->UpdateRegion = NULL;
- if (!(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT))
+ if (!(Window->state & WINDOWOBJECT_NEED_INTERNALPAINT))
MsqDecPaintCountQueue(Window->MessageQueue);
}
}
if (Flags & RDW_UPDATENOW)
{
if (Window->UpdateRegion != NULL ||
- Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
+ Window->state & WINDOWOBJECT_NEED_INTERNALPAINT)
{
co_IntSendMessage(hWnd, WM_PAINT, 0, 0);
}
}
else
{
- if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT)
+ if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
{
TempRegion = IntGetNCUpdateRgn(Window, TRUE);
- Window->Flags &= ~WINDOWOBJECT_NEED_NCPAINT;
+ Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
MsqDecPaintCountQueue(Window->MessageQueue);
co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0);
if ((HANDLE) 1 != TempRegion && NULL != TempRegion)
}
}
- if (Window->Flags & WINDOWOBJECT_NEED_ERASEBKGND)
+ if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
{
if (Window->UpdateRegion)
{
DCX_INTERSECTRGN | DCX_KEEPCLIPRGN);
if (co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0))
{
- Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+ Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
}
UserReleaseDC(Window, hDC, FALSE);
}
*/
HadPaintMessage = Window->UpdateRegion != NULL ||
- Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT;
- HadNCPaintMessage = Window->Flags & WINDOWOBJECT_NEED_NCPAINT;
+ Window->state & WINDOWOBJECT_NEED_INTERNALPAINT;
+ HadNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
/*
* Update the region and flags
}
if (Flags & RDW_FRAME)
- Window->Flags |= WINDOWOBJECT_NEED_NCPAINT;
+ Window->state |= WINDOWOBJECT_NEED_NCPAINT;
if (Flags & RDW_ERASE)
- Window->Flags |= WINDOWOBJECT_NEED_ERASEBKGND;
+ Window->state |= WINDOWOBJECT_NEED_ERASEBKGND;
Flags |= RDW_FRAME;
}
}
if (Window->UpdateRegion == NULL)
- Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+ Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
if (Flags & RDW_NOFRAME)
- Window->Flags &= ~WINDOWOBJECT_NEED_NCPAINT;
+ Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
if (Flags & RDW_NOERASE)
- Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+ Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
}
if (Flags & RDW_INTERNALPAINT)
{
- Window->Flags |= WINDOWOBJECT_NEED_INTERNALPAINT;
+ Window->state |= WINDOWOBJECT_NEED_INTERNALPAINT;
}
if (Flags & RDW_NOINTERNALPAINT)
{
- Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
+ Window->state &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
}
/*
*/
HasPaintMessage = Window->UpdateRegion != NULL ||
- Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT;
- HasNCPaintMessage = Window->Flags & WINDOWOBJECT_NEED_NCPAINT;
+ Window->state & WINDOWOBJECT_NEED_INTERNALPAINT;
+ HasNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
if (HasPaintMessage != HadPaintMessage)
{
PWND Wnd = Window->Wnd;
return (Wnd->style & WS_VISIBLE) &&
((Window->UpdateRegion != NULL) ||
- (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) ||
- (Window->Flags & WINDOWOBJECT_NEED_NCPAINT));
+ (Window->state & WINDOWOBJECT_NEED_INTERNALPAINT) ||
+ (Window->state & WINDOWOBJECT_NEED_NCPAINT));
}
HWND FASTCALL
co_UserHideCaret(Window);
- if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT)
+ if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
{
HRGN hRgn;
hRgn = IntGetNCUpdateRgn(Window, FALSE);
- Window->Flags &= ~WINDOWOBJECT_NEED_NCPAINT;
+ Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
MsqDecPaintCountQueue(Window->MessageQueue);
co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)hRgn, 0);
if (hRgn != (HANDLE)1 && hRgn != NULL)
}
else
{
- if (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
+ if (Window->state & WINDOWOBJECT_NEED_INTERNALPAINT)
MsqDecPaintCountQueue(Window->MessageQueue);
IntGetClientRect(Window, &Ps.rcPaint);
}
- Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
+ Window->state &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
- if (Window->Flags & WINDOWOBJECT_NEED_ERASEBKGND)
+ if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
{
- Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+ Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Ps.fErase = !co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)Ps.hdc, 0);
}
else
CurrentWindow = Window->spwndParent;
while (CurrentWindow)
{
- if ( CurrentWindow->Status & WINDOWSTATUS_DESTROYING ||
- CurrentWindow->Status & WINDOWSTATUS_DESTROYED )
+ if ( CurrentWindow->state & WINDOWSTATUS_DESTROYING || // state2
+ CurrentWindow->state & WINDOWSTATUS_DESTROYED )
{
DPRINT1("ATM the Current Window or Parent is dead!\n");
return NULL;
}
Window = (PWINDOW_OBJECT)UserGetObject(gHandleTable, hWnd, otWindow);
- if (!Window || 0 != (Window->Status & WINDOWSTATUS_DESTROYED))
+ if (!Window || 0 != (Window->state & WINDOWSTATUS_DESTROYED))
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return NULL;
Wnd = Window->Wnd;
- if(Window->Status & WINDOWSTATUS_DESTROYING)
+ if(Window->state & WINDOWSTATUS_DESTROYING)
{
DPRINT("Tried to call IntDestroyWindow() twice\n");
return 0;
}
- Window->Status |= WINDOWSTATUS_DESTROYING;
+ Window->state |= WINDOWSTATUS_DESTROYING;
Wnd->style &= ~WS_VISIBLE;
IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Wnd, OBJID_WINDOW, 0);
MsqRemoveWindowMessagesFromQueue(Window);
/* from now on no messages can be sent to this window anymore */
- Window->Status |= WINDOWSTATUS_DESTROYED;
+ Window->state |= WINDOWSTATUS_DESTROYED;
Wnd->state |= WNDS_DESTROYED;
Wnd->fnid |= FNID_FREED;
BOOL FASTCALL
IntIsWindowInDestroy(PWINDOW_OBJECT Window)
{
- return ((Window->Status & WINDOWSTATUS_DESTROYING) == WINDOWSTATUS_DESTROYING);
+ return ((Window->state & WINDOWSTATUS_DESTROYING) == WINDOWSTATUS_DESTROYING);
}
{
lpwndpl->showCmd = SW_HIDE;
}
- else if (0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) ||
+ else if (0 != (Window->state & WINDOWOBJECT_RESTOREMAX) ||
0 != (Wnd->style & WS_MAXIMIZE))
{
lpwndpl->showCmd = SW_MAXIMIZE;
{
/* If there is no desktop window yet, we must be creating it */
pti->Desktop->DesktopWindow = hWnd;
- pti->Desktop->DesktopInfo->Wnd = Wnd;
+ pti->Desktop->pDeskInfo->Wnd = Wnd;
}
/*
if (!(dwStyle & WS_POPUP))
{
dwStyle |= WS_CAPTION;
- Window->Flags |= WINDOWOBJECT_NEED_SIZE;
+ Window->state |= WINDOWOBJECT_NEED_SIZE;
DPRINT("4: Style is now %lx\n", dwStyle);
}
}
IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window->Wnd, OBJID_WINDOW, 0);
/* Send move and size messages. */
- if (!(Window->Flags & WINDOWOBJECT_NEED_SIZE))
+ if (!(Window->state & WINDOWOBJECT_NEED_SIZE))
{
LONG lParam;
{
Safepl.showCmd = SW_HIDE;
}
- else if ((0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) ||
+ else if ((0 != (Window->state & WINDOWOBJECT_RESTOREMAX) ||
0 != (Wnd->style & WS_MAXIMIZE)) &&
0 == (Wnd->style & WS_MINIMIZE))
{
{
if (Wnd->style & WS_MAXIMIZE)
{
- Window->Flags |= WINDOWOBJECT_RESTOREMAX;
+ Window->state |= WINDOWOBJECT_RESTOREMAX;
Wnd->style &= ~WS_MAXIMIZE;
}
else
{
- Window->Flags &= ~WINDOWOBJECT_RESTOREMAX;
+ Window->state &= ~WINDOWOBJECT_RESTOREMAX;
}
co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
RDW_NOINTERNALPAINT);
if (Wnd->style & WS_MINIMIZE)
{
Wnd->style &= ~WS_MINIMIZE;
- if (Window->Flags & WINDOWOBJECT_RESTOREMAX)
+ if (Window->state & WINDOWOBJECT_RESTOREMAX)
{
co_WinPosGetMinMaxInfo(Window, &Size,
&Wnd->InternalPos.MaxPos, NULL, NULL);
/* FIXME: Check for window destruction. */
- if ((Window->Flags & WINDOWOBJECT_NEED_SIZE) &&
- !(Window->Status & WINDOWSTATUS_DESTROYING))
+ if ((Window->state & WINDOWOBJECT_NEED_SIZE) &&
+ !(Window->state & WINDOWSTATUS_DESTROYING))
{
WPARAM wParam = SIZE_RESTORED;
- Window->Flags &= ~WINDOWOBJECT_NEED_SIZE;
+ Window->state &= ~WINDOWOBJECT_NEED_SIZE;
if (Wnd->style & WS_MAXIMIZE)
{
wParam = SIZE_MAXIMIZED;