Author: akhaldi Date: Tue Mar 1 19:02:33 2016 New Revision: 70846
URL: http://svn.reactos.org/svn/reactos?rev=70846&view=rev Log: [COMCTL32] Sync with Wine Staging 1.9.4. CORE-10912
Modified: trunk/reactos/dll/win32/comctl32/commctrl.c trunk/reactos/dll/win32/comctl32/imagelist.c trunk/reactos/dll/win32/comctl32/listview.c trunk/reactos/dll/win32/comctl32/rebar.c trunk/reactos/dll/win32/comctl32/toolbar.c trunk/reactos/dll/win32/comctl32/tooltips.c trunk/reactos/dll/win32/comctl32/trackbar.c trunk/reactos/dll/win32/comctl32/treeview.c trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/comctl32/commctrl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/commctrl... ============================================================================== --- trunk/reactos/dll/win32/comctl32/commctrl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/commctrl.c [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -1153,7 +1153,7 @@ * Gets the Reference data from a subclass. * * PARAMS - * hWnd [in] Handle to window which were subclassing + * hWnd [in] Handle to the window which we are subclassing * pfnSubclass [in] Pointer to the subclass procedure * uID [in] Unique identifier of the subclassing procedure * pdwRef [out] Pointer to the reference data @@ -1196,7 +1196,7 @@ * Removes a window subclass. * * PARAMS - * hWnd [in] Handle to the window were subclassing + * hWnd [in] Handle to the window which we are subclassing * pfnSubclass [in] Pointer to the subclass procedure * uID [in] Unique identifier of this subclass *
Modified: trunk/reactos/dll/win32/comctl32/imagelist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imagelis... ============================================================================== --- trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -763,7 +763,8 @@
TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow);
- if (cx <= 0 || cy <= 0) return NULL; + if (cx < 0 || cy < 0) return NULL; + if (!((flags&ILC_COLORDDB) == ILC_COLORDDB) && (cx == 0 || cy == 0)) return NULL;
/* Create the IImageList interface for the image list */ if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList, (void **)&himl))) @@ -1232,8 +1233,11 @@ return ImageList_DrawIndirect (&imldp); }
- +#ifdef __REACTOS__ static BOOL alpha_blend_image( HIMAGELIST himl, HDC srce_dc, HDC dest_dc, int dest_x, int dest_y, +#else +static BOOL alpha_blend_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int dest_y, +#endif int src_x, int src_y, int cx, int cy, BLENDFUNCTION func, UINT style, COLORREF blend_col ) { @@ -1258,9 +1262,17 @@ info->bmiHeader.biYPelsPerMeter = 0; info->bmiHeader.biClrUsed = 0; info->bmiHeader.biClrImportant = 0; +#ifdef __REACTOS__ if (!(bmp = CreateDIBSection( srce_dc, info, DIB_RGB_COLORS, &bits, 0, 0 ))) goto done; +#else + if (!(bmp = CreateDIBSection( himl->hdcImage, info, DIB_RGB_COLORS, &bits, 0, 0 ))) goto done; +#endif SelectObject( hdc, bmp ); +#ifdef __REACTOS__ BitBlt( hdc, 0, 0, cx, cy, srce_dc, src_x, src_y, SRCCOPY ); +#else + BitBlt( hdc, 0, 0, cx, cy, himl->hdcImage, src_x, src_y, SRCCOPY ); +#endif
if (blend_col != CLR_NONE) { @@ -1333,6 +1345,7 @@ return ret; }
+#ifdef __REACTOS__ HDC saturate_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int dest_y, int src_x, int src_y, int cx, int cy, COLORREF rgbFg) { @@ -1392,6 +1405,7 @@ /* return the handle to our desaturated dc, that will substitute its original counterpart in the next calls */ return hdc; } +#endif /* __REACTOS__ */
/************************************************************************* * ImageList_DrawIndirect [COMCTL32.@] @@ -1469,6 +1483,7 @@ oldImageFg = SetTextColor( hImageDC, RGB( 0, 0, 0 ) ); oldImageBk = SetBkColor( hImageDC, RGB( 0xff, 0xff, 0xff ) );
+#ifdef __REACTOS__ /* * If the ILS_SATURATE bit is enabled we should multiply the * RGB colors of the original image by the contents of rgbFg. @@ -1483,6 +1498,7 @@ pt.x = 0; pt.y = 0; } +#endif
has_alpha = (himl->has_alpha && himl->has_alpha[pimldp->i]); if (!bMask && (has_alpha || (fState & ILS_ALPHA))) @@ -1504,7 +1520,11 @@
if (bIsTransparent) { +#ifdef __REACTOS__ bResult = alpha_blend_image( himl, hImageListDC, pimldp->hdcDst, pimldp->x, pimldp->y, +#else + bResult = alpha_blend_image( himl, pimldp->hdcDst, pimldp->x, pimldp->y, +#endif pt.x, pt.y, cx, cy, func, fStyle, blend_col ); goto end; } @@ -1514,7 +1534,11 @@
hOldBrush = SelectObject (hImageDC, CreateSolidBrush (colour)); PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY ); +#ifdef __REACTOS__ alpha_blend_image( himl, hImageListDC, hImageDC, 0, 0, pt.x, pt.y, cx, cy, func, fStyle, blend_col ); +#else + alpha_blend_image( himl, hImageDC, 0, 0, pt.x, pt.y, cx, cy, func, fStyle, blend_col ); +#endif DeleteObject (SelectObject (hImageDC, hOldBrush)); bResult = BitBlt( pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hImageDC, 0, 0, SRCCOPY ); goto end; @@ -1608,6 +1632,9 @@ } }
+#ifndef __REACTOS__ + if (fState & ILS_SATURATE) FIXME("ILS_SATURATE: unimplemented!\n"); +#endif if (fState & ILS_GLOW) FIXME("ILS_GLOW: unimplemented!\n"); if (fState & ILS_SHADOW) FIXME("ILS_SHADOW: unimplemented!\n");
@@ -1891,8 +1918,6 @@ ImageList_GetIconSize (HIMAGELIST himl, INT *cx, INT *cy) { if (!is_valid(himl) || !cx || !cy) - return FALSE; - if ((himl->cx <= 0) || (himl->cy <= 0)) return FALSE;
*cx = himl->cx;
Modified: trunk/reactos/dll/win32/comctl32/listview.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/listview... ============================================================================== --- trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -8820,6 +8820,7 @@ if (infoPtr->dwStyle & LVS_OWNERDATA) { INT nOldCount = infoPtr->nItemCount; + infoPtr->nItemCount = nItems;
if (nItems < nOldCount) { @@ -8832,7 +8833,6 @@ } }
- infoPtr->nItemCount = nItems; LISTVIEW_UpdateScroll(infoPtr);
/* the flags are valid only in ownerdata report and list modes */ @@ -10281,6 +10281,9 @@ } }
+ if (!infoPtr->bFocus) + SetFocus(infoPtr->hwndSelf); + if (infoPtr->dwLvExStyle & LVS_EX_ONECLICKACTIVATE) if(lvHitTestInfo.iItem != -1) notify_itemactivate(infoPtr,&lvHitTestInfo); } @@ -10366,9 +10369,6 @@ GetDoubleClickTime(), LISTVIEW_DelayedEditItem); } - - if (!infoPtr->bFocus) - SetFocus(infoPtr->hwndSelf);
return 0; }
Modified: trunk/reactos/dll/win32/comctl32/rebar.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/rebar.c?... ============================================================================== --- trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -2955,7 +2955,11 @@
static LRESULT +#ifdef __REACTOS__ REBAR_SizeToRect (REBAR_INFO *infoPtr, WPARAM flags, RECT *lpRect) +#else +REBAR_SizeToRect (REBAR_INFO *infoPtr, const RECT *lpRect) +#endif { if (!lpRect) return FALSE;
@@ -3732,7 +3736,11 @@ return REBAR_ShowBand (infoPtr, wParam, lParam);
case RB_SIZETORECT: +#ifdef __REACTOS__ return REBAR_SizeToRect (infoPtr, wParam, (LPRECT)lParam); +#else + return REBAR_SizeToRect (infoPtr, (LPCRECT)lParam); +#endif
/* Messages passed to parent */
Modified: trunk/reactos/dll/win32/comctl32/toolbar.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar.... ============================================================================== --- trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -6200,8 +6200,10 @@ infoPtr->clrBtnShadow = CLR_DEFAULT; infoPtr->szPadding.cx = DEFPAD_CX; infoPtr->szPadding.cy = DEFPAD_CY; +#ifdef __REACTOS__ infoPtr->szSpacing.cx = DEFSPACE_CX; infoPtr->szSpacing.cy = DEFSPACE_CY; +#endif infoPtr->iListGap = DEFLISTGAP; infoPtr->iTopMargin = default_top_margin(infoPtr); infoPtr->dwStyle = lpcs->style; @@ -6972,6 +6974,7 @@ return TOOLBAR_MouseLeave (infoPtr);
case WM_CAPTURECHANGED: + if (hwnd == (HWND)lParam) return 0; return TOOLBAR_CaptureChanged(infoPtr);
case WM_NCACTIVATE:
Modified: trunk/reactos/dll/win32/comctl32/tooltips.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/tooltips... ============================================================================== --- trunk/reactos/dll/win32/comctl32/tooltips.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/tooltips.c [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -91,6 +91,8 @@
#include "comctl32.h"
+#include <wine/exception.h> + WINE_DEFAULT_DEBUG_CHANNEL(tooltips);
static HICON hTooltipIcons[TTI_ERROR+1]; @@ -1063,10 +1065,19 @@ toolPtr->lpszText = LPSTR_TEXTCALLBACKW; } else if (isW) { - INT len = lstrlenW (ti->lpszText); - TRACE("add text %s!\n", debugstr_w(ti->lpszText)); - toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR)); - strcpyW (toolPtr->lpszText, ti->lpszText); + __TRY + { + INT len = lstrlenW (ti->lpszText); + TRACE("add text %s!\n", debugstr_w(ti->lpszText)); + toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR)); + strcpyW (toolPtr->lpszText, ti->lpszText); + } + __EXCEPT_PAGE_FAULT + { + WARN("Invalid lpszText.\n"); + return FALSE; + } + __ENDTRY } else { INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0);
Modified: trunk/reactos/dll/win32/comctl32/trackbar.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/trackbar... ============================================================================== --- trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -1214,9 +1214,12 @@
if (infoPtr->lPos > infoPtr->lRangeMax) infoPtr->lPos = infoPtr->lRangeMax; - infoPtr->flags |= TB_THUMBPOSCHANGED; - - if (fPosition && oldPos != lPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition); + + if (fPosition && oldPos != lPosition) + { + TRACKBAR_UpdateThumb(infoPtr); + TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition); + }
return 0; } @@ -1803,7 +1806,7 @@ }
if (pos != infoPtr->lPos) { - infoPtr->flags |=TB_THUMBPOSCHANGED; + TRACKBAR_UpdateThumb (infoPtr); TRACKBAR_InvalidateThumbMove (infoPtr, pos, infoPtr->lPos); }
@@ -1961,6 +1964,7 @@
case WM_CAPTURECHANGED: + if (hwnd == (HWND)lParam) return 0; return TRACKBAR_CaptureChanged (infoPtr);
case WM_CREATE:
Modified: trunk/reactos/dll/win32/comctl32/treeview.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/treeview... ============================================================================== --- trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -75,7 +75,7 @@ HTREEITEM focusedItem; /* item that was under the cursor when WM_LBUTTONDOWN was received */ HTREEITEM editItem; /* item being edited with builtin edit box */
- HTREEITEM firstVisible; /* handle to first visible item */ + HTREEITEM firstVisible; /* handle to item whose top edge is at y = 0 */ LONG maxVisibleOrder; HTREEITEM dropItem; /* handle to item selected by drag cursor */ HTREEITEM insertMarkItem; /* item after which insertion mark is placed */ @@ -141,7 +141,10 @@ LONG imageOffset; LONG textOffset; LONG textWidth; /* horizontal text extent for pszText */ - LONG visibleOrder; /* visible ordering, 0 is first visible item */ + LONG visibleOrder; /* Depth-first numbering of the items whose ancestors are all expanded, + corresponding to a top-to-bottom ordering in the tree view. + Each item takes up "item.iIntegral" spots in the visible order. + 0 is the root's first child. */ const TREEVIEW_INFO *infoPtr; /* tree data this item belongs to */ } TREEVIEW_ITEM;
@@ -537,7 +540,7 @@ NMTREEVIEWW nmhdr; BOOL ret;
- TRACE("code:%d action:%x olditem:%p newitem:%p\n", + TRACE("code:%d action:0x%x olditem:%p newitem:%p\n", code, action, oldItem, newItem);
memset(&nmhdr, 0, sizeof(NMTREEVIEWW)); @@ -589,7 +592,7 @@ NMTVCUSTOMDRAW nmcdhdr; NMCUSTOMDRAW *nmcd;
- TRACE("drawstage:%x hdc:%p\n", dwDrawStage, hdc); + TRACE("drawstage:0x%x hdc:%p\n", dwDrawStage, hdc);
nmcd = &nmcdhdr.nmcd; nmcd->dwDrawStage = dwDrawStage; @@ -636,7 +639,7 @@ nmcd->lItemlParam = item->lParam; nmcdhdr->iLevel = item->iLevel;
- TRACE("drawstage:%x hdc:%p item:%lx, itemstate:%x, lItemlParam:%lx\n", + TRACE("drawstage:0x%x hdc:%p item:%lx, itemstate:0x%x, lItemlParam:0x%lx\n", nmcd->dwDrawStage, nmcd->hdc, nmcd->dwItemSpec, nmcd->uItemState, nmcd->lItemlParam);
@@ -795,8 +798,9 @@ TREEVIEW_HasChildren(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) { TREEVIEW_UpdateDispInfo(infoPtr, item, TVIF_CHILDREN); - - return item->cChildren > 0; + /* Protect for a case when callback field is not changed by a host, + otherwise negative values trigger normal notifications. */ + return item->cChildren != 0 && item->cChildren != I_CHILDRENCALLBACK; }
static INT TREEVIEW_NotifyFormat (TREEVIEW_INFO *infoPtr, HWND hwndFrom, UINT nCommand) @@ -1171,7 +1175,7 @@
if (tvItem->mask & TVIF_STATE) { - TRACE("prevstate,state,mask:%x,%x,%x\n", item->state, tvItem->state, + TRACE("prevstate 0x%x, state 0x%x, mask 0x%x\n", item->state, tvItem->state, tvItem->stateMask); item->state &= ~tvItem->stateMask; item->state |= (tvItem->state & tvItem->stateMask); @@ -1179,7 +1183,7 @@
if (tvItem->mask & TVIF_STATEEX) { - FIXME("New extended state: %x\n", tvItem->uStateEx); + FIXME("New extended state: 0x%x\n", tvItem->uStateEx); }
item->callbackMask |= callbackSet; @@ -1337,7 +1341,7 @@ }
- TRACE("new item %p; parent %p, mask %x\n", newItem, + TRACE("new item %p; parent %p, mask 0x%x\n", newItem, newItem->parent, tvItem->mask);
newItem->iLevel = newItem->parent->iLevel + 1; @@ -1420,10 +1424,12 @@ static void TREEVIEW_UnlinkItem(const TREEVIEW_ITEM *item) { - TREEVIEW_ITEM *parentItem = item->parent; + TREEVIEW_ITEM *parentItem;
assert(item != NULL); assert(item->parent != NULL); /* i.e. it must not be the root */ + + parentItem = item->parent;
if (parentItem->firstChild == item) parentItem->firstChild = item->nextSibling; @@ -1518,6 +1524,7 @@
if (infoPtr->firstVisible == item) { + visible = TRUE; if (item->nextSibling) newFirstVisible = item->nextSibling; else if (item->prevSibling) @@ -1553,11 +1560,13 @@
TREEVIEW_VerifyTree(infoPtr);
+ if (visible) + TREEVIEW_SetFirstVisible(infoPtr, newFirstVisible, TRUE); + if (!infoPtr->bRedraw) return TRUE;
if (visible) { - TREEVIEW_SetFirstVisible(infoPtr, newFirstVisible, TRUE); TREEVIEW_RecalculateVisibleOrder(infoPtr, prev); TREEVIEW_UpdateScrollBars(infoPtr); TREEVIEW_Invalidate(infoPtr, NULL); @@ -1962,7 +1971,7 @@ { COLORREF prevColor = infoPtr->clrInsertMark;
- TRACE("%x\n", color); + TRACE("0x%08x\n", color); infoPtr->clrInsertMark = color;
return (LRESULT)prevColor; @@ -2134,7 +2143,7 @@ tvItem->uStateEx = 0; }
- TRACE("item <%p>, txt %p, img %d, mask %x\n", + TRACE("item <%p>, txt %p, img %d, mask 0x%x\n", item, tvItem->pszText, tvItem->iImage, tvItem->mask);
return TRUE; @@ -2150,7 +2159,7 @@
item = tvItem->hItem;
- TRACE("item %d,mask %x\n", TREEVIEW_GetItemIndex(infoPtr, item), + TRACE("item %d, mask 0x%x\n", TREEVIEW_GetItemIndex(infoPtr, item), tvItem->mask);
if (!TREEVIEW_ValidItem(infoPtr, item)) @@ -2245,7 +2254,7 @@
if (retval) { - TRACE("flags:%x, returns %p\n", which, retval); + TRACE("flags:0x%x, returns %p\n", which, retval); return (LRESULT)retval; }
@@ -2275,11 +2284,11 @@ retval = TREEVIEW_GetPrevListItem(infoPtr, item); break; default: - TRACE("Unknown msg %x,item %p\n", which, item); + TRACE("Unknown msg 0x%x, item %p\n", which, item); break; }
- TRACE("flags:%x, item %p;returns %p\n", which, item, retval); + TRACE("flags: 0x%x, item %p;returns %p\n", which, item, retval); return (LRESULT)retval; }
@@ -2301,7 +2310,7 @@ unsigned int state;
state = STATEIMAGEINDEX(item->state); - TRACE("state:%x\n", state); + TRACE("state: 0x%x\n", state); item->state &= ~TVIS_STATEIMAGEMASK;
if (state < 3) @@ -2309,7 +2318,7 @@
item->state |= INDEXTOSTATEIMAGEMASK(state);
- TRACE("state:%x\n", state); + TRACE("state: 0x%x\n", state); TREEVIEW_Invalidate(infoPtr, item); } } @@ -3683,7 +3692,7 @@ }
lpht->hItem = item; - TRACE("(%d,%d):result %x\n", lpht->pt.x, lpht->pt.y, lpht->flags); + TRACE("(%d,%d):result 0x%x\n", lpht->pt.x, lpht->pt.y, lpht->flags);
return (LRESULT)item; } @@ -3760,7 +3769,7 @@ static LRESULT TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { - TRACE("code=%x, id=%x, handle=%lx\n", HIWORD(wParam), LOWORD(wParam), lParam); + TRACE("code=0x%x, id=0x%x, handle=0x%lx\n", HIWORD(wParam), LOWORD(wParam), lParam);
switch (HIWORD(wParam)) { @@ -4383,7 +4392,7 @@
assert(newSelect == NULL || TREEVIEW_ValidItem(infoPtr, newSelect));
- TRACE("Entering item %p (%s), flag %x, cause %x, state %d\n", + TRACE("Entering item %p (%s), flag 0x%x, cause 0x%x, state %d\n", newSelect, TREEVIEW_ItemName(newSelect), action, cause, newSelect ? newSelect->state : 0);
@@ -4994,7 +5003,7 @@ TREEVIEW_INFO *infoPtr; LOGFONTW lf;
- TRACE("wnd %p, style %x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE)); + TRACE("wnd %p, style 0x%x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE));
infoPtr = Alloc(sizeof(TREEVIEW_INFO));
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=7... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Mar 1 19:02:33 2016 @@ -54,7 +54,7 @@ reactos/dll/win32/cabinet # Synced to WineStaging-1.9.4 reactos/dll/win32/clusapi # Synced to WineStaging-1.7.55 reactos/dll/win32/comcat # Synced to WineStaging-1.7.55 -reactos/dll/win32/comctl32 # Synced to WineStaging-1.7.55 +reactos/dll/win32/comctl32 # Synced to WineStaging-1.9.4 reactos/dll/win32/comdlg32 # Synced to WineStaging-1.7.55 reactos/dll/win32/compstui # Synced to WineStaging-1.7.55 reactos/dll/win32/credui # Synced to WineStaging-1.7.55