Author: dquintana Date: Wed Apr 9 11:45:02 2014 New Revision: 62693
URL: http://svn.reactos.org/svn/reactos?rev=62693&view=rev Log: [RSHELL] * Code cleanups and formatting. * Remove the logging wrappers. If I need them again I'll bring them back. * Try to fix a few "glitches" in the hot-tracking.
Removed: branches/shell-experiments/base/shell/rshell/logging/ branches/shell-experiments/base/shell/rshell/wraplog.cpp branches/shell-experiments/base/shell/rshell/wraplog.h Modified: branches/shell-experiments/base/shell/rshell/CMakeLists.txt branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMakeLists.txt [iso-8859-1] Wed Apr 9 11:45:02 2014 @@ -16,11 +16,6 @@ CMergedFolder.cpp CStartMenu.cpp misc.cpp - wraplog.cpp - logging/CMenuBandWrap.cpp - logging/CMenuDeskBarWrap.cpp - logging/CMenuSiteWrap.cpp - logging/CStartMenuSiteWrap.cpp ${CMAKE_CURRENT_BINARY_DIR}/rshell.def)
add_library(rshell SHARED ${SOURCE})
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Wed Apr 9 11:45:02 2014 @@ -30,7 +30,7 @@
#undef UNIMPLEMENTED
-#define UNIMPLEMENTED DbgPrint("%s is UNIMPLEMENTED!\n", __FUNCTION__) +#define UNIMPLEMENTED TRACE("%s is UNIMPLEMENTED!\n", __FUNCTION__)
extern "C" HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv) @@ -130,7 +130,7 @@ HWND hwnd, DWORD dwFlags) { - DbgPrint("CMenuBand::SetMenu called, hmenu=%p; hwnd=%p, flags=%x\n", hmenu, hwnd, dwFlags); + TRACE("CMenuBand::SetMenu called, hmenu=%p; hwnd=%p, flags=%x\n", hmenu, hwnd, dwFlags);
BOOL created = FALSE;
@@ -752,7 +752,7 @@ if (m_hotBar == tb && m_hotItem == id) return S_FALSE;
- DbgPrint("Hot item changed from %p %p, to %p %p\n", m_hotBar, m_hotItem, tb, id); + TRACE("Hot item changed from %p %p, to %p %p\n", m_hotBar, m_hotItem, tb, id);
_KillPopupTimers();
@@ -769,7 +769,7 @@
HRESULT CMenuBand::_ChangePopupItem(CMenuToolbarBase * tb, INT id) { - DbgPrint("Popup item changed from %p %p, to %p %p\n", m_popupBar, m_popupItem, tb, id); + TRACE("Popup item changed from %p %p, to %p %p\n", m_popupBar, m_popupItem, tb, id);
m_popupBar = tb; m_popupItem = id; @@ -818,7 +818,6 @@ { HRESULT hr;
- if (m_dwFlags & SMINIT_VERTICAL) { switch (changeType) @@ -839,7 +838,7 @@ else { // In horizontal menubars, left/right are equivalent to vertical's up/down - switch(changeType) + switch (changeType) { case VK_LEFT: hr = _KeyboardItemChange(VK_UP); @@ -878,8 +877,6 @@ return S_OK; return m_subMenuParent->OnSelect(changeType); } - - return S_OK; }
HRESULT CMenuBand::_CancelCurrentPopup() @@ -909,11 +906,6 @@ #endif if (FAILED_UNEXPECTEDLY(hr)) return hr; -#if WRAP_MENUSITE - hr = CMenuSite_Wrapper(pBandSite, IID_PPV_ARG(IBandSite, &pBandSite)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif
#if USE_SYSTEM_MENUDESKBAR hr = CoCreateInstance(CLSID_MenuDeskBar, @@ -925,11 +917,6 @@ #endif if (FAILED_UNEXPECTEDLY(hr)) return hr; -#if WRAP_MENUDESKBAR - hr = CMenuDeskBar_Wrapper(pDeskBar, IID_PPV_ARG(IDeskBar, &pDeskBar)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif
hr = pDeskBar->SetClient(pBandSite); if (FAILED_UNEXPECTEDLY(hr)) @@ -946,7 +933,7 @@ return hr;
m_subMenuChild = popup; - + if (m_subMenuParent) IUnknown_SetSite(popup, m_subMenuParent); else
Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Wed Apr 9 11:45:02 2014 @@ -26,8 +26,9 @@ #include "CMenuToolbars.h" #include "CMenuBand.h"
-#undef _ASSERT -#define _ASSERT(x) DbgAssert(!!(x), __FILE__, __LINE__, #x) +#if DBG +# undef _ASSERT +# define _ASSERT(x) DbgAssert(!!(x), __FILE__, __LINE__, #x)
bool DbgAssert(bool x, const char * filename, int line, const char * expr) { @@ -55,6 +56,10 @@ } return x; } +#else +# undef _ASSERT +# define _ASSERT(x) (!!(x)) +#endif
WINE_DEFAULT_DEBUG_CHANNEL(CMenuFocus);
@@ -192,10 +197,6 @@ entry.mb->_DisableMouseTrack(bDisable); } } - //else - //{ - // continue; - //} } m_mouseTrackDisabled = lastDisable; } @@ -208,13 +209,13 @@ { ::SetCapture(child); m_captureHwnd = child; - DbgPrint("MouseTrack is now capturing %p\n", child); + TRACE("MouseTrack is now capturing %p\n", child); } else { ::ReleaseCapture(); m_captureHwnd = NULL; - DbgPrint("MouseTrack is now off\n"); + TRACE("MouseTrack is now off\n"); }
} @@ -249,7 +250,7 @@ LRESULT CMenuFocusManager::ProcessMouseMove(MSG* msg) { HWND child; - int iHitTestResult; + int iHitTestResult = -1;
POINT pt2 = { GET_X_LPARAM(msg->lParam), GET_Y_LPARAM(msg->lParam) }; ClientToScreen(msg->hwnd, &pt2); @@ -271,37 +272,18 @@ StackEntry * entry = NULL; IsTrackedWindow(child, &entry);
- if (m_hwndUnderMouse != child) - { - WCHAR cn[1024]; - GetClassName(child, cn, 1023); - DbgPrint("Mouse moved to %p (%S)\n", child, cn); - - if (!entry) - { - if (m_entryUnderMouse) - { - m_entryUnderMouse->mb->_ChangeHotItem(NULL, -1, HICF_MOUSE); - } - if (cCapture == m_captureHwnd) - SetCapture(NULL); - } - - } - + BOOL isTracking = FALSE; if (entry) { ScreenToClient(child, &pt); iHitTestResult = SendMessageW(child, TB_HITTEST, 0, (LPARAM) &pt); - - BOOL isTracking = entry->mb->_IsTracking(); - - if (iHitTestResult >= 0 && - SendMessage(child, WM_USER_ISTRACKEDITEM, iHitTestResult, 0) == S_FALSE) - { - DbgPrint("Hot item tracking detected a change (capture=%p)...\n", m_captureHwnd); + isTracking = entry->mb->_IsTracking(); + + if (SendMessage(child, WM_USER_ISTRACKEDITEM, iHitTestResult, 0) == S_FALSE) + { + TRACE("Hot item tracking detected a change (capture=%p)...\n", m_captureHwnd); DisableMouseTrack(NULL, FALSE); - if (m_current->type == TrackedMenuEntry) + if (isTracking && iHitTestResult>=0 && m_current->type == TrackedMenuEntry) SendMessage(entry->hwnd, WM_CANCELMODE, 0, 0); PostMessage(child, WM_USER_CHANGETRACKEDITEM, iHitTestResult, isTracking); if (m_current->type == TrackedMenuEntry) @@ -309,14 +291,24 @@ } }
+ if (m_entryUnderMouse != entry) + { + // Mouse moved away from a tracked window + if (m_entryUnderMouse) + { + m_entryUnderMouse->mb->_ChangeHotItem(NULL, -1, HICF_MOUSE); + } + if (cCapture == m_captureHwnd) + SetCapture(NULL); + } + if (m_hwndUnderMouse != child) { if (entry) { + // Mouse moved to a tracked window if (m_current->type == MenuPopupEntry) { - //SetCapture(child); - ScreenToClient(child, &pt2); SendMessage(child, WM_MOUSEMOVE, msg->wParam, MAKELPARAM(pt2.x, pt2.y)); } @@ -446,12 +438,12 @@ { if (m_current->type == TrackedMenuEntry) { - DbgPrint("Entering MSGFILTER hook...\n"); + TRACE("Entering MSGFILTER hook...\n"); m_hMsgFilterHook = SetWindowsHookEx(WH_MSGFILTER, s_MsgFilterHook, NULL, m_threadId); } else { - DbgPrint("Entering GETMESSAGE hook...\n"); + TRACE("Entering GETMESSAGE hook...\n"); m_hGetMsgHook = SetWindowsHookEx(WH_GETMESSAGE, s_GetMsgHook, NULL, m_threadId); } return S_OK; @@ -459,7 +451,7 @@
HRESULT CMenuFocusManager::RemoveHooks() { - DbgPrint("Removing all hooks...\n"); + TRACE("Removing all hooks...\n"); if (m_hMsgFilterHook) UnhookWindowsHookEx(m_hMsgFilterHook); if (m_hGetMsgHook) @@ -538,11 +530,19 @@ // When the mouse moves, it should set itself to the proper band SetCapture(m_current->hwnd);
- //// FIXME: Debugging code, probably not right - //POINT pt2; - //GetCursorPos(&pt2); - //ScreenToClient(m_current->hwnd, &pt2); - //SendMessage(m_current->hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(pt2.x, pt2.y)); + if (old && old->type == TrackedMenuEntry) + { + // FIXME: Debugging code, probably not right + POINT pt2; + RECT rc2; + GetCursorPos(&pt2); + ScreenToClient(m_current->hwnd, &pt2); + GetClientRect(m_current->hwnd, &rc2); + if (PtInRect(&rc2, pt2)) + SendMessage(m_current->hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(pt2.x, pt2.y)); + else + SendMessage(m_current->hwnd, WM_MOUSELEAVE, 0, 0); + } }
_ASSERT(!m_parent || m_parent->type != TrackedMenuEntry);
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Wed Apr 9 11:45:02 2014 @@ -105,7 +105,7 @@ case -714: return S_FALSE;
default: - DbgPrint("WM_NOTIFY unknown code %d, %d\n", hdr->code, hdr->idFrom); + TRACE("WM_NOTIFY unknown code %d, %d\n", hdr->code, hdr->idFrom); return S_OK; } return S_FALSE; @@ -151,7 +151,7 @@ if (m_disableMouseTrack != bDisable) { m_disableMouseTrack = bDisable; - DbgPrint("DisableMouseTrack %d\n", bDisable); + TRACE("DisableMouseTrack %d\n", bDisable); } return S_OK; } @@ -192,13 +192,13 @@ hdc = cdraw->nmcd.hdc;
// The item with an active submenu gets the CHECKED flag. - isHot = m_hotBar == this && (int)cdraw->nmcd.dwItemSpec == m_hotItem; - isPopup = m_popupBar == this && (int)cdraw->nmcd.dwItemSpec == m_popupItem; + isHot = m_hotBar == this && (int) cdraw->nmcd.dwItemSpec == m_hotItem; + isPopup = m_popupBar == this && (int) cdraw->nmcd.dwItemSpec == m_popupItem;
if (m_initFlags & SMINIT_VERTICAL) { // Remove HOT and CHECKED flags (will restore HOT if necessary) - cdraw->nmcd.uItemState &= ~(CDIS_HOT|CDIS_CHECKED); + cdraw->nmcd.uItemState &= ~(CDIS_HOT | CDIS_CHECKED);
// Decide on the colors if (isHot || (m_hotItem < 0 && isPopup)) @@ -256,8 +256,8 @@ // TODO: Support RTL text modes by drawing a leftwards arrow aligned to the left of the control
// "8" is the rightwards dropdown arrow in the Marlett font - WCHAR text[] = L"8"; - + WCHAR text [] = L"8"; + // Configure the font to draw with Marlett, keeping the current background color as-is SelectObject(cdraw->nmcd.hdc, m_marlett); SetBkMode(cdraw->nmcd.hdc, TRANSPARENT); @@ -356,7 +356,7 @@ HRESULT hr = SHGetImageList(shiml, IID_PPV_ARG(IImageList, &piml)); if (FAILED_UNEXPECTEDLY(hr)) { - SendMessageW(m_hwndToolbar, TB_SETIMAGELIST, 0, 0); + SendMessageW(m_hwndToolbar, TB_SETIMAGELIST, 0, 0); } else { @@ -464,7 +464,7 @@ *pMaxSize = m_idealSize; if (pIntegralSize) *pIntegralSize = m_itemSize; - + if (m_hasSizes) return S_OK;
@@ -475,7 +475,7 @@ SendMessageW(m_hwndToolbar, TB_AUTOSIZE, 0, 0); SendMessageW(m_hwndToolbar, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&m_idealSize)); SendMessageW(m_hwndToolbar, TB_GETIDEALSIZE, (m_initFlags & SMINIT_VERTICAL) != 0, reinterpret_cast<LPARAM>(&m_idealSize)); - + // Obtain the button size, to be used as the integral size DWORD size = SendMessageW(m_hwndToolbar, TB_GETBUTTONSIZE, 0, 0); m_itemSize.cx = GET_X_LPARAM(size); @@ -594,14 +594,14 @@ // and mouse tracking is disabled. if (m_disableMouseTrack && dwFlags & HICF_MOUSE) { - DbgPrint("Hot item change prevented by DisableMouseTrack\n"); + TRACE("Hot item change prevented by DisableMouseTrack\n"); return S_OK; }
// Notify the toolbar if the hot-tracking left this toolbar if (m_hotBar == this && toolbar != this) { - SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM)-1, 0); + SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM) -1, 0); }
m_hotBar = toolbar; @@ -620,7 +620,7 @@ SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &elapsed, 0); SetTimer(m_hwndToolbar, TIMERID_HOTTRACK, elapsed, NULL); m_timerEnabled = TRUE; - DbgPrint("SetTimer called with m_hotItem=%d\n", m_hotItem); + TRACE("SetTimer called with m_hotItem=%d\n", m_hotItem); } else if (m_isTrackingPopup) { @@ -676,6 +676,9 @@ if (m_hotBar != this) return S_FALSE;
+ if (index < 0) + return S_FALSE; + if (!SendMessage(m_hwndToolbar, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn))) return E_FAIL;
@@ -691,14 +694,18 @@ HRESULT CMenuToolbarBase::ChangeTrackedItem(INT index, BOOL wasTracking) { TBBUTTON btn; + + if (index < 0) + { + m_isTrackingPopup = FALSE; + return m_menuBand->_ChangeHotItem(NULL, -1, HICF_MOUSE); + } + if (!SendMessage(m_hwndToolbar, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn))) return E_FAIL;
- DbgPrint("Changing tracked item to %d...\n", index); m_isTrackingPopup = wasTracking; - m_menuBand->_ChangeHotItem(this, btn.idCommand, HICF_MOUSE); - - return S_OK; + return m_menuBand->_ChangeHotItem(this, btn.idCommand, HICF_MOUSE); }
HRESULT CMenuToolbarBase::PopupSubMenu(UINT iItem, UINT index, IShellMenu* childShellMenu) @@ -747,7 +754,7 @@
if (!SendMessage(m_hwndToolbar, TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(&rc))) return E_FAIL; - + POINT a = { rc.left, rc.top }; POINT b = { rc.right, rc.bottom };
@@ -772,6 +779,8 @@ m_menuBand->_ChangePopupItem(NULL, -1); m_isTrackingPopup = FALSE;
+ m_menuBand->_ChangeHotItem(NULL, -1, 0); + return S_OK; }
@@ -790,28 +799,28 @@ if (m_disableMouseTrack) { *theResult = 1; - DbgPrint("Item click prevented by DisableMouseTrack\n"); + TRACE("Item click prevented by DisableMouseTrack\n"); return S_OK; }
// If a button is clicked while a submenu was open, cancel the submenu. if (!(m_initFlags & SMINIT_VERTICAL) && m_isTrackingPopup) { - DbgPrint("OnCommand cancelled because it was tracking submenu.\n"); + TRACE("OnCommand cancelled because it was tracking submenu.\n"); return S_FALSE; } - + *theResult = 0;
m_menuBand->_KillPopupTimers();
if (PopupItem(wParam) == S_OK) { - DbgPrint("PopupItem returned S_OK\n"); + TRACE("PopupItem returned S_OK\n"); return S_FALSE; }
- DbgPrint("Executing...\n"); + TRACE("Executing...\n");
HRESULT hr = m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE);
@@ -882,7 +891,7 @@ { if (prev != btn.idCommand) { - DbgPrint("Setting Hot item to %d\n", index); + TRACE("Setting Hot item to %d\n", index); m_menuBand->_ChangeHotItem(this, index, 0); } return S_OK; @@ -901,7 +910,7 @@
if (prev != -1) { - DbgPrint("Setting Hot item to null\n"); + TRACE("Setting Hot item to null\n"); m_menuBand->_ChangeHotItem(NULL, -1, 0); }
@@ -1031,7 +1040,7 @@
if (!(m_initFlags & SMINIT_VERTICAL)) { - DbgPrint("PopupItem non-vertical %d %d\n", index, iItem); + TRACE("PopupItem non-vertical %d %d\n", index, iItem); m_menuBand->_ChangeHotItem(this, iItem, 0); }
@@ -1096,7 +1105,7 @@
if (!GetMenuItemInfoW(m_hmenu, i, TRUE, &info)) { - DbgPrint("Error obtaining info for menu item at pos=%d\n", i); + TRACE("Error obtaining info for menu item at pos=%d\n", i); continue; }
@@ -1185,7 +1194,6 @@ { return ::GetSubMenu(m_hmenu, index) ? S_OK : S_FALSE; } -
CMenuSFToolbar::CMenuSFToolbar(CMenuBand * menuBand) : CMenuToolbarBase(menuBand, TRUE), @@ -1350,11 +1358,6 @@ #endif if (FAILED_UNEXPECTEDLY(hr)) return hr; -#if WRAP_MENUBAND - hr = CMenuBand_Wrapper(shellMenu, IID_PPV_ARG(IShellMenu, &shellMenu)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif
m_menuBand->GetMenuInfo(&psmc, &uId, &uIdAncestor, &flags);
Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Wed Apr 9 11:45:02 2014 @@ -158,11 +158,6 @@ #endif if (FAILED_UNEXPECTEDLY(hr)) return hr; -#if WRAP_MENUBAND - hr = CMenuBand_Wrapper(pShellMenu, IID_PPV_ARG(IShellMenu, &pShellMenu)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif
hr = pShellMenu->Initialize(this, 0, ANCESTORDEFAULT, SMINIT_VERTICAL);
@@ -298,51 +293,36 @@
#if USE_SYSTEM_MENUBAND hr = CoCreateInstance(CLSID_MenuBand, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARG(IShellMenu, &pShellMenu)); + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IShellMenu, &pShellMenu)); #else hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu)); #endif if (FAILED_UNEXPECTEDLY(hr)) return hr; -#if WRAP_MENUBAND - hr = CMenuBand_Wrapper(pShellMenu, IID_PPV_ARG(IShellMenu, &pShellMenu)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif
#if USE_SYSTEM_MENUSITE hr = CoCreateInstance(CLSID_MenuBandSite, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARG(IBandSite, &pBandSite)); + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IBandSite, &pBandSite)); #else hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite)); #endif if (FAILED_UNEXPECTEDLY(hr)) return hr; -#if WRAP_MENUSITE - hr = CMenuSite_Wrapper(pBandSite, IID_PPV_ARG(IBandSite, &pBandSite)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif
#if USE_SYSTEM_MENUDESKBAR hr = CoCreateInstance(CLSID_MenuDeskBar, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARG(IDeskBar, &pDeskBar)); + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IDeskBar, &pDeskBar)); #else hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar)); #endif if (FAILED_UNEXPECTEDLY(hr)) return hr; -#if WRAP_MENUDESKBAR - hr = CMenuDeskBar_Wrapper(pDeskBar, IID_PPV_ARG(IDeskBar, &pDeskBar)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; -#endif
CComObject<CShellMenuCallback> *pCallback; hr = CComObject<CShellMenuCallback>::CreateInstance(&pCallback); @@ -351,7 +331,7 @@ pCallback->AddRef(); // CreateInstance returns object with 0 ref count */ pCallback->Initialize(pShellMenu, pBandSite, pDeskBar);
- pShellMenu->Initialize(pCallback, (UINT)-1, 0, SMINIT_TOPLEVEL | SMINIT_VERTICAL); + pShellMenu->Initialize(pCallback, (UINT) -1, 0, SMINIT_TOPLEVEL | SMINIT_VERTICAL); if (FAILED_UNEXPECTEDLY(hr)) return hr;
Removed: branches/shell-experiments/base/shell/rshell/wraplog.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/wraplog.cpp (removed) @@ -1,159 +0,0 @@ -#include "precomp.h" -#include "wraplog.h" -#include <stdio.h> - -static INT openCount = 0; -static INT callLevel; -static FILE*log; - -static INT nTemps; -static CHAR strTemp[10][256]; - -void WrapLogOpen() -{ - if (openCount == 0) - { - log = fopen("C:\RShellWrap.log", "w"); - nTemps = 0; - callLevel = 0; - } - openCount++; -} - -void WrapLogClose() -{ - openCount--; - if (openCount == 0) - { - fclose(log); - log = NULL; - } -} - -void __cdecl WrapLogPrint(_Printf_format_string_ const char* msg, ...) -{ - va_list args; - for (int i = 0; i < callLevel; i++) - fputs(" ", log); - va_start(args, msg); - vfprintf(log, msg, args); - va_end(args); - fflush(log); - nTemps = 0; -} - -void __cdecl WrapLogPre(_Printf_format_string_ const char* msg, ...) -{ - va_list args; - for (int i = 0; i < callLevel; i++) - fputs(" ", log); - fputs("pre: ", log); - va_start(args, msg); - vfprintf(log, msg, args); - va_end(args); - fflush(log); - nTemps = 0; -} - -void __cdecl WrapLogPost(_Printf_format_string_ const char* msg, ...) -{ - va_list args; - for (int i = 0; i < callLevel; i++) - fputs(" ", log); - fputs("post: ", log); - va_start(args, msg); - vfprintf(log, msg, args); - va_end(args); - fflush(log); - nTemps = 0; -} - -void __cdecl WrapLogEnter(_Printf_format_string_ const char* msg, ...) -{ - va_list args; - for (int i = 0; i < callLevel; i++) - fputs(" ", log); - fputs("CALL ", log); - va_start(args, msg); - vfprintf(log, msg, args); - va_end(args); - fflush(log); - callLevel++; - nTemps = 0; -} - -void __cdecl WrapLogExit(const char* msg, HRESULT code) -{ - //if (FAILED(code)) - // WrapLogPrint("RETURN %s = %08x\n", msg, code); - //else if (code == S_OK) - // WrapLogPrint("RETURN %s = S_OK\n", msg); - //else if (code == S_FALSE) - // WrapLogPrint("RETURN %s = S_FALSE\n", msg); - //else - // WrapLogPrint("RETURN %s = %d\n", msg, code); - if (FAILED(code)) - WrapLogPrint("RETURN %08x\n", code); - else if (code == S_OK) - WrapLogPrint("RETURN S_OK\n"); - else if (code == S_FALSE) - WrapLogPrint("RETURN S_FALSE\n"); - else - WrapLogPrint("RETURN %d\n", code); - callLevel--; -} - -template <class T> -LPSTR Wrap(const T& value); - -template <> -LPSTR Wrap<GUID>(REFGUID guid) -{ - LPSTR cStr = strTemp[nTemps++]; - StringCchPrintfA(cStr, _countof(strTemp[0]), - "{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}", - guid.Data1, guid.Data2, guid.Data3, - guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], - guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); - return cStr; -} - -template <> -LPSTR Wrap<RECT>(const RECT& rect) -{ - LPSTR cStr = strTemp[nTemps++]; - StringCchPrintfA(cStr, _countof(strTemp[0]), - "{L: %d, T: %d, R: %d, B: %d}", - rect.left, rect.top, rect.right, rect.bottom); - return cStr; -} - -template <> -LPSTR Wrap<OLECMD>(const OLECMD& cmd) -{ - LPSTR cStr = strTemp[nTemps++]; - StringCchPrintfA(cStr, _countof(strTemp[0]), - "{ID: %d, F: %d}", - cmd.cmdID, cmd.cmdf); - return cStr; -} - -template <> -LPSTR Wrap<MSG>(const MSG& msg) -{ - LPSTR cStr = strTemp[nTemps++]; - StringCchPrintfA(cStr, _countof(strTemp[0]), - "{HWND: %d, Code: %d, W: %p, L: %p, T: %d, P.X: %d, P.Y: %d}", - msg.hwnd, msg.message, msg.wParam, msg.lParam, msg.time, msg.pt.x, msg.pt.y); - return cStr; -} - -template <> -LPSTR Wrap<BANDSITEINFO>(const BANDSITEINFO& bsi) -{ - LPSTR cStr = strTemp[nTemps++]; - StringCchPrintfA(cStr, _countof(strTemp[0]), - "{dwMask: %08x, dwState: %08x, dwStyle: %08x}", - bsi.dwMask, bsi.dwState, bsi.dwStyle); - return cStr; -}
Removed: branches/shell-experiments/base/shell/rshell/wraplog.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/wraplog.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/wraplog.h (removed) @@ -1,11 +0,0 @@ -#pragma once - -void WrapLogOpen(); -void WrapLogClose(); -void __cdecl WrapLogPre(_Printf_format_string_ const char* msg, ...); -void __cdecl WrapLogPost(_Printf_format_string_ const char* msg, ...); -void __cdecl WrapLogEnter(_Printf_format_string_ const char* msg, ...); -void __cdecl WrapLogExit(const char* msg, HRESULT code); - -template <class T> -LPSTR Wrap(const T& value);