ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
324 discussions
Start a n
N
ew thread
[fireball] 24807: Partial shell32 wine-sync
by fireball@svn.reactos.org
Author: fireball Date: Thu Nov 23 19:57:58 2006 New Revision: 24807 URL:
http://svn.reactos.org/svn/reactos?rev=24807&view=rev
Log: Partial shell32 wine-sync Modified: trunk/reactos/dll/win32/shell32/autocomplete.c trunk/reactos/dll/win32/shell32/brsfolder.c trunk/reactos/dll/win32/shell32/changenotify.c trunk/reactos/dll/win32/shell32/control.c trunk/reactos/dll/win32/shell32/pidl.h trunk/reactos/dll/win32/shell32/shlview.c Modified: trunk/reactos/dll/win32/shell32/autocomplete.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/autocomp…
============================================================================== --- trunk/reactos/dll/win32/shell32/autocomplete.c (original) +++ trunk/reactos/dll/win32/shell32/autocomplete.c Thu Nov 23 19:57:58 2006 @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ /* @@ -174,7 +174,7 @@ IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - TRACE("(%p)->(%lu)\n", This, refCount - 1); + TRACE("(%p)->(%u)\n", This, refCount - 1); return refCount; } @@ -188,7 +188,7 @@ IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); - TRACE("(%p)->(%lu)\n", This, refCount + 1); + TRACE("(%p)->(%u)\n", This, refCount + 1); if (!refCount) { TRACE(" destroying IAutoComplete(%p)\n",This); @@ -347,7 +347,7 @@ { IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); - TRACE ("(%p)->(count=%lu)\n", This, This->ref); + TRACE ("(%p)->(count=%u)\n", This, This->ref); return IAutoComplete2_AddRef((IAutoComplete*)This); } @@ -360,7 +360,7 @@ { IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); - TRACE ("(%p)->(count=%lu)\n", This, This->ref); + TRACE ("(%p)->(count=%u)\n", This, This->ref); return IAutoComplete_Release((IAutoComplete*)This); } @@ -425,7 +425,7 @@ IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); - TRACE("(%p) -> (0x%lx)\n", This, dwFlag); + TRACE("(%p) -> (0x%x)\n", This, dwFlag); This->options = dwFlag; Modified: trunk/reactos/dll/win32/shell32/brsfolder.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/brsfolde…
============================================================================== --- trunk/reactos/dll/win32/shell32/brsfolder.c (original) +++ trunk/reactos/dll/win32/shell32/brsfolder.c Thu Nov 23 19:57:58 2006 @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * FIXME: * - many memory leaks @@ -64,7 +64,7 @@ static HTREEITEM InsertTreeViewItem( browse_info*, IShellFolder *, LPCITEMIDLIST, LPCITEMIDLIST, IEnumIDList*, HTREEITEM); -const WCHAR szBrowseFolderInfo[] = { +static const WCHAR szBrowseFolderInfo[] = { '_','_','W','I','N','E','_', 'B','R','S','F','O','L','D','E','R','D','L','G','_', 'I','N','F','O',0 @@ -108,7 +108,7 @@ Shell_GetImageList(NULL, &hImageList); if (hImageList) - TreeView_SetImageList( info->hwndTreeView, hImageList, 0 ); + SendMessageW( info->hwndTreeView, TVM_SETIMAGELIST, 0, (LPARAM)hImageList ); /* We want to call InsertTreeViewItem down the code, in order to insert * the root item of the treeview. Due to InsertTreeViewItem's signature, @@ -132,7 +132,7 @@ IShellFolder *lpsfDesktop; hr = SHGetDesktopFolder(&lpsfDesktop); if (!SUCCEEDED(hr)) { - WARN("SHGetDesktopFolder failed! hr = %08lx\n", hr); + WARN("SHGetDesktopFolder failed! hr = %08x\n", hr); return; } hr = IShellFolder_BindToObject(lpsfDesktop, pidlParent, 0, &IID_IShellFolder, (LPVOID*)&lpsfParent); @@ -140,7 +140,7 @@ } if (!SUCCEEDED(hr)) { - WARN("Could not bind to parent shell folder! hr = %08lx\n", hr); + WARN("Could not bind to parent shell folder! hr = %08x\n", hr); return; } @@ -152,7 +152,7 @@ } if (!SUCCEEDED(hr)) { - WARN("Could not bind to root shell folder! hr = %08lx\n", hr); + WARN("Could not bind to root shell folder! hr = %08x\n", hr); IShellFolder_Release(lpsfParent); return; } @@ -160,16 +160,16 @@ flags = BrowseFlagsToSHCONTF( info->lpBrowseInfo->ulFlags ); hr = IShellFolder_EnumObjects( lpsfRoot, info->hWnd, flags, &pEnumChildren ); if (!SUCCEEDED(hr)) { - WARN("Could not get child iterator! hr = %08lx\n", hr); + WARN("Could not get child iterator! hr = %08x\n", hr); IShellFolder_Release(lpsfParent); IShellFolder_Release(lpsfRoot); return; } - TreeView_DeleteAllItems( info->hwndTreeView ); + SendMessageW( info->hwndTreeView, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT ); item = InsertTreeViewItem( info, lpsfParent, pidlChild, pidlParent, pEnumChildren, TVI_ROOT ); - TreeView_Expand( info->hwndTreeView, item, TVE_EXPAND ); + SendMessageW( info->hwndTreeView, TVM_EXPAND, TVE_EXPAND, (LPARAM)item ); IShellFolder_Release(lpsfRoot); IShellFolder_Release(lpsfParent); @@ -225,14 +225,9 @@ BOOL bSuccess=TRUE; STRRET str; - TRACE("%p %p %lx %p\n", lpsf, lpi, dwFlags, lpFriendlyName); + TRACE("%p %p %x %p\n", lpsf, lpi, dwFlags, lpFriendlyName); if (SUCCEEDED(IShellFolder_GetDisplayNameOf(lpsf, lpi, dwFlags, &str))) - { - if (FAILED(StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi))) - { - bSuccess = FALSE; - } - } + bSuccess = StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi); else bSuccess = FALSE; @@ -359,9 +354,7 @@ done: ReleaseCapture(); SetCursor(LoadCursorW(0, (LPWSTR)IDC_ARROW)); - - if (pidlTemp) - SHFree(pidlTemp); + SHFree(pidlTemp); } static inline BOOL PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type) @@ -445,7 +438,8 @@ /* My Computer is already sorted and trying to do a simple text * sort will only mess things up */ if (!_ILIsMyComputer(lptvid->lpi)) - TreeView_SortChildren(info->hwndTreeView, pnmtv->itemNew.hItem, FALSE); + SendMessageW( info->hwndTreeView, TVM_SORTCHILDREN, + FALSE, (LPARAM)pnmtv->itemNew.hItem ); return 0; } @@ -544,6 +538,112 @@ return FALSE; } +static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection, + BOOL is_str, HTREEITEM *pItem) +{ + LPITEMIDLIST pidlSelection = (LPITEMIDLIST)selection; + LPCITEMIDLIST pidlCurrent, pidlRoot; + TVITEMEXW item; + BOOL bResult = FALSE; + + /* If 'selection' is a string, convert to a Shell ID List. */ + if (is_str) { + IShellFolder *psfDesktop; + HRESULT hr; + + hr = SHGetDesktopFolder(&psfDesktop); + if (FAILED(hr)) + goto done; + + hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, + (LPOLESTR)selection, NULL, &pidlSelection, NULL); + IShellFolder_Release(psfDesktop); + if (FAILED(hr)) + goto done; + } + + /* Move pidlCurrent behind the SHITEMIDs in pidlSelection, which are the root of + * the sub-tree currently displayed. */ + pidlRoot = info->lpBrowseInfo->pidlRoot; + pidlCurrent = pidlSelection; + while (!_ILIsEmpty(pidlRoot) && _ILIsEqualSimple(pidlRoot, pidlCurrent)) { + pidlRoot = ILGetNext(pidlRoot); + pidlCurrent = ILGetNext(pidlCurrent); + } + + /* The given ID List is not part of the SHBrowseForFolder's current sub-tree. */ + if (!_ILIsEmpty(pidlRoot)) + goto done; + + /* Initialize item to point to the first child of the root folder. */ + memset(&item, 0, sizeof(item)); + item.mask = TVIF_PARAM; + item.hItem = TreeView_GetRoot(info->hwndTreeView); + if (item.hItem) + item.hItem = TreeView_GetChild(info->hwndTreeView, item.hItem); + + /* Walk the tree along the nodes corresponding to the remaining ITEMIDLIST */ + while (item.hItem && !_ILIsEmpty(pidlCurrent)) { + LPTV_ITEMDATA pItemData; + + SendMessageW(info->hwndTreeView, TVM_GETITEMW, 0, (LPARAM)&item); + pItemData = (LPTV_ITEMDATA)item.lParam; + + if (_ILIsEqualSimple(pItemData->lpi, pidlCurrent)) { + pidlCurrent = ILGetNext(pidlCurrent); + if (!_ILIsEmpty(pidlCurrent)) { + /* Only expand current node and move on to it's first child, + * if we didn't already reach the last SHITEMID */ + SendMessageW(info->hwndTreeView, TVM_EXPAND, TVE_EXPAND, (LPARAM)item.hItem); + item.hItem = TreeView_GetChild(info->hwndTreeView, item.hItem); + } + } else { + item.hItem = TreeView_GetNextSibling(info->hwndTreeView, item.hItem); + } + } + + if (_ILIsEmpty(pidlCurrent) && item.hItem) + bResult = TRUE; + +done: + if (pidlSelection && pidlSelection != (LPITEMIDLIST)selection) + ILFree(pidlSelection); + + if (pItem) + *pItem = item.hItem; + + return bResult; +} + +static BOOL BrsFolder_OnSetSelectionW(browse_info *info, LPVOID selection, BOOL is_str) { + HTREEITEM hItem; + BOOL bResult; + + bResult = BrsFolder_OnSetExpanded(info, selection, is_str, &hItem); + if (bResult) + SendMessageW(info->hwndTreeView, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem ); + return bResult; +} + +static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL is_str) { + LPWSTR selectionW = NULL; + BOOL result = FALSE; + int length; + + if (!is_str) + return BrsFolder_OnSetSelectionW(info, selection, is_str); + + if ((length = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)selection, -1, NULL, 0)) && + (selectionW = HeapAlloc(GetProcessHeap(), 0, length * sizeof(WCHAR))) && + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)selection, -1, selectionW, length)) + { + result = BrsFolder_OnSetSelectionW(info, selectionW, is_str); + } + + HeapFree(GetProcessHeap(), 0, selectionW); + return result; +} + /************************************************************************* * BrsFolderDlgProc32 (not an exported API function) */ @@ -588,25 +688,13 @@ break; case BFFM_SETSELECTIONA: - if (wParam) - FIXME("Set selection %s\n", debugstr_a((LPSTR)lParam)); - else - FIXME("Set selection %p\n", (void*)lParam); - break; + return BrsFolder_OnSetSelectionA(info, (LPVOID)lParam, (BOOL)wParam); case BFFM_SETSELECTIONW: - if (wParam) - FIXME("Set selection %s\n", debugstr_w((LPWSTR)lParam)); - else - FIXME("Set selection %p\n", (void*)lParam); - break; + return BrsFolder_OnSetSelectionW(info, (LPVOID)lParam, (BOOL)wParam); case BFFM_SETEXPANDED: /* unicode only */ - if (wParam) - FIXME("Set expanded %s\n", debugstr_w((LPWSTR)lParam)); - else - FIXME("Set expanded %p\n", (void*)lParam); - break; + return BrsFolder_OnSetExpanded(info, (LPVOID)lParam, (BOOL)wParam, NULL); } return FALSE; } @@ -623,7 +711,8 @@ BROWSEINFOW bi; LPITEMIDLIST lpid; INT len; - + LPWSTR title; + TRACE("%p\n", lpbi); bi.hwndOwner = lpbi->hwndOwner; @@ -639,12 +728,13 @@ if (lpbi->lpszTitle) { len = MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, NULL, 0 ); - bi.lpszTitle = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, (LPWSTR)bi.lpszTitle, len ); + title = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, title, len ); } else - bi.lpszTitle = NULL; - + title = NULL; + + bi.lpszTitle = title; bi.ulFlags = lpbi->ulFlags; bi.lpfn = lpbi->lpfn; bi.lParam = lpbi->lParam; @@ -656,7 +746,7 @@ lpbi->pszDisplayName, MAX_PATH, 0, NULL); HeapFree( GetProcessHeap(), 0, bi.pszDisplayName ); } - HeapFree(GetProcessHeap(), 0, (LPVOID)bi.lpszTitle); + HeapFree(GetProcessHeap(), 0, title); lpbi->iImage = bi.iImage; return lpid; } Modified: trunk/reactos/dll/win32/shell32/changenotify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/changeno…
============================================================================== --- trunk/reactos/dll/win32/shell32/changenotify.c (original) +++ trunk/reactos/dll/win32/shell32/changenotify.c Thu Nov 23 19:57:58 2006 @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include <stdarg.h> @@ -178,6 +178,8 @@ DeleteNode( head ); LeaveCriticalSection(&SHELL32_ChangenotifyCS); + + DeleteCriticalSection(&SHELL32_ChangenotifyCS); } /************************************************************************* @@ -198,7 +200,7 @@ item = SHAlloc(sizeof(NOTIFICATIONLIST)); - TRACE("(%p,0x%08x,0x%08lx,0x%08x,%d,%p) item=%p\n", + TRACE("(%p,0x%08x,0x%08x,0x%08x,%d,%p) item=%p\n", hwnd, fSources, wEventMask, uMsg, cItems, lpItems, item); item->next = NULL; @@ -234,7 +236,7 @@ { LPNOTIFICATIONLIST node; - TRACE("(0x%08lx)\n", hNotify); + TRACE("(0x%08x)\n", hNotify); EnterCriticalSection(&SHELL32_ChangenotifyCS); @@ -253,7 +255,7 @@ BOOL WINAPI SHChangeNotifyUpdateEntryList(DWORD unknown1, DWORD unknown2, DWORD unknown3, DWORD unknown4) { - FIXME("(0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx)\n", + FIXME("(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", unknown1, unknown2, unknown3, unknown4); return -1; @@ -283,7 +285,7 @@ Pidls[0] = NULL; Pidls[1] = NULL; - TRACE("(0x%08lx,0x%08x,%p,%p):stub.\n", wEventId, uFlags, dwItem1, dwItem2); + TRACE("(0x%08x,0x%08x,%p,%p):stub.\n", wEventId, uFlags, dwItem1, dwItem2); if( ( wEventId & SHCNE_NOITEMEVENTS ) && ( dwItem1 || dwItem2 ) ) { @@ -339,10 +341,10 @@ WCHAR path[MAX_PATH]; if( Pidls[0] && SHGetPathFromIDListW(Pidls[0], path )) - TRACE("notify %08lx on item1 = %s\n", wEventId, debugstr_w(path)); + TRACE("notify %08x on item1 = %s\n", wEventId, debugstr_w(path)); if( Pidls[1] && SHGetPathFromIDListW(Pidls[1], path )) - TRACE("notify %08lx on item2 = %s\n", wEventId, debugstr_w(path)); + TRACE("notify %08x on item2 = %s\n", wEventId, debugstr_w(path)); } EnterCriticalSection(&SHELL32_ChangenotifyCS); @@ -380,7 +382,7 @@ ptr->pidlSignaled = ILClone(Pidls[0]); - TRACE("notifying %s, event %s(%lx) before\n", NodeName( ptr ), DumpEvent( + TRACE("notifying %s, event %s(%x) before\n", NodeName( ptr ), DumpEvent( wEventId ),wEventId ); ptr->wSignalledEvent |= wEventId; @@ -390,7 +392,7 @@ else SendMessageA(ptr->hwnd, ptr->uMsg, (WPARAM)Pidls, wEventId); - TRACE("notifying %s, event %s(%lx) after\n", NodeName( ptr ), DumpEvent( + TRACE("notifying %s, event %s(%x) after\n", NodeName( ptr ), DumpEvent( wEventId ),wEventId ); } @@ -400,8 +402,8 @@ /* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */ if ((typeFlag & SHCNF_PATHA) || (typeFlag & SHCNF_PRINTERA)) { - if (Pidls[0]) SHFree((LPITEMIDLIST)Pidls[0]); - if (Pidls[1]) SHFree((LPITEMIDLIST)Pidls[1]); + SHFree((LPITEMIDLIST)Pidls[0]); + SHFree((LPITEMIDLIST)Pidls[1]); } } @@ -419,7 +421,7 @@ int count, SHChangeNotifyEntry *idlist) { - FIXME("(%p,0x%08lx,0x%08lx,0x%08lx,0x%08x,%p):semi stub.\n", + FIXME("(%p,0x%08x,0x%08x,0x%08x,0x%08x,%p):semi stub.\n", hwnd,events1,events2,msg,count,idlist); return (DWORD) SHChangeNotifyRegister(hwnd, events1, events2, msg, count, idlist); @@ -438,7 +440,7 @@ LPNOTIFICATIONLIST node; LPCITEMIDLIST *idlist; - TRACE("%p %08lx %p %p\n", hChange, dwProcessId, lppidls, lpwEventId); + TRACE("%p %08x %p %p\n", hChange, dwProcessId, lppidls, lpwEventId); /* EnterCriticalSection(&SHELL32_ChangenotifyCS); */ @@ -474,7 +476,7 @@ */ DWORD WINAPI NTSHChangeNotifyDeregister(ULONG x1) { - FIXME("(0x%08lx):semi stub.\n",x1); + FIXME("(0x%08x):semi stub.\n",x1); return SHChangeNotifyDeregister( x1 ); } Modified: trunk/reactos/dll/win32/shell32/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/control.…
============================================================================== --- trunk/reactos/dll/win32/shell32/control.c (original) +++ trunk/reactos/dll/win32/shell32/control.c Thu Nov 23 19:57:58 2006 @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include <assert.h> @@ -163,7 +163,7 @@ #define YICON 32 #define YSTEP 64 -static BOOL Control_Localize(const CPanel* panel, unsigned cx, unsigned cy, +static BOOL Control_Localize(const CPanel* panel, int cx, int cy, CPlApplet** papplet, unsigned* psp) { unsigned i, x = (XSTEP-XICON)/2, y = 0; @@ -228,7 +228,7 @@ unsigned i; CPlApplet* applet; - if (Control_Localize(panel, LOWORD(lParam), HIWORD(lParam), &applet, &i)) { + if (Control_Localize(panel, (short)LOWORD(lParam), (short)HIWORD(lParam), &applet, &i)) { if (up) { if (panel->clkApplet == applet && panel->clkSP == i) { applet->proc(applet->hWnd, CPL_DBLCLK, i, applet->info[i].lData); @@ -352,7 +352,6 @@ unsigned sp = 0; LPWSTR extraPmts = NULL; int quoted = 0; - BOOL spSet = FALSE; buffer = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(wszCmd) + 1) * sizeof(*wszCmd)); if (!buffer) return; @@ -367,10 +366,8 @@ if (beg) { if (*beg == '@') { sp = atoiW(beg + 1); - spSet = TRUE; } else if (*beg == '\0') { sp = 0; - spSet = TRUE; } else { extraPmts = beg; } @@ -384,9 +381,6 @@ while ((ptr = StrChrW(buffer, '"'))) memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR)); - while ((ptr = StrChrW(extraPmts, '"'))) - memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR)); - TRACE("cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp); Control_LoadApplet(hWnd, buffer, panel); @@ -399,13 +393,6 @@ WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count); sp = 0; } - - if ((extraPmts)&&(!spSet)) - { - while ((lstrcmpiW(extraPmts, applet->info[sp].szName)) && (sp < applet->count)) - sp++; - } - if (applet->info[sp].dwSize) { if (!applet->proc(applet->hWnd, CPL_STARTWPARMSA, sp, (LPARAM)extraPmts)) applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].lData); @@ -423,7 +410,7 @@ { CPanel panel; - TRACE("(%p, %p, %s, 0x%08lx)\n", + TRACE("(%p, %p, %s, 0x%08x)\n", hWnd, hInst, debugstr_w(cmd), nCmdShow); memset(&panel, 0, sizeof(panel)); @@ -456,7 +443,7 @@ */ HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x) { - FIXME("%p %p 0x%08lx 0x%08lx stub\n", hWnd, hModule, w, x); + FIXME("%p %p 0x%08x 0x%08x stub\n", hWnd, hModule, w, x); return 0; } @@ -481,7 +468,7 @@ WORD args[5]; SEGPTR cmdline_seg; - TRACE( "proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n", + TRACE( "proc %x hwnd %p inst %p cmdline %s cmdshow %d\n", proc, hwnd, inst, debugstr_a(cmdline), cmdshow ); cmdline_seg = MapLS( cmdline ); @@ -507,6 +494,6 @@ */ DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6) { - FIXME("(%p, %p, %08lx, %08lx, %08lx, %08lx): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6); + FIXME("(%p, %p, %08x, %08x, %08x, %08x): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6); return 0x0deadbee; } Modified: trunk/reactos/dll/win32/shell32/pidl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.h?r…
============================================================================== --- trunk/reactos/dll/win32/shell32/pidl.h (original) +++ trunk/reactos/dll/win32/shell32/pidl.h Thu Nov 23 19:57:58 2006 @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTES: * @@ -209,6 +209,14 @@ BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl); BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl); BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl); +static inline +BOOL _ILIsEqualSimple (LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB) +{ + return (pidlA->mkid.cb > 0 && !memcmp(pidlA, pidlB, pidlA->mkid.cb)) || + (!pidlA->mkid.cb && !pidlB->mkid.cb); +} +static inline +BOOL _ILIsEmpty (LPCITEMIDLIST pidl) { return _ILIsDesktop(pidl); } /* * simple pidls @@ -240,6 +248,7 @@ /* Other helpers */ LPITEMIDLIST _ILCreateMyComputer (void); +LPITEMIDLIST _ILCreateMyDocuments (void); LPITEMIDLIST _ILCreateIExplore (void); LPITEMIDLIST _ILCreateControlPanel (void); LPITEMIDLIST _ILCreatePrinters (void); Modified: trunk/reactos/dll/win32/shell32/shlview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlview.c (original) +++ trunk/reactos/dll/win32/shell32/shlview.c Thu Nov 23 19:57:58 2006 @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * FIXME: The order by part of the background context menu should be * buily according to the columns shown. @@ -146,7 +146,7 @@ #define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501) #define IDM_MYFILEITEM (FCIDM_SHVIEWFIRST + 0x502) -#define ID_LISTVIEW 2000 +#define ID_LISTVIEW 1 #define SHV_CHANGE_NOTIFY WM_USER + 0x1111 @@ -156,7 +156,7 @@ #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp) /* - Items merged into the toolbar and and the filemenu + Items merged into the toolbar and the filemenu */ typedef struct { int idCommand; @@ -167,7 +167,7 @@ BYTE bStyle; } MYTOOLINFO, *LPMYTOOLINFO; -MYTOOLINFO Tools[] = +static const MYTOOLINFO Tools[] = { { FCIDM_SHVIEW_BIGICON, 0, 0, IDS_VIEW_LARGE, TBSTATE_ENABLED, BTNS_BUTTON }, { FCIDM_SHVIEW_SMALLICON, 0, 0, IDS_VIEW_SMALL, TBSTATE_ENABLED, BTNS_BUTTON }, @@ -222,7 +222,7 @@ { TRACE("ICommDlgBrowser::IncludeObject pidl=%p\n", pidl); ret = ICommDlgBrowser_IncludeObject(This->pCommDlgBrowser, (IShellView*)This, pidl); - TRACE("--0x%08lx\n", ret); + TRACE("--0x%08x\n", ret); } return ret; } @@ -235,7 +235,7 @@ { TRACE("ICommDlgBrowser::OnDefaultCommand\n"); ret = ICommDlgBrowser_OnDefaultCommand(This->pCommDlgBrowser, (IShellView*)This); - TRACE("-- returns %08lx\n", ret); + TRACE("-- returns %08x\n", ret); } return ret; } @@ -342,12 +342,17 @@ This->ListViewSortInfo.nLastHeaderID = -1; if (This->FolderSettings.fFlags & FWF_DESKTOP) { - if (0) /* FIXME: look into registry vale HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ListviewShadow and activate drop shadows */ - ListView_SetTextBkColor(This->hWndList, CLR_NONE); + /* + * FIXME: look at the registry value + * HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ListviewShadow + * and activate drop shadows if necessary + */ + if (0) + SendMessageW(This->hWndList, LVM_SETTEXTBKCOLOR, 0, CLR_NONE); else - ListView_SetTextBkColor(This->hWndList, GetSysColor(COLOR_DESKTOP)); - - ListView_SetTextColor(This->hWndList, RGB(255,255,255)); + SendMessageW(This->hWndList, LVM_SETTEXTBKCOLOR, 0, GetSysColor(COLOR_DESKTOP)); + + SendMessageW(This->hWndList, LVM_SETTEXTCOLOR, 0, RGB(255,255,255)); } /* UpdateShellSettings(); */ @@ -361,14 +366,14 @@ */ static BOOL ShellView_InitList(IShellViewImpl * This) { - LVCOLUMNA lvColumn; + LVCOLUMNW lvColumn; SHELLDETAILS sd; int i; - char szTemp[50]; + WCHAR szTemp[50]; TRACE("%p\n",This); - ListView_DeleteAllItems(This->hWndList); + SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0); lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; lvColumn.pszText = szTemp; @@ -381,8 +386,8 @@ break; lvColumn.fmt = sd.fmt; lvColumn.cx = sd.cxChar*8; /* chars->pixel */ - StrRetToStrNA( szTemp, 50, &sd.str, NULL); - ListView_InsertColumnA(This->hWndList, i, &lvColumn); + StrRetToStrNW( szTemp, 50, &sd.str, NULL); + SendMessageW(This->hWndList, LVM_INSERTCOLUMNW, i, (LPARAM) &lvColumn); } } else @@ -390,8 +395,8 @@ FIXME("no SF2\n"); } - ListView_SetImageList(This->hWndList, ShellSmallIconList, LVSIL_SMALL); - ListView_SetImageList(This->hWndList, ShellBigIconList, LVSIL_NORMAL); + SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList); + SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList); return TRUE; } @@ -522,9 +527,11 @@ LPCITEMIDLIST pidl) { LVITEMA lvItem; - ZeroMemory(&lvItem, sizeof(LVITEMA)); + lvItem.iSubItem = 0; lvItem.mask = LVIF_PARAM; - for(lvItem.iItem = 0; ListView_GetItemA(This->hWndList, &lvItem); lvItem.iItem++) + for(lvItem.iItem = 0; + SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem); + lvItem.iItem++) { LPITEMIDLIST currentpidl = (LPITEMIDLIST) lvItem.lParam; HRESULT hr = IShellFolder_CompareIDs(This->pSFParent, 0, pidl, currentpidl); @@ -545,9 +552,9 @@ TRACE("(%p)(pidl=%p)\n", This, pidl); - ZeroMemory(&lvItem, sizeof(lvItem)); /* create the listview item*/ lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; /*set the mask*/ lvItem.iItem = ListView_GetItemCount(This->hWndList); /*add the item to the end of the list*/ + lvItem.iSubItem = 0; lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidl)); /*set the item's data*/ lvItem.pszText = LPSTR_TEXTCALLBACKA; /*get text on a callback basis*/ lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/ @@ -580,17 +587,16 @@ nItem = LV_FindItemByPidl(This, ILFindLastID(pidlOld)); if ( -1 != nItem ) { - ZeroMemory(&lvItem, sizeof(lvItem)); /* create the listview item*/ lvItem.mask = LVIF_PARAM; /* only the pidl */ lvItem.iItem = nItem; - ListView_GetItemA(This->hWndList, &lvItem); + SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem); SHFree((LPITEMIDLIST)lvItem.lParam); lvItem.mask = LVIF_PARAM; lvItem.iItem = nItem; lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidlNew)); /* set the item's data */ - ListView_SetItemA(This->hWndList, &lvItem); - ListView_Update(This->hWndList, nItem); + SendMessageA(This->hWndList, LVM_SETITEMA, 0, (LPARAM) &lvItem); + SendMessageA(This->hWndList, LVM_UPDATE, nItem, 0); return TRUE; /* FIXME: better handling */ } return FALSE; @@ -772,19 +778,21 @@ */ static void ShellView_MergeViewMenu(IShellViewImpl * This, HMENU hSubMenu) -{ MENUITEMINFOA mii; - +{ TRACE("(%p)->(submenu=%p)\n",This,hSubMenu); if(hSubMenu) { /*add a separator at the correct position in the menu*/ + MENUITEMINFOA mii; + static char view[] = "View"; + _InsertMenuItem(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); ZeroMemory(&mii, sizeof(mii)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA; mii.fType = MFT_STRING; - mii.dwTypeData = "View"; + mii.dwTypeData = view; mii.hSubMenu = LoadMenuA(shell32_hInstance, "MENU_001"); InsertMenuItemA(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii); } @@ -803,10 +811,7 @@ LVITEMA lvItem; UINT i = 0; - if (This->apidl) - { - SHFree(This->apidl); - } + SHFree(This->apidl); This->cidl = ListView_GetSelectedCount(This->hWndList); This->apidl = (LPITEMIDLIST*)SHAlloc(This->cidl * sizeof(LPITEMIDLIST)); @@ -817,9 +822,10 @@ { TRACE("-- Items selected =%u\n", This->cidl); - ZeroMemory(&lvItem, sizeof(lvItem)); lvItem.mask = LVIF_STATE | LVIF_PARAM; lvItem.stateMask = LVIS_SELECTED; + lvItem.iItem = 0; + lvItem.iSubItem = 0; while(ListView_GetItemA(This->hWndList, &lvItem) && (i < This->cidl)) { @@ -1191,7 +1197,7 @@ */ static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dwCmd, HWND hwndCmd) { - TRACE("(%p)->(0x%08lx 0x%08lx %p) stub\n",This, dwCmdID, dwCmd, hwndCmd); + TRACE("(%p)->(0x%08x 0x%08x %p) stub\n",This, dwCmdID, dwCmd, hwndCmd); switch(dwCmdID) { @@ -1227,11 +1233,11 @@ This->ListViewSortInfo.nHeaderID = (LPARAM) (dwCmdID - 0x30); This->ListViewSortInfo.bIsAscending = TRUE; This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID; - ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo))); + SendMessageA(This->hWndList, LVM_SORTITEMS, (WPARAM) &This->ListViewSortInfo, (LPARAM)ShellView_ListViewCompareItems); break; default: - TRACE("-- COMMAND 0x%04lx unhandled\n", dwCmdID); + TRACE("-- COMMAND 0x%04x unhandled\n", dwCmdID); } return 0; } @@ -1323,7 +1329,7 @@ } This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID; - ListView_SortItems(lpnmlv->hdr.hwndFrom, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo))); + SendMessageA(lpnmlv->hdr.hwndFrom, LVM_SORTITEMS, (WPARAM) &This->ListViewSortInfo, (LPARAM)ShellView_ListViewCompareItems); break; case LVN_GETDISPINFOA: @@ -1420,10 +1426,10 @@ WCHAR wszNewName[MAX_PATH]; LVITEMA lvItem; - ZeroMemory(&lvItem, sizeof(LVITEMA)); lvItem.iItem = lpdi->item.iItem; + lvItem.iSubItem = 0; lvItem.mask = LVIF_PARAM; - ListView_GetItemA(This->hWndList, &lvItem); + SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem); pidl = (LPITEMIDLIST)lpdi->item.lParam; if (!MultiByteToWideChar( CP_ACP, 0, lpdi->item.pszText, -1, wszNewName, MAX_PATH )) @@ -1434,7 +1440,7 @@ { lvItem.mask = LVIF_PARAM; lvItem.lParam = (LPARAM)pidl; - ListView_SetItemA(This->hWndList, &lvItem); + SendMessageA(This->hWndList, LVM_SETITEMA, 0, (LPARAM) &lvItem); return TRUE; } } @@ -1466,8 +1472,8 @@ i = ListView_GetNextItem(This->hWndList, -1, LVNI_SELECTED); - ListView_EnsureVisible(This->hWndList, i, 0); - ListView_EditLabelA(This->hWndList, i); + SendMessageW(This->hWndList, LVM_ENSUREVISIBLE, i, 0); + SendMessageW(This->hWndList, LVM_EDITLABELW, i, 0); } } #if 0 @@ -1503,8 +1509,8 @@ item_index = ListView_GetNextItem(This->hWndList, item_index, LVNI_SELECTED); item.iItem = item_index; - item.mask |= LVIF_PARAM; - ListView_GetItemA(This->hWndList, &item); + item.mask = LVIF_PARAM; + SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &item); /* get item pidl */ pItems[i] = (LPITEMIDLIST)item.lParam; @@ -1544,7 +1550,7 @@ static LRESULT ShellView_OnChange(IShellViewImpl * This, LPITEMIDLIST * Pidls, LONG wEventId) { - TRACE("(%p)(%p,%p,0x%08lx)\n", This, Pidls[0], Pidls[1], wEventId); + TRACE("(%p)(%p,%p,0x%08x)\n", This, Pidls[0], Pidls[1], wEventId); switch(wEventId) { case SHCNE_MKDIR: @@ -1678,7 +1684,7 @@ IShellViewImpl *This = (IShellViewImpl *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - TRACE("(%p)->(count=%lu)\n", This, refCount - 1); + TRACE("(%p)->(count=%u)\n", This, refCount - 1); return refCount; } @@ -1690,7 +1696,7 @@ IShellViewImpl *This = (IShellViewImpl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); - TRACE("(%p)->(count=%li)\n", This, refCount + 1); + TRACE("(%p)->(count=%i)\n", This, refCount + 1); if (!refCount) { @@ -1704,8 +1710,7 @@ if(This->pSF2Parent) IShellFolder2_Release(This->pSF2Parent); - if(This->apidl) - SHFree(This->apidl); + SHFree(This->apidl); if(This->pAdvSink) IAdviseSink_Release(This->pAdvSink); @@ -1749,7 +1754,7 @@ #if 0 IShellViewImpl *This = (IShellViewImpl *)iface; - FIXME("(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",This,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam); + FIXME("(%p)->(%p: hwnd=%x msg=%x lp=%x wp=%x) stub\n",This,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam); #endif if ((lpmsg->message>=WM_KEYFIRST) && (lpmsg->message>=WM_KEYLAST)) @@ -1817,7 +1822,7 @@ TRACE("(%p)\n",This); - ListView_DeleteAllItems(This->hWndList); + SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0); ShellView_FillList(This); return S_OK; @@ -1838,7 +1843,7 @@ TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n",This, lpPrevView,lpfs, psb, prcView, phWnd); - TRACE("-- vmode=%x flags=%x left=%li top=%li right=%li bottom=%li\n",lpfs->ViewMode, lpfs->fFlags ,prcView->left,prcView->top, prcView->right, prcView->bottom); + TRACE("-- vmode=%x flags=%x left=%i top=%i right=%i bottom=%i\n",lpfs->ViewMode, lpfs->fFlags ,prcView->left,prcView->top, prcView->right, prcView->bottom); /*set up the member variables*/ This->pShellBrowser = psb; @@ -1878,7 +1883,7 @@ *phWnd = CreateWindowExA(0, SV_CLASS_NAME, NULL, - WS_CHILD | WS_VISIBLE | WS_TABSTOP, + WS_CHILD | WS_TABSTOP, prcView->left, prcView->top, prcView->right - prcView->left, @@ -1892,6 +1897,9 @@ if(!*phWnd) return E_FAIL; + SetWindowPos(*phWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); + UpdateWindow(*phWnd); + return S_OK; } @@ -1965,13 +1973,14 @@ LVITEMA lvItem; if(uFlags & SVSI_ENSUREVISIBLE) - ListView_EnsureVisible(This->hWndList, i, 0); - - ZeroMemory(&lvItem, sizeof(LVITEMA)); + SendMessageW(This->hWndList, LVM_ENSUREVISIBLE, i, 0); + lvItem.mask = LVIF_STATE; + lvItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED; lvItem.iItem = 0; - - while(ListView_GetItemA(This->hWndList, &lvItem)) + lvItem.iSubItem = 0; + + while(SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem)) { if (lvItem.iItem == i) { @@ -1988,13 +1997,13 @@ if (uFlags & SVSI_DESELECTOTHERS) lvItem.state &= ~LVIS_SELECTED; } - ListView_SetItemA(This->hWndList, &lvItem); + SendMessageA(This->hWndList, LVM_SETITEMA, 0, (LPARAM) &lvItem); lvItem.iItem++; } if(uFlags & SVSI_EDIT) - ListView_EditLabelA(This->hWndList, i); + SendMessageW(This->hWndList, LVM_EDITLABELW, i, 0); } return S_OK; @@ -2095,14 +2104,14 @@ UINT i; IShellViewImpl *This = impl_from_IOleCommandTarget(iface); - FIXME("(%p)->(%p(%s) 0x%08lx %p %p\n", + FIXME("(%p)->(%p(%s) 0x%08x %p %p\n", This, pguidCmdGroup, debugstr_guid(pguidCmdGroup), cCmds, prgCmds, pCmdText); if (!prgCmds) return E_POINTER; for (i = 0; i < cCmds; i++) { - FIXME("\tprgCmds[%d].cmdID = %ld\n", i, prgCmds[i].cmdID); + FIXME("\tprgCmds[%d].cmdID = %d\n", i, prgCmds[i].cmdID); prgCmds[i].cmdf = 0; } return OLECMDERR_E_UNKNOWNGROUP; @@ -2123,7 +2132,7 @@ { IShellViewImpl *This = impl_from_IOleCommandTarget(iface); - FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08lx Opt:0x%08lx %p %p)\n", + FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08x Opt:0x%08x %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, pvaIn, pvaOut); if (IsEqualIID(pguidCmdGroup, &CGID_Explorer) && @@ -2167,7 +2176,7 @@ { IShellViewImpl *This = impl_from_IDropTarget(iface); - TRACE("(%p)->(count=%lu)\n",This,This->ref); + TRACE("(%p)->(count=%u)\n",This,This->ref); return IShellFolder_AddRef((IShellFolder*)This); } @@ -2176,7 +2185,7 @@ { IShellViewImpl *This = impl_from_IDropTarget(iface); - TRACE("(%p)->(count=%lu)\n",This,This->ref); + TRACE("(%p)->(count=%u)\n",This,This->ref); return IShellFolder_Release((IShellFolder*)This); } @@ -2249,10 +2258,10 @@ } else { /* Query the relative PIDL of the shellfolder object represented by the currently * dragged over listview-item ... */ - ZeroMemory(&lvItem, sizeof(lvItem)); lvItem.mask = LVIF_PARAM; lvItem.iItem = lResult; - ListView_GetItemA(This->hWndList, &lvItem); + lvItem.iSubItem = 0; + SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem); /* ... and bind pCurDropTarget to the IDropTarget interface of an UIObject of this object */ hr = IShellFolder_GetUIObjectOf(This->pSFParent, This->hWndList, 1, @@ -2347,7 +2356,7 @@ { IShellViewImpl *This = impl_from_IDropSource(iface); - TRACE("(%p)->(count=%lu)\n",This,This->ref); + TRACE("(%p)->(count=%u)\n",This,This->ref); return IShellFolder_AddRef((IShellFolder*)This); } @@ -2356,7 +2365,7 @@ { IShellViewImpl *This = impl_from_IDropSource(iface); - TRACE("(%p)->(count=%lu)\n",This,This->ref); + TRACE("(%p)->(count=%u)\n",This,This->ref); return IShellFolder_Release((IShellFolder*)This); } @@ -2414,7 +2423,7 @@ { IShellViewImpl *This = impl_from_IViewObject(iface); - TRACE("(%p)->(count=%lu)\n",This,This->ref); + TRACE("(%p)->(count=%u)\n",This,This->ref); return IShellFolder_AddRef((IShellFolder*)This); } @@ -2423,7 +2432,7 @@ { IShellViewImpl *This = impl_from_IViewObject(iface); - TRACE("(%p)->(count=%lu)\n",This,This->ref); + TRACE("(%p)->(count=%u)\n",This,This->ref); return IShellFolder_Release((IShellFolder*)This); } @@ -2498,7 +2507,7 @@ IShellViewImpl *This = impl_from_IViewObject(iface); - FIXME("partial stub: %p %08lx %08lx %p\n", + FIXME("partial stub: %p %08x %08x %p\n", This, aspects, advf, pAdvSink); /* FIXME: we set the AdviseSink, but never use it to send any advice */
18 years, 1 month
1
0
0
0
[fireball] 24806: comctl32 auto-winesync
by fireball@svn.reactos.org
Author: fireball Date: Thu Nov 23 18:49:53 2006 New Revision: 24806 URL:
http://svn.reactos.org/svn/reactos?rev=24806&view=rev
Log: comctl32 auto-winesync Modified: trunk/reactos/dll/win32/comctl32/animate.c trunk/reactos/dll/win32/comctl32/comboex.c trunk/reactos/dll/win32/comctl32/comctl32undoc.c trunk/reactos/dll/win32/comctl32/comctl_De.rc trunk/reactos/dll/win32/comctl32/comctl_Ko.rc trunk/reactos/dll/win32/comctl32/comctl_Nl.rc trunk/reactos/dll/win32/comctl32/commctrl.c trunk/reactos/dll/win32/comctl32/datetime.c trunk/reactos/dll/win32/comctl32/dpa.c trunk/reactos/dll/win32/comctl32/draglist.c trunk/reactos/dll/win32/comctl32/header.c trunk/reactos/dll/win32/comctl32/hotkey.c trunk/reactos/dll/win32/comctl32/imagelist.c trunk/reactos/dll/win32/comctl32/listview.c trunk/reactos/dll/win32/comctl32/monthcal.c trunk/reactos/dll/win32/comctl32/pager.c trunk/reactos/dll/win32/comctl32/propsheet.c trunk/reactos/dll/win32/comctl32/rebar.c trunk/reactos/dll/win32/comctl32/smoothscroll.c trunk/reactos/dll/win32/comctl32/status.c trunk/reactos/dll/win32/comctl32/string.c trunk/reactos/dll/win32/comctl32/syslink.c trunk/reactos/dll/win32/comctl32/tab.c trunk/reactos/dll/win32/comctl32/theme_combo.c trunk/reactos/dll/win32/comctl32/theming.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/include/psdk/winuser.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/comctl32/animate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/animate…
Modified: trunk/reactos/dll/win32/comctl32/comboex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comboex…
Modified: trunk/reactos/dll/win32/comctl32/comctl32undoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
Modified: trunk/reactos/dll/win32/comctl32/comctl_De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl_…
Modified: trunk/reactos/dll/win32/comctl32/comctl_Ko.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl_…
Modified: trunk/reactos/dll/win32/comctl32/comctl_Nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl_…
Modified: trunk/reactos/dll/win32/comctl32/commctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/commctr…
Modified: trunk/reactos/dll/win32/comctl32/datetime.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/datetim…
Modified: trunk/reactos/dll/win32/comctl32/dpa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/dpa.c?r…
Modified: trunk/reactos/dll/win32/comctl32/draglist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/draglis…
Modified: trunk/reactos/dll/win32/comctl32/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/header.…
Modified: trunk/reactos/dll/win32/comctl32/hotkey.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/hotkey.…
Modified: trunk/reactos/dll/win32/comctl32/imagelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
Modified: trunk/reactos/dll/win32/comctl32/listview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/listvie…
Modified: trunk/reactos/dll/win32/comctl32/monthcal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/monthca…
Modified: trunk/reactos/dll/win32/comctl32/pager.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/pager.c…
Modified: trunk/reactos/dll/win32/comctl32/propsheet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/propshe…
Modified: trunk/reactos/dll/win32/comctl32/rebar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/rebar.c…
Modified: trunk/reactos/dll/win32/comctl32/smoothscroll.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/smooths…
Modified: trunk/reactos/dll/win32/comctl32/status.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/status.…
Modified: trunk/reactos/dll/win32/comctl32/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/string.…
Modified: trunk/reactos/dll/win32/comctl32/syslink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/syslink…
Modified: trunk/reactos/dll/win32/comctl32/tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/tab.c?r…
Modified: trunk/reactos/dll/win32/comctl32/theme_combo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/theme_c…
Modified: trunk/reactos/dll/win32/comctl32/theming.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/theming…
Modified: trunk/reactos/dll/win32/comctl32/toolbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar…
Modified: trunk/reactos/dll/win32/comctl32/tooltips.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/tooltip…
Modified: trunk/reactos/dll/win32/comctl32/trackbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/trackba…
Modified: trunk/reactos/dll/win32/comctl32/treeview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/treevie…
Modified: trunk/reactos/include/psdk/winuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winuser.h?rev…
18 years, 1 month
1
0
0
0
[cwittich] 24805: -always keep the correct file extension (fixes building of control panel applets) -escape defines (fixes loading of some project files)
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Nov 23 14:38:49 2006 New Revision: 24805 URL:
http://svn.reactos.org/svn/reactos?rev=24805&view=rev
Log: -always keep the correct file extension (fixes building of control panel applets) -escape defines (fixes loading of some project files) Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
============================================================================== --- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original) +++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Thu Nov 23 14:38:49 2006 @@ -402,9 +402,14 @@ for ( i = 0; i < defs.size(); i++ ) { if ( defs[i]->value[0] ) - common_defines.push_back( defs[i]->name + "=" + defs[i]->value ); + { + const string& escaped = _replace_str(defs[i]->value, "\"","""); + common_defines.push_back( defs[i]->name + "=" + escaped ); + } else + { common_defines.push_back( defs[i]->name ); + } } /*const vector<Property*>& variables = data.properties; for ( i = 0; i < variables.size(); i++ ) @@ -439,12 +444,12 @@ if ( configuration.UseConfigurationInPath ) { - fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(), module_type.c_str()); + fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\" prefix_auto=\"0\" extension_auto=\"0\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(), module_type.c_str()); fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str (), cfg.name.c_str() ); } else { - fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() ); + fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\" prefix_auto=\"0\" extension_auto=\"0\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() ); fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str () ); } @@ -610,3 +615,19 @@ this->name = "Unknown"; } } + +std::string +CBBackend::_replace_str(std::string string1, const std::string &find_str, const std::string &replace_str) +{ + std::string::size_type pos = string1.find(find_str, 0); + int intLen = find_str.length(); + + while(std::string::npos != pos) + { + string1.replace(pos, intLen, replace_str); + pos = string1.find(find_str, intLen + pos); + } + + return string1; +} +
18 years, 1 month
1
0
0
0
[cwittich] 24804: better subsystem handling
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Nov 23 00:37:56 2006 New Revision: 24804 URL:
http://svn.reactos.org/svn/reactos?rev=24804&view=rev
Log: better subsystem handling Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
============================================================================== --- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original) +++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Thu Nov 23 00:37:56 2006 @@ -326,10 +326,10 @@ string cbproj_path = module.GetBasePath(); string CompilerVar; - //bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a"); - //bool dll = (module_type == ".dll") || (module_type == ".cpl"); + bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a"); + bool dll = (module_type == ".dll") || (module_type == ".cpl"); bool exe = (module_type == ".exe") || (module_type == ".scr"); - //bool sys = (module_type == ".sys"); + bool sys = (module_type == ".sys"); vector<string> source_files, resource_files, includes, libraries, libpaths; vector<string> header_files, common_defines, compiler_flags; @@ -448,11 +448,27 @@ fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str () ); } - if ( console ) - fprintf ( OUT, "\t\t\t\t<Option type=\"1\" />\r\n" ); - else /* Win32 GUI */ - fprintf ( OUT, "\t\t\t\t<Option type=\"0\" />\r\n" ); - /* TODO: other subsystems */ + if ( lib ) + fprintf ( OUT, "\t\t\t\t<Option type=\"2\" />\r\n" ); + else if ( dll ) + fprintf ( OUT, "\t\t\t\t<Option type=\"3\" />\r\n" ); + else if ( sys ) + fprintf ( OUT, "\t\t\t\t<Option type=\"?\" />\r\n" ); /*FIXME*/ + else if ( exe ) + { + if ( module.type == Kernel ) + fprintf ( OUT, "\t\t\t\t<Option type=\"?\" />\r\n" ); /*FIXME*/ + else if ( module.type == NativeCUI ) + fprintf ( OUT, "\t\t\t\t<Option type=\"?\" />\r\n" ); /*FIXME*/ + else if ( module.type == Win32CUI || module.type == Win32GUI || module.type == Win32SCR) + { + if ( console ) + fprintf ( OUT, "\t\t\t\t<Option type=\"1\" />\r\n" ); + else + fprintf ( OUT, "\t\t\t\t<Option type=\"0\" />\r\n" ); + } + } + fprintf ( OUT, "\t\t\t\t<Option compiler=\"gcc\" />\r\n" ); fprintf ( OUT, "\t\t\t\t<Compiler>\r\n" );
18 years, 1 month
1
0
0
0
[greatlrd] 24803: written header usbkern.h
by greatlrd@svn.reactos.org
Author: greatlrd Date: Wed Nov 22 23:38:40 2006 New Revision: 24803 URL:
http://svn.reactos.org/svn/reactos?rev=24803&view=rev
Log: written header usbkern.h Added: trunk/reactos/include/ddk/usbkern.h (with props) Added: trunk/reactos/include/ddk/usbkern.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usbkern.h?rev=…
============================================================================== --- trunk/reactos/include/ddk/usbkern.h (added) +++ trunk/reactos/include/ddk/usbkern.h Wed Nov 22 23:38:40 2006 @@ -1,0 +1,18 @@ + +#ifndef __USBKERN_H__ +#define __USBKERN_H__ + +#include "usbiodef.h" + +#define IOCTL_INTERNAL_USB_GET_HUB_COUNT \ + USB_KERNEL_CTL(USB_GET_HUB_COUNT) + +#define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO \ + USB_KERNEL_CTL(USB_GET_ROOTHUB_PDO) + +#define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS) + +#endif + + Propchange: trunk/reactos/include/ddk/usbkern.h ------------------------------------------------------------------------------ svn:eol-style = native
18 years, 1 month
1
0
0
0
[cwittich] 24802: use the correct compiler for .c/.cpp files
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Nov 22 23:35:11 2006 New Revision: 24802 URL:
http://svn.reactos.org/svn/reactos?rev=24802&view=rev
Log: use the correct compiler for .c/.cpp files Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
============================================================================== --- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original) +++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Wed Nov 22 23:35:11 2006 @@ -324,6 +324,7 @@ string outenv = Environment::GetOutputPath (); string module_type = GetExtension(module.GetTargetName()); string cbproj_path = module.GetBasePath(); + string CompilerVar; //bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a"); //bool dll = (module_type == ".dll") || (module_type == ".cpl"); @@ -331,8 +332,15 @@ //bool sys = (module_type == ".sys"); vector<string> source_files, resource_files, includes, libraries, libpaths; - vector<string> header_files, common_defines; + vector<string> header_files, common_defines, compiler_flags; + vector<string> vars, values; + compiler_flags.push_back ( "-Wall" ); + + // Always force disabling of sibling calls optimisation for GCC + // (TODO: Move to version-specific once this bug is fixed in GCC) + compiler_flags.push_back ( "-fno-optimize-sibling-calls" ); + if ( module.pch != NULL ) { string pch_path = Path::RelativeFromDirectory ( @@ -385,6 +393,11 @@ libraries.push_back ( libs[i]->name ); libpaths.push_back ( libpath ); } + const vector<CompilerFlag*>& cflags = data.compilerFlags; + for ( i = 0; i < cflags.size(); i++ ) + { + compiler_flags.push_back ( cflags[i]->flag ); + } const vector<Define*>& defs = data.defines; for ( i = 0; i < defs.size(); i++ ) { @@ -393,7 +406,16 @@ else common_defines.push_back( defs[i]->name ); } - } + /*const vector<Property*>& variables = data.properties; + for ( i = 0; i < variables.size(); i++ ) + { + vars.push_back( variables[i]->name ); + values.push_back( variables[i]->value ); + }*/ + } + + if ( !module.allowWarnings ) + compiler_flags.push_back ( "-Werror" ); FILE* OUT = fopen ( cbproj_file.c_str(), "wb" ); @@ -408,6 +430,8 @@ fprintf ( OUT, "\t\t<Option virtualFolders=\"\" />\r\n" ); fprintf ( OUT, "\t\t<Build>\r\n" ); + bool console = exe && (module.type == Win32CUI); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) { const CBConfiguration& cfg = *m_configurations[icfg]; @@ -423,8 +447,6 @@ fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() ); fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str () ); } - - bool console = exe && (module.type == Win32CUI); if ( console ) fprintf ( OUT, "\t\t\t\t<Option type=\"1\" />\r\n" ); @@ -434,6 +456,19 @@ fprintf ( OUT, "\t\t\t\t<Option compiler=\"gcc\" />\r\n" ); fprintf ( OUT, "\t\t\t\t<Compiler>\r\n" ); + + bool debug = ( cfg.optimization == Debug ); + + if ( debug ) + fprintf ( OUT, "\t\t\t\t\t<Add option=\"-g\" />\r\n" ); + + /* compiler flags */ + for ( i = 0; i < compiler_flags.size(); i++ ) + { + const string& cflag = compiler_flags[i]; + fprintf ( OUT, "\t\t\t\t\t<Add option=\"%s\" />\r\n", cflag.c_str() ); + } + /* defines */ for ( i = 0; i < common_defines.size(); i++ ) { @@ -474,14 +509,30 @@ fprintf ( OUT, "\t\t\t</Target>\r\n" ); } + + /* vars + fprintf ( OUT, "\t\t\t<Environment>\r\n" ); + for ( i = 0; i < vars.size(); i++ ) + { + const string& var = vars[i]; + const string& value = values[i]; + fprintf ( OUT, "\t\t\t\t<Variable name=\"%s\" value=\"%s\" />\r\n", var.c_str(), value.c_str() ); + } + fprintf ( OUT, "\t\t\t</Environment>\r\n" ); */ + fprintf ( OUT, "\t\t</Build>\r\n" ); + + if ( module.cplusplus ) + CompilerVar = "CPP"; + else + CompilerVar = "CC"; /* header files */ for ( i = 0; i < header_files.size(); i++ ) { const string& header_file = header_files[i]; fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", header_file.c_str() ); - fprintf ( OUT, "\t\t\t<Option compilerVar=\"CPP\" />\r\n" ); + fprintf ( OUT, "\t\t\t<Option compilerVar=\"%s\" />\r\n", CompilerVar.c_str() ); fprintf ( OUT, "\t\t\t<Option compile=\"0\" />\r\n" ); fprintf ( OUT, "\t\t\t<Option link=\"0\" />\r\n" ); for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) @@ -497,6 +548,7 @@ { string source_file = DosSeparator(source_files[isrcfile]); fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", source_file.c_str() ); + fprintf ( OUT, "\t\t\t<Option compilerVar=\"%s\" />\r\n", CompilerVar.c_str() ); for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) { const CBConfiguration& cfg = *m_configurations[icfg];
18 years, 1 month
1
0
0
0
[cwittich] 24801: fixed a function declaration some minor formatting changes
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Nov 22 23:19:12 2006 New Revision: 24801 URL:
http://svn.reactos.org/svn/reactos?rev=24801&view=rev
Log: fixed a function declaration some minor formatting changes Modified: trunk/reactos/base/applications/msconfig/srvpage.c trunk/reactos/base/applications/msconfig/startuppage.c Modified: trunk/reactos/base/applications/msconfig/srvpage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/srvpage.c (original) +++ trunk/reactos/base/applications/msconfig/srvpage.c Wed Nov 22 23:19:12 2006 @@ -80,7 +80,7 @@ SC_HANDLE hService; DWORD BytesNeeded = 0; DWORD ResumeHandle = 0; - DWORD NumServices = 0; + DWORD NumServices = 0; DWORD dwHandle, dwLen; size_t Index; UINT BufLen; @@ -105,7 +105,7 @@ { /* reserve memory for service info array */ pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); - if (!pServiceStatus) + if (!pServiceStatus) return; /* fill array with service info */ @@ -137,7 +137,7 @@ BytesNeeded = 0; hService = OpenService(ScHandle, pServiceStatus[Index].lpServiceName, SC_MANAGER_CONNECT); - if (hService != INVALID_HANDLE_VALUE) + if (hService != INVALID_HANDLE_VALUE) { /* check if service is required by the system*/ if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, 0, &BytesNeeded)) @@ -145,7 +145,7 @@ if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); - if (pServiceFailureActions == NULL) + if (pServiceFailureActions == NULL) return; if (!QueryServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS, (LPBYTE)pServiceFailureActions, BytesNeeded, &BytesNeeded)) @@ -183,7 +183,7 @@ if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { pServiceConfig = (LPQUERY_SERVICE_CONFIG) HeapAlloc(GetProcessHeap(), 0, BytesNeeded); - if (pServiceConfig == NULL) + if (pServiceConfig == NULL) return; if (!QueryServiceConfig(hService, pServiceConfig, BytesNeeded, &BytesNeeded)) @@ -215,7 +215,7 @@ if (dwLen) { lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen); - if (lpData == NULL) + if (lpData == NULL) return; if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) @@ -231,12 +231,12 @@ wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID); } - if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) + if (VerQueryValue (lpData, szStrFileInfo, (void**) &lpBuffer, (PUINT) &BufLen)) { item.pszText = lpBuffer; item.iSubItem = 2; SendMessage(hServicesListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - } + } HeapFree(GetProcessHeap(), 0, lpData); } else @@ -259,6 +259,6 @@ HeapFree(GetProcessHeap(), 0, pServiceStatus); CloseServiceHandle(ScHandle); - } + } } Modified: trunk/reactos/base/applications/msconfig/startuppage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/startuppage.c (original) +++ trunk/reactos/base/applications/msconfig/startuppage.c Wed Nov 22 23:19:12 2006 @@ -14,7 +14,7 @@ HWND hStartupDialog; void GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ); -void GetDisabledAutostartEntriesFromRegistry (); +void GetDisabledAutostartEntriesFromRegistry (TCHAR * szBasePath); INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) @@ -78,7 +78,7 @@ { HKEY hKey, hSubKey; DWORD Index, SubIndex, dwValues, dwSubValues, retVal; - DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; + DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; LV_ITEM item; TCHAR* Data; TCHAR szValueName[MAX_KEY_LENGTH]; @@ -89,7 +89,7 @@ { if (RegQueryInfoKey(hKey, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { - for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) + for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) { dwValueLength = MAX_KEY_LENGTH; dwDataLength = MAX_VALUE_NAME; @@ -105,7 +105,7 @@ item.pszText = szValueName; item.iItem = ListView_GetItemCount(hStartupListCtrl); item.lParam = 0; - (void)ListView_InsertItem(hStartupListCtrl, &item); + (void)ListView_InsertItem(hStartupListCtrl, &item); if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, szSubPath, 0, KEY_READ | KEY_ENUMERATE_SUB_KEYS, &hSubKey) == ERROR_SUCCESS) { if (RegQueryInfoKey(hSubKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwSubValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) @@ -121,7 +121,7 @@ GetLongPathName(Data, Data, (DWORD) _tcsclen(Data)); item.pszText = Data; item.iSubItem = 1; - SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); + SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); } else if (!_tcscmp(szSubValueName, _T("key")) || !_tcscmp(szSubValueName, _T("location"))) { @@ -154,7 +154,7 @@ { HKEY hKey; DWORD Index, dwValues, retVal, dwType; - DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; + DWORD dwValueLength, dwDataLength = MAX_VALUE_NAME; TCHAR* Data; TCHAR lpValueName[MAX_KEY_LENGTH]; TCHAR Path[MAX_KEY_LENGTH + 5]; @@ -164,7 +164,7 @@ { if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { - for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) + for (Index = 0, retVal = ERROR_SUCCESS; Index < dwValues; Index++) { dwValueLength = MAX_KEY_LENGTH; dwDataLength = MAX_VALUE_NAME; @@ -172,7 +172,7 @@ if (Data == NULL) break; retVal = RegEnumValue(hKey, Index, lpValueName, &dwValueLength, NULL, &dwType, (LPBYTE)Data, &dwDataLength); - if (retVal == ERROR_SUCCESS) + if (retVal == ERROR_SUCCESS) { memset(&item, 0, sizeof(LV_ITEM)); item.mask = LVIF_TEXT; @@ -190,7 +190,7 @@ item.iSubItem = 1; SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); } - + switch (PtrToLong(hRootKey)) { case PtrToLong(HKEY_LOCAL_MACHINE):
18 years, 1 month
1
0
0
0
[cwittich] 24800: -fix line endings -set eol-style:native
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Nov 22 18:23:17 2006 New Revision: 24800 URL:
http://svn.reactos.org/svn/reactos?rev=24800&view=rev
Log: -fix line endings -set eol-style:native Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (contents, props changed) trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h (contents, props changed) Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
============================================================================== --- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original) +++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Wed Nov 22 18:23:17 2006 @@ -1,544 +1,544 @@ -/* - * Copyright (C) 2006 Christoph von Wittich - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifdef _MSC_VER -#pragma warning ( disable : 4786 ) -#endif//_MSC_VER - -#include <iostream> -#include <fstream> -#include <string> -#include <vector> - -#include <stdio.h> - -#include "codeblocks.h" -#include "../mingw/mingw.h" - -using std::string; -using std::vector; -using std::ifstream; - -#ifdef OUT -#undef OUT -#endif//OUT - - -static class CBFactory : public Backend::Factory -{ - public: - - CBFactory() : Factory("CB", "Code::Blocks") {} - Backend *operator() (Project &project, - Configuration& configuration) - { - return new CBBackend(project, configuration); - } - -} factory; - - -CBBackend::CBBackend(Project &project, - Configuration& configuration) : Backend(project, configuration) -{ - m_unitCount = 0; -} - -void CBBackend::Process() -{ - - while ( m_configurations.size () > 0 ) - { - const CBConfiguration* cfg = m_configurations.back(); - m_configurations.pop_back(); - delete cfg; - } - - m_configurations.push_back ( new CBConfiguration( Debug )); - m_configurations.push_back ( new CBConfiguration( Release )); - - string filename_wrkspace ( ProjectNode.name ); - filename_wrkspace += "_auto.workspace"; - - printf ( "Creating Code::Blocks workspace: %s\n", filename_wrkspace.c_str() ); - - ProcessModules(); - m_wrkspaceFile = fopen ( filename_wrkspace.c_str(), "wb" ); - - if ( !m_wrkspaceFile ) - { - printf ( "Could not create file '%s'.\n", filename_wrkspace.c_str() ); - return; - } - - _generate_workspace ( m_wrkspaceFile ); - - fclose ( m_wrkspaceFile ); - printf ( "Done.\n" ); -} - -void CBBackend::ProcessModules() -{ - for(size_t i = 0; i < ProjectNode.modules.size(); i++) - { - Module &module = *ProjectNode.modules[i]; - _generate_cbproj ( module ); - } -} - -static bool FileExists(string &filename) -{ - ifstream file(filename.c_str()); - - if(!file.is_open()) - return false; - - file.close(); - return true; -} - -void CBBackend::ProcessFile(string &filepath) -{ - // Remove the .\ at the start of the filenames - if ( filepath[0] == '.' && strchr ( "/\\", filepath[1] ) ) - filepath.erase(0, 2); - - if(!FileExists(filepath)) - return; - - // Change the \ to / - for(size_t i = 0; i < filepath.length(); i++) - { - if(filepath[i] == '\\') - filepath[i] = '/'; - } - - // Remove the filename from the path - string folder = ""; - - size_t pos = filepath.rfind(string("/"), filepath.length() - 1); - - if(pos != string::npos) - { - folder = filepath; - folder.erase(pos, folder.length() - pos); - } - - FileUnit fileUnit; - fileUnit.filename = filepath; - fileUnit.folder = folder; - - m_fileUnits.push_back(fileUnit); - - if(folder != "") - AddFolders(folder); - - m_unitCount++; -} - -bool CBBackend::CheckFolderAdded(string &folder) -{ - for(size_t i = 0; i < m_folders.size(); i++) - { - if(m_folders[i] == folder) - return true; - } - - return false; -} - -void CBBackend::AddFolders(string &folder) -{ - // Check if this folder was already added. true if it was, false otherwise. - if(CheckFolderAdded(folder)) - return; - - m_folders.push_back(folder); - - size_t pos = folder.rfind(string("/"), folder.length() - 1); - - if(pos == string::npos) - return; - - folder.erase(pos, folder.length() - pos); - AddFolders(folder); -} - -void CBBackend::OutputFolders() -{ -#if 0 - m_devFile << "Folders="; - - for(size_t i = 0; i < m_folders.size(); i++) - { - if(i > 0) - m_devFile << ","; - - m_devFile << m_folders[i]; - } -#endif -} - -std::string -CBBackend::CbpFileName ( const Module& module ) const -{ - return DosSeparator( - ReplaceExtension ( module.GetPath(), + "_auto.cbp" ) - ); -} - -std::string -CBBackend::LayoutFileName ( const Module& module ) const -{ - return DosSeparator( - ReplaceExtension ( module.GetPath(), + "_auto.layout" ) - ); -} - -std::string -CBBackend::DependFileName ( const Module& module ) const -{ - return DosSeparator( - ReplaceExtension ( module.GetPath(), + "_auto.depend" ) - ); -} - -void -CBBackend::_get_object_files ( const Module& module, vector<string>& out) const -{ - string basepath = module.GetBasePath (); - size_t i; - string intenv = Environment::GetIntermediatePath () + "\\" + basepath + "\\"; - string outenv = Environment::GetOutputPath () + "\\" + basepath + "\\"; - - vector<string> cfgs; - - if ( configuration.UseConfigurationInPath ) - { - cfgs.push_back ( intenv + "Debug" ); - cfgs.push_back ( intenv + "Release" ); - cfgs.push_back ( outenv + "Debug" ); - cfgs.push_back ( outenv + "Release" ); - } - else - { - cfgs.push_back ( intenv ); - cfgs.push_back ( outenv ); - } - - vector<const IfableData*> ifs_list; - ifs_list.push_back ( &module.project.non_if_data ); - ifs_list.push_back ( &module.non_if_data ); - while ( ifs_list.size () ) - { - const IfableData& data = *ifs_list.back(); - ifs_list.pop_back(); - const vector<File*>& files = data.files; - for ( i = 0; i < files.size (); i++ ) - { - string file = files[i]->name; - string::size_type pos = file.find_last_of ("\\"); - if ( pos != string::npos ) - file.erase ( 0, pos+1 ); - if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) - file = ReplaceExtension ( file, ".res" ); - else - file = ReplaceExtension ( file, ".obj" ); - for ( size_t j = 0; j < cfgs.size () / 2; j++ ) - out.push_back ( cfgs[j] + "\\" + file ); - } - - } -} - -void -CBBackend::_clean_project_files ( void ) -{ - for ( size_t i = 0; i < ProjectNode.modules.size(); i++ ) - { - Module& module = *ProjectNode.modules[i]; - vector<string> out; - printf("Cleaning project %s %s\n", module.name.c_str (), module.GetBasePath ().c_str () ); - - string basepath = module.GetBasePath (); - remove ( CbpFileName ( module ).c_str () ); - remove ( DependFileName ( module ).c_str () ); - remove ( LayoutFileName ( module ).c_str () ); - - _get_object_files ( module, out ); - for ( size_t j = 0; j < out.size (); j++) - { - //printf("Cleaning file %s\n", out[j].c_str () ); - remove ( out[j].c_str () ); - } - } - - string filename_wrkspace = ProjectNode.name + ".workspace"; - - remove ( filename_wrkspace.c_str () ); -} - -void -CBBackend::_generate_workspace ( FILE* OUT ) -{ - fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\r\n" ); +/* + * Copyright (C) 2006 Christoph von Wittich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +#include <stdio.h> + +#include "codeblocks.h" +#include "../mingw/mingw.h" + +using std::string; +using std::vector; +using std::ifstream; + +#ifdef OUT +#undef OUT +#endif//OUT + + +static class CBFactory : public Backend::Factory +{ + public: + + CBFactory() : Factory("CB", "Code::Blocks") {} + Backend *operator() (Project &project, + Configuration& configuration) + { + return new CBBackend(project, configuration); + } + +} factory; + + +CBBackend::CBBackend(Project &project, + Configuration& configuration) : Backend(project, configuration) +{ + m_unitCount = 0; +} + +void CBBackend::Process() +{ + + while ( m_configurations.size () > 0 ) + { + const CBConfiguration* cfg = m_configurations.back(); + m_configurations.pop_back(); + delete cfg; + } + + m_configurations.push_back ( new CBConfiguration( Debug )); + m_configurations.push_back ( new CBConfiguration( Release )); + + string filename_wrkspace ( ProjectNode.name ); + filename_wrkspace += "_auto.workspace"; + + printf ( "Creating Code::Blocks workspace: %s\n", filename_wrkspace.c_str() ); + + ProcessModules(); + m_wrkspaceFile = fopen ( filename_wrkspace.c_str(), "wb" ); + + if ( !m_wrkspaceFile ) + { + printf ( "Could not create file '%s'.\n", filename_wrkspace.c_str() ); + return; + } + + _generate_workspace ( m_wrkspaceFile ); + + fclose ( m_wrkspaceFile ); + printf ( "Done.\n" ); +} + +void CBBackend::ProcessModules() +{ + for(size_t i = 0; i < ProjectNode.modules.size(); i++) + { + Module &module = *ProjectNode.modules[i]; + _generate_cbproj ( module ); + } +} + +static bool FileExists(string &filename) +{ + ifstream file(filename.c_str()); + + if(!file.is_open()) + return false; + + file.close(); + return true; +} + +void CBBackend::ProcessFile(string &filepath) +{ + // Remove the .\ at the start of the filenames + if ( filepath[0] == '.' && strchr ( "/\\", filepath[1] ) ) + filepath.erase(0, 2); + + if(!FileExists(filepath)) + return; + + // Change the \ to / + for(size_t i = 0; i < filepath.length(); i++) + { + if(filepath[i] == '\\') + filepath[i] = '/'; + } + + // Remove the filename from the path + string folder = ""; + + size_t pos = filepath.rfind(string("/"), filepath.length() - 1); + + if(pos != string::npos) + { + folder = filepath; + folder.erase(pos, folder.length() - pos); + } + + FileUnit fileUnit; + fileUnit.filename = filepath; + fileUnit.folder = folder; + + m_fileUnits.push_back(fileUnit); + + if(folder != "") + AddFolders(folder); + + m_unitCount++; +} + +bool CBBackend::CheckFolderAdded(string &folder) +{ + for(size_t i = 0; i < m_folders.size(); i++) + { + if(m_folders[i] == folder) + return true; + } + + return false; +} + +void CBBackend::AddFolders(string &folder) +{ + // Check if this folder was already added. true if it was, false otherwise. + if(CheckFolderAdded(folder)) + return; + + m_folders.push_back(folder); + + size_t pos = folder.rfind(string("/"), folder.length() - 1); + + if(pos == string::npos) + return; + + folder.erase(pos, folder.length() - pos); + AddFolders(folder); +} + +void CBBackend::OutputFolders() +{ +#if 0 + m_devFile << "Folders="; + + for(size_t i = 0; i < m_folders.size(); i++) + { + if(i > 0) + m_devFile << ","; + + m_devFile << m_folders[i]; + } +#endif +} + +std::string +CBBackend::CbpFileName ( const Module& module ) const +{ + return DosSeparator( + ReplaceExtension ( module.GetPath(), + "_auto.cbp" ) + ); +} + +std::string +CBBackend::LayoutFileName ( const Module& module ) const +{ + return DosSeparator( + ReplaceExtension ( module.GetPath(), + "_auto.layout" ) + ); +} + +std::string +CBBackend::DependFileName ( const Module& module ) const +{ + return DosSeparator( + ReplaceExtension ( module.GetPath(), + "_auto.depend" ) + ); +} + +void +CBBackend::_get_object_files ( const Module& module, vector<string>& out) const +{ + string basepath = module.GetBasePath (); + size_t i; + string intenv = Environment::GetIntermediatePath () + "\\" + basepath + "\\"; + string outenv = Environment::GetOutputPath () + "\\" + basepath + "\\"; + + vector<string> cfgs; + + if ( configuration.UseConfigurationInPath ) + { + cfgs.push_back ( intenv + "Debug" ); + cfgs.push_back ( intenv + "Release" ); + cfgs.push_back ( outenv + "Debug" ); + cfgs.push_back ( outenv + "Release" ); + } + else + { + cfgs.push_back ( intenv ); + cfgs.push_back ( outenv ); + } + + vector<const IfableData*> ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + while ( ifs_list.size () ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector<File*>& files = data.files; + for ( i = 0; i < files.size (); i++ ) + { + string file = files[i]->name; + string::size_type pos = file.find_last_of ("\\"); + if ( pos != string::npos ) + file.erase ( 0, pos+1 ); + if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + file = ReplaceExtension ( file, ".res" ); + else + file = ReplaceExtension ( file, ".obj" ); + for ( size_t j = 0; j < cfgs.size () / 2; j++ ) + out.push_back ( cfgs[j] + "\\" + file ); + } + + } +} + +void +CBBackend::_clean_project_files ( void ) +{ + for ( size_t i = 0; i < ProjectNode.modules.size(); i++ ) + { + Module& module = *ProjectNode.modules[i]; + vector<string> out; + printf("Cleaning project %s %s\n", module.name.c_str (), module.GetBasePath ().c_str () ); + + string basepath = module.GetBasePath (); + remove ( CbpFileName ( module ).c_str () ); + remove ( DependFileName ( module ).c_str () ); + remove ( LayoutFileName ( module ).c_str () ); + + _get_object_files ( module, out ); + for ( size_t j = 0; j < out.size (); j++) + { + //printf("Cleaning file %s\n", out[j].c_str () ); + remove ( out[j].c_str () ); + } + } + + string filename_wrkspace = ProjectNode.name + ".workspace"; + + remove ( filename_wrkspace.c_str () ); +} + +void +CBBackend::_generate_workspace ( FILE* OUT ) +{ + fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\r\n" ); fprintf ( OUT, "<CodeBlocks_workspace_file>\r\n" ); fprintf ( OUT, "\t<Workspace title=\"ReactOS\">\r\n" ); - for ( size_t i = 0; i < ProjectNode.modules.size(); i++ ) - { - Module& module = *ProjectNode.modules[i]; - - std::string Cbp_file = CbpFileName ( module ); + for ( size_t i = 0; i < ProjectNode.modules.size(); i++ ) + { + Module& module = *ProjectNode.modules[i]; + + std::string Cbp_file = CbpFileName ( module ); fprintf ( OUT, "\t\t<Project filename=\"%s\" />\r\n", Cbp_file.c_str()); - - } + + } fprintf ( OUT, "\t</Workspace>\r\n" ); fprintf ( OUT, "</CodeBlocks_workspace_file>\r\n" ); -} - -void -CBBackend::_generate_cbproj ( const Module& module ) -{ - - size_t i; - - string cbproj_file = CbpFileName(module); - string outdir; - string intdir; - string path_basedir = module.GetPathToBaseDir (); - string intenv = Environment::GetIntermediatePath (); - string outenv = Environment::GetOutputPath (); - string module_type = GetExtension(module.GetTargetName()); - string cbproj_path = module.GetBasePath(); - - //bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a"); - //bool dll = (module_type == ".dll") || (module_type == ".cpl"); - bool exe = (module_type == ".exe") || (module_type == ".scr"); - //bool sys = (module_type == ".sys"); - - vector<string> source_files, resource_files, includes, libraries, libpaths; - vector<string> header_files, common_defines; - - if ( module.pch != NULL ) - { - string pch_path = Path::RelativeFromDirectory ( - module.pch->file.name, - module.GetBasePath() ); - - header_files.push_back ( pch_path ); - } - - if ( intenv == "obj-i386" ) - intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */ - else - intdir = intenv; - - if ( outenv == "output-i386" ) - outdir = path_basedir + "output-i386"; - else - outdir = outenv; - - vector<const IfableData*> ifs_list; - ifs_list.push_back ( &module.project.non_if_data ); - ifs_list.push_back ( &module.non_if_data ); - while ( ifs_list.size() ) - { - const IfableData& data = *ifs_list.back(); - ifs_list.pop_back(); - const vector<File*>& files = data.files; - for ( i = 0; i < files.size(); i++ ) - { - string file = string(".") + &files[i]->name[cbproj_path.size()]; - - if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) - resource_files.push_back ( file ); - else - source_files.push_back ( file ); - } - const vector<Include*>& incs = data.includes; - for ( i = 0; i < incs.size(); i++ ) - { - string path = Path::RelativeFromDirectory ( - incs[i]->directory, - module.GetBasePath() ); - - includes.push_back ( path ); - } - const vector<Library*>& libs = data.libraries; - for ( i = 0; i < libs.size(); i++ ) - { - string libpath = outdir + "\\" + libs[i]->importedModule->GetBasePath() + "\\" + libs[i]->name; - libraries.push_back ( libs[i]->name ); - libpaths.push_back ( libpath ); - } - const vector<Define*>& defs = data.defines; - for ( i = 0; i < defs.size(); i++ ) - { - if ( defs[i]->value[0] ) - common_defines.push_back( defs[i]->name + "=" + defs[i]->value ); - else - common_defines.push_back( defs[i]->name ); - } - } - - FILE* OUT = fopen ( cbproj_file.c_str(), "wb" ); - +} + +void +CBBackend::_generate_cbproj ( const Module& module ) +{ + + size_t i; + + string cbproj_file = CbpFileName(module); + string outdir; + string intdir; + string path_basedir = module.GetPathToBaseDir (); + string intenv = Environment::GetIntermediatePath (); + string outenv = Environment::GetOutputPath (); + string module_type = GetExtension(module.GetTargetName()); + string cbproj_path = module.GetBasePath(); + + //bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a"); + //bool dll = (module_type == ".dll") || (module_type == ".cpl"); + bool exe = (module_type == ".exe") || (module_type == ".scr"); + //bool sys = (module_type == ".sys"); + + vector<string> source_files, resource_files, includes, libraries, libpaths; + vector<string> header_files, common_defines; + + if ( module.pch != NULL ) + { + string pch_path = Path::RelativeFromDirectory ( + module.pch->file.name, + module.GetBasePath() ); + + header_files.push_back ( pch_path ); + } + + if ( intenv == "obj-i386" ) + intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */ + else + intdir = intenv; + + if ( outenv == "output-i386" ) + outdir = path_basedir + "output-i386"; + else + outdir = outenv; + + vector<const IfableData*> ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + while ( ifs_list.size() ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector<File*>& files = data.files; + for ( i = 0; i < files.size(); i++ ) + { + string file = string(".") + &files[i]->name[cbproj_path.size()]; + + if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + resource_files.push_back ( file ); + else + source_files.push_back ( file ); + } + const vector<Include*>& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + string path = Path::RelativeFromDirectory ( + incs[i]->directory, + module.GetBasePath() ); + + includes.push_back ( path ); + } + const vector<Library*>& libs = data.libraries; + for ( i = 0; i < libs.size(); i++ ) + { + string libpath = outdir + "\\" + libs[i]->importedModule->GetBasePath() + "\\" + libs[i]->name; + libraries.push_back ( libs[i]->name ); + libpaths.push_back ( libpath ); + } + const vector<Define*>& defs = data.defines; + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->value[0] ) + common_defines.push_back( defs[i]->name + "=" + defs[i]->value ); + else + common_defines.push_back( defs[i]->name ); + } + } + + FILE* OUT = fopen ( cbproj_file.c_str(), "wb" ); + fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\r\n" ); fprintf ( OUT, "<CodeBlocks_project_file>\r\n" ); - fprintf ( OUT, "\t<FileVersion major=\"1\" minor=\"5\" />\r\n" ); - fprintf ( OUT, "\t<Project>\r\n" ); + fprintf ( OUT, "\t<FileVersion major=\"1\" minor=\"5\" />\r\n" ); + fprintf ( OUT, "\t<Project>\r\n" ); fprintf ( OUT, "\t\t<Option title=\"%s\" />\r\n", module.name.c_str() ); fprintf ( OUT, "\t\t<Option pch_mode=\"2\" />\r\n" ); fprintf ( OUT, "\t\t<Option default_target=\"\" />\r\n" ); fprintf ( OUT, "\t\t<Option compiler=\"gcc\" />\r\n" ); fprintf ( OUT, "\t\t<Option virtualFolders=\"\" />\r\n" ); - fprintf ( OUT, "\t\t<Build>\r\n" ); - - for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) - { - const CBConfiguration& cfg = *m_configurations[icfg]; - fprintf ( OUT, "\t\t\t<Target title=\"%s\">\r\n", cfg.name.c_str() ); - - if ( configuration.UseConfigurationInPath ) - { - fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(), module_type.c_str()); - fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str (), cfg.name.c_str() ); - } - else - { - fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() ); - fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str () ); - } - - bool console = exe && (module.type == Win32CUI); - - if ( console ) - fprintf ( OUT, "\t\t\t\t<Option type=\"1\" />\r\n" ); - else /* Win32 GUI */ - fprintf ( OUT, "\t\t\t\t<Option type=\"0\" />\r\n" ); - /* TODO: other subsystems */ - - fprintf ( OUT, "\t\t\t\t<Option compiler=\"gcc\" />\r\n" ); - fprintf ( OUT, "\t\t\t\t<Compiler>\r\n" ); - /* defines */ - for ( i = 0; i < common_defines.size(); i++ ) - { - const string& define = common_defines[i]; - fprintf ( OUT, "\t\t\t\t\t<Add option=\"-D%s\" />\r\n", define.c_str() ); - } - /* includes */ - for ( i = 0; i < includes.size(); i++ ) - { - const string& include = includes[i]; - fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", include.c_str() ); - } - fprintf ( OUT, "\t\t\t\t</Compiler>\r\n" ); - - /* includes */ - fprintf ( OUT, "\t\t\t\t<ResourceCompiler>\r\n" ); - for ( i = 0; i < includes.size(); i++ ) - { - const string& include = includes[i]; - fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", include.c_str() ); - } - fprintf ( OUT, "\t\t\t\t</ResourceCompiler>\r\n" ); - - /* libraries */ - fprintf ( OUT, "\t\t\t\t<Linker>\r\n" ); - for ( i = 0; i < libraries.size(); i++ ) - { - const string& lib = libraries[i]; - fprintf ( OUT, "\t\t\t\t\t<Add library=\"%s\" />\r\n", lib.c_str() ); - } - for ( i = 0; i < libpaths.size(); i++ ) - { - const string& lib = libpaths[i]; - fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", lib.c_str() ); - } - fprintf ( OUT, "\t\t\t\t</Linker>\r\n" ); - - fprintf ( OUT, "\t\t\t</Target>\r\n" ); - - } + fprintf ( OUT, "\t\t<Build>\r\n" ); + + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const CBConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\t<Target title=\"%s\">\r\n", cfg.name.c_str() ); + + if ( configuration.UseConfigurationInPath ) + { + fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(), module_type.c_str()); + fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str (), cfg.name.c_str() ); + } + else + { + fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() ); + fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str () ); + } + + bool console = exe && (module.type == Win32CUI); + + if ( console ) + fprintf ( OUT, "\t\t\t\t<Option type=\"1\" />\r\n" ); + else /* Win32 GUI */ + fprintf ( OUT, "\t\t\t\t<Option type=\"0\" />\r\n" ); + /* TODO: other subsystems */ + + fprintf ( OUT, "\t\t\t\t<Option compiler=\"gcc\" />\r\n" ); + fprintf ( OUT, "\t\t\t\t<Compiler>\r\n" ); + /* defines */ + for ( i = 0; i < common_defines.size(); i++ ) + { + const string& define = common_defines[i]; + fprintf ( OUT, "\t\t\t\t\t<Add option=\"-D%s\" />\r\n", define.c_str() ); + } + /* includes */ + for ( i = 0; i < includes.size(); i++ ) + { + const string& include = includes[i]; + fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", include.c_str() ); + } + fprintf ( OUT, "\t\t\t\t</Compiler>\r\n" ); + + /* includes */ + fprintf ( OUT, "\t\t\t\t<ResourceCompiler>\r\n" ); + for ( i = 0; i < includes.size(); i++ ) + { + const string& include = includes[i]; + fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", include.c_str() ); + } + fprintf ( OUT, "\t\t\t\t</ResourceCompiler>\r\n" ); + + /* libraries */ + fprintf ( OUT, "\t\t\t\t<Linker>\r\n" ); + for ( i = 0; i < libraries.size(); i++ ) + { + const string& lib = libraries[i]; + fprintf ( OUT, "\t\t\t\t\t<Add library=\"%s\" />\r\n", lib.c_str() ); + } + for ( i = 0; i < libpaths.size(); i++ ) + { + const string& lib = libpaths[i]; + fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", lib.c_str() ); + } + fprintf ( OUT, "\t\t\t\t</Linker>\r\n" ); + + fprintf ( OUT, "\t\t\t</Target>\r\n" ); + + } fprintf ( OUT, "\t\t</Build>\r\n" ); - - /* header files */ - for ( i = 0; i < header_files.size(); i++ ) - { - const string& header_file = header_files[i]; - fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", header_file.c_str() ); + + /* header files */ + for ( i = 0; i < header_files.size(); i++ ) + { + const string& header_file = header_files[i]; + fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", header_file.c_str() ); fprintf ( OUT, "\t\t\t<Option compilerVar=\"CPP\" />\r\n" ); fprintf ( OUT, "\t\t\t<Option compile=\"0\" />\r\n" ); fprintf ( OUT, "\t\t\t<Option link=\"0\" />\r\n" ); - for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) - { - const CBConfiguration& cfg = *m_configurations[icfg]; - fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); - } - fprintf ( OUT, "\t\t</Unit>\r\n" ); - } - - /* source files */ - for ( size_t isrcfile = 0; isrcfile < source_files.size(); isrcfile++ ) - { - string source_file = DosSeparator(source_files[isrcfile]); - fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", source_file.c_str() ); - for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) - { - const CBConfiguration& cfg = *m_configurations[icfg]; - fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); - } - fprintf ( OUT, "\t\t</Unit>\r\n" ); - } - - /* resource files */ - for ( i = 0; i < resource_files.size(); i++ ) - { - const string& resource_file = resource_files[i]; - fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", resource_file.c_str() ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const CBConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); + } + fprintf ( OUT, "\t\t</Unit>\r\n" ); + } + + /* source files */ + for ( size_t isrcfile = 0; isrcfile < source_files.size(); isrcfile++ ) + { + string source_file = DosSeparator(source_files[isrcfile]); + fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", source_file.c_str() ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const CBConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); + } + fprintf ( OUT, "\t\t</Unit>\r\n" ); + } + + /* resource files */ + for ( i = 0; i < resource_files.size(); i++ ) + { + const string& resource_file = resource_files[i]; + fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", resource_file.c_str() ); fprintf ( OUT, "\t\t\t<Option compilerVar=\"WINDRES\" />\r\n" ); - for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) - { - const CBConfiguration& cfg = *m_configurations[icfg]; - fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); - } - fprintf ( OUT, "\t\t</Unit>\r\n" ); - } - - fprintf ( OUT, "\t\t<Extensions />\r\n" ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const CBConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); + } + fprintf ( OUT, "\t\t</Unit>\r\n" ); + } + + fprintf ( OUT, "\t\t<Extensions />\r\n" ); fprintf ( OUT, "\t</Project>\r\n" ); fprintf ( OUT, "</CodeBlocks_project_file>\r\n" ); - - - fclose ( OUT ); -} - -CBConfiguration::CBConfiguration ( const OptimizationType optimization, const std::string &name ) -{ - this->optimization = optimization; - if ( name != "" ) - this->name = name; - else - { - if ( optimization == Debug ) - this->name = "Debug"; - else if ( optimization == Release ) - this->name = "Release"; - else - this->name = "Unknown"; - } -} + + + fclose ( OUT ); +} + +CBConfiguration::CBConfiguration ( const OptimizationType optimization, const std::string &name ) +{ + this->optimization = optimization; + if ( name != "" ) + this->name = name; + else + { + if ( optimization == Debug ) + this->name = "Debug"; + else if ( optimization == Release ) + this->name = "Release"; + else + this->name = "Unknown"; + } +} Propchange: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
============================================================================== --- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h (original) +++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h Wed Nov 22 18:23:17 2006 @@ -1,101 +1,101 @@ -/* - * Copyright (C) 2005 Trevor McCort - * Copyright (C) 2005 Casper S. Hornstrup - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef __CODEBLOCKS_H__ -#define __CODEBLOCKS_H__ - -#include <fstream> -#include <vector> -#include <string> - -#include "../backend.h" - -class FileUnit -{ - public: - std::string filename; - std::string folder; -}; - -enum OptimizationType -{ - Debug, - Release -}; - -class CBConfiguration -{ - public: - CBConfiguration(const OptimizationType optimization, - const std::string &name = ""); - virtual ~CBConfiguration() {} - std::string name; - OptimizationType optimization; -}; - -class CBBackend : public Backend -{ - public: - - CBBackend(Project &project, - Configuration& configuration); - virtual ~CBBackend() {} - - virtual void Process(); - - private: - - void ProcessModules(); - void ProcessFile(std::string &filename); - - bool CheckFolderAdded(std::string &folder); - void AddFolders(std::string &folder); - - void OutputFolders(); - void OutputFileUnits(); - - std::string CbpFileName ( const Module& module ) const; - std::string LayoutFileName ( const Module& module ) const; - std::string DependFileName ( const Module& module ) const; - - std::vector<CBConfiguration*> m_configurations; - - std::vector<FileUnit> m_fileUnits; - std::vector<std::string> m_folders; - - int m_unitCount; - - FILE* m_wrkspaceFile; - - std::string _replace_str( - std::string string1, - const std::string &find_str, - const std::string &replace_str); - - void _generate_workspace ( FILE* OUT ); - void _generate_cbproj ( const Module& module ); - - void _clean_project_files ( void ); - void _get_object_files ( const Module& module, std::vector<std::string>& out ) const; - void _install_files ( const std::string& vcdir, const std::string& config ); - bool _copy_file ( const std::string& inputname, const std::string& targetname ) const; - const Property* _lookup_property ( const Module& module, const std::string& name ) const; -}; - -#endif // __MSVC_H__ - +/* + * Copyright (C) 2005 Trevor McCort + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef __CODEBLOCKS_H__ +#define __CODEBLOCKS_H__ + +#include <fstream> +#include <vector> +#include <string> + +#include "../backend.h" + +class FileUnit +{ + public: + std::string filename; + std::string folder; +}; + +enum OptimizationType +{ + Debug, + Release +}; + +class CBConfiguration +{ + public: + CBConfiguration(const OptimizationType optimization, + const std::string &name = ""); + virtual ~CBConfiguration() {} + std::string name; + OptimizationType optimization; +}; + +class CBBackend : public Backend +{ + public: + + CBBackend(Project &project, + Configuration& configuration); + virtual ~CBBackend() {} + + virtual void Process(); + + private: + + void ProcessModules(); + void ProcessFile(std::string &filename); + + bool CheckFolderAdded(std::string &folder); + void AddFolders(std::string &folder); + + void OutputFolders(); + void OutputFileUnits(); + + std::string CbpFileName ( const Module& module ) const; + std::string LayoutFileName ( const Module& module ) const; + std::string DependFileName ( const Module& module ) const; + + std::vector<CBConfiguration*> m_configurations; + + std::vector<FileUnit> m_fileUnits; + std::vector<std::string> m_folders; + + int m_unitCount; + + FILE* m_wrkspaceFile; + + std::string _replace_str( + std::string string1, + const std::string &find_str, + const std::string &replace_str); + + void _generate_workspace ( FILE* OUT ); + void _generate_cbproj ( const Module& module ); + + void _clean_project_files ( void ); + void _get_object_files ( const Module& module, std::vector<std::string>& out ) const; + void _install_files ( const std::string& vcdir, const std::string& config ); + bool _copy_file ( const std::string& inputname, const std::string& targetname ) const; + const Property* _lookup_property ( const Module& module, const std::string& name ) const; +}; + +#endif // __MSVC_H__ + Propchange: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h ------------------------------------------------------------------------------ svn:eol-style = native
18 years, 1 month
1
0
0
0
[cwittich] 24799: Code::Blocks backend
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Nov 22 18:18:51 2006 New Revision: 24799 URL:
http://svn.reactos.org/svn/reactos?rev=24799&view=rev
Log: Code::Blocks backend Added: trunk/reactos/tools/rbuild/backend/codeblocks/ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h Modified: trunk/reactos/Makefile trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp trunk/reactos/tools/rbuild/configuration.cpp trunk/reactos/tools/rbuild/rbuild.cpp trunk/reactos/tools/rbuild/rbuild.h trunk/reactos/tools/rbuild/rbuild.mak Modified: trunk/reactos/Makefile URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/Makefile?rev=24799&r1=2479…
============================================================================== --- trunk/reactos/Makefile (original) +++ trunk/reactos/Makefile Wed Nov 22 18:18:51 2006 @@ -424,6 +424,12 @@ $(MAKE) bootcdregtest $(rm) $(OUTPUT_)cd$(SEP)reactos$(SEP)unattend.inf +.PHONY: cb +cb: $(RBUILD_TARGET) + $(ECHO_RBUILD) + $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) cb + + .PHONY: msvc msvc: $(RBUILD_TARGET) $(ECHO_RBUILD) Added: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
============================================================================== --- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (added) +++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Wed Nov 22 18:18:51 2006 @@ -1,0 +1,544 @@ +/* + * Copyright (C) 2006 Christoph von Wittich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +#include <stdio.h> + +#include "codeblocks.h" +#include "../mingw/mingw.h" + +using std::string; +using std::vector; +using std::ifstream; + +#ifdef OUT +#undef OUT +#endif//OUT + + +static class CBFactory : public Backend::Factory +{ + public: + + CBFactory() : Factory("CB", "Code::Blocks") {} + Backend *operator() (Project &project, + Configuration& configuration) + { + return new CBBackend(project, configuration); + } + +} factory; + + +CBBackend::CBBackend(Project &project, + Configuration& configuration) : Backend(project, configuration) +{ + m_unitCount = 0; +} + +void CBBackend::Process() +{ + + while ( m_configurations.size () > 0 ) + { + const CBConfiguration* cfg = m_configurations.back(); + m_configurations.pop_back(); + delete cfg; + } + + m_configurations.push_back ( new CBConfiguration( Debug )); + m_configurations.push_back ( new CBConfiguration( Release )); + + string filename_wrkspace ( ProjectNode.name ); + filename_wrkspace += "_auto.workspace"; + + printf ( "Creating Code::Blocks workspace: %s\n", filename_wrkspace.c_str() ); + + ProcessModules(); + m_wrkspaceFile = fopen ( filename_wrkspace.c_str(), "wb" ); + + if ( !m_wrkspaceFile ) + { + printf ( "Could not create file '%s'.\n", filename_wrkspace.c_str() ); + return; + } + + _generate_workspace ( m_wrkspaceFile ); + + fclose ( m_wrkspaceFile ); + printf ( "Done.\n" ); +} + +void CBBackend::ProcessModules() +{ + for(size_t i = 0; i < ProjectNode.modules.size(); i++) + { + Module &module = *ProjectNode.modules[i]; + _generate_cbproj ( module ); + } +} + +static bool FileExists(string &filename) +{ + ifstream file(filename.c_str()); + + if(!file.is_open()) + return false; + + file.close(); + return true; +} + +void CBBackend::ProcessFile(string &filepath) +{ + // Remove the .\ at the start of the filenames + if ( filepath[0] == '.' && strchr ( "/\\", filepath[1] ) ) + filepath.erase(0, 2); + + if(!FileExists(filepath)) + return; + + // Change the \ to / + for(size_t i = 0; i < filepath.length(); i++) + { + if(filepath[i] == '\\') + filepath[i] = '/'; + } + + // Remove the filename from the path + string folder = ""; + + size_t pos = filepath.rfind(string("/"), filepath.length() - 1); + + if(pos != string::npos) + { + folder = filepath; + folder.erase(pos, folder.length() - pos); + } + + FileUnit fileUnit; + fileUnit.filename = filepath; + fileUnit.folder = folder; + + m_fileUnits.push_back(fileUnit); + + if(folder != "") + AddFolders(folder); + + m_unitCount++; +} + +bool CBBackend::CheckFolderAdded(string &folder) +{ + for(size_t i = 0; i < m_folders.size(); i++) + { + if(m_folders[i] == folder) + return true; + } + + return false; +} + +void CBBackend::AddFolders(string &folder) +{ + // Check if this folder was already added. true if it was, false otherwise. + if(CheckFolderAdded(folder)) + return; + + m_folders.push_back(folder); + + size_t pos = folder.rfind(string("/"), folder.length() - 1); + + if(pos == string::npos) + return; + + folder.erase(pos, folder.length() - pos); + AddFolders(folder); +} + +void CBBackend::OutputFolders() +{ +#if 0 + m_devFile << "Folders="; + + for(size_t i = 0; i < m_folders.size(); i++) + { + if(i > 0) + m_devFile << ","; + + m_devFile << m_folders[i]; + } +#endif +} + +std::string +CBBackend::CbpFileName ( const Module& module ) const +{ + return DosSeparator( + ReplaceExtension ( module.GetPath(), + "_auto.cbp" ) + ); +} + +std::string +CBBackend::LayoutFileName ( const Module& module ) const +{ + return DosSeparator( + ReplaceExtension ( module.GetPath(), + "_auto.layout" ) + ); +} + +std::string +CBBackend::DependFileName ( const Module& module ) const +{ + return DosSeparator( + ReplaceExtension ( module.GetPath(), + "_auto.depend" ) + ); +} + +void +CBBackend::_get_object_files ( const Module& module, vector<string>& out) const +{ + string basepath = module.GetBasePath (); + size_t i; + string intenv = Environment::GetIntermediatePath () + "\\" + basepath + "\\"; + string outenv = Environment::GetOutputPath () + "\\" + basepath + "\\"; + + vector<string> cfgs; + + if ( configuration.UseConfigurationInPath ) + { + cfgs.push_back ( intenv + "Debug" ); + cfgs.push_back ( intenv + "Release" ); + cfgs.push_back ( outenv + "Debug" ); + cfgs.push_back ( outenv + "Release" ); + } + else + { + cfgs.push_back ( intenv ); + cfgs.push_back ( outenv ); + } + + vector<const IfableData*> ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + while ( ifs_list.size () ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector<File*>& files = data.files; + for ( i = 0; i < files.size (); i++ ) + { + string file = files[i]->name; + string::size_type pos = file.find_last_of ("\\"); + if ( pos != string::npos ) + file.erase ( 0, pos+1 ); + if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + file = ReplaceExtension ( file, ".res" ); + else + file = ReplaceExtension ( file, ".obj" ); + for ( size_t j = 0; j < cfgs.size () / 2; j++ ) + out.push_back ( cfgs[j] + "\\" + file ); + } + + } +} + +void +CBBackend::_clean_project_files ( void ) +{ + for ( size_t i = 0; i < ProjectNode.modules.size(); i++ ) + { + Module& module = *ProjectNode.modules[i]; + vector<string> out; + printf("Cleaning project %s %s\n", module.name.c_str (), module.GetBasePath ().c_str () ); + + string basepath = module.GetBasePath (); + remove ( CbpFileName ( module ).c_str () ); + remove ( DependFileName ( module ).c_str () ); + remove ( LayoutFileName ( module ).c_str () ); + + _get_object_files ( module, out ); + for ( size_t j = 0; j < out.size (); j++) + { + //printf("Cleaning file %s\n", out[j].c_str () ); + remove ( out[j].c_str () ); + } + } + + string filename_wrkspace = ProjectNode.name + ".workspace"; + + remove ( filename_wrkspace.c_str () ); +} + +void +CBBackend::_generate_workspace ( FILE* OUT ) +{ + fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\r\n" ); + fprintf ( OUT, "<CodeBlocks_workspace_file>\r\n" ); + fprintf ( OUT, "\t<Workspace title=\"ReactOS\">\r\n" ); + for ( size_t i = 0; i < ProjectNode.modules.size(); i++ ) + { + Module& module = *ProjectNode.modules[i]; + + std::string Cbp_file = CbpFileName ( module ); + fprintf ( OUT, "\t\t<Project filename=\"%s\" />\r\n", Cbp_file.c_str()); + + } + fprintf ( OUT, "\t</Workspace>\r\n" ); + fprintf ( OUT, "</CodeBlocks_workspace_file>\r\n" ); +} + +void +CBBackend::_generate_cbproj ( const Module& module ) +{ + + size_t i; + + string cbproj_file = CbpFileName(module); + string outdir; + string intdir; + string path_basedir = module.GetPathToBaseDir (); + string intenv = Environment::GetIntermediatePath (); + string outenv = Environment::GetOutputPath (); + string module_type = GetExtension(module.GetTargetName()); + string cbproj_path = module.GetBasePath(); + + //bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a"); + //bool dll = (module_type == ".dll") || (module_type == ".cpl"); + bool exe = (module_type == ".exe") || (module_type == ".scr"); + //bool sys = (module_type == ".sys"); + + vector<string> source_files, resource_files, includes, libraries, libpaths; + vector<string> header_files, common_defines; + + if ( module.pch != NULL ) + { + string pch_path = Path::RelativeFromDirectory ( + module.pch->file.name, + module.GetBasePath() ); + + header_files.push_back ( pch_path ); + } + + if ( intenv == "obj-i386" ) + intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */ + else + intdir = intenv; + + if ( outenv == "output-i386" ) + outdir = path_basedir + "output-i386"; + else + outdir = outenv; + + vector<const IfableData*> ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + while ( ifs_list.size() ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector<File*>& files = data.files; + for ( i = 0; i < files.size(); i++ ) + { + string file = string(".") + &files[i]->name[cbproj_path.size()]; + + if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + resource_files.push_back ( file ); + else + source_files.push_back ( file ); + } + const vector<Include*>& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + string path = Path::RelativeFromDirectory ( + incs[i]->directory, + module.GetBasePath() ); + + includes.push_back ( path ); + } + const vector<Library*>& libs = data.libraries; + for ( i = 0; i < libs.size(); i++ ) + { + string libpath = outdir + "\\" + libs[i]->importedModule->GetBasePath() + "\\" + libs[i]->name; + libraries.push_back ( libs[i]->name ); + libpaths.push_back ( libpath ); + } + const vector<Define*>& defs = data.defines; + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->value[0] ) + common_defines.push_back( defs[i]->name + "=" + defs[i]->value ); + else + common_defines.push_back( defs[i]->name ); + } + } + + FILE* OUT = fopen ( cbproj_file.c_str(), "wb" ); + + fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\r\n" ); + fprintf ( OUT, "<CodeBlocks_project_file>\r\n" ); + fprintf ( OUT, "\t<FileVersion major=\"1\" minor=\"5\" />\r\n" ); + fprintf ( OUT, "\t<Project>\r\n" ); + fprintf ( OUT, "\t\t<Option title=\"%s\" />\r\n", module.name.c_str() ); + fprintf ( OUT, "\t\t<Option pch_mode=\"2\" />\r\n" ); + fprintf ( OUT, "\t\t<Option default_target=\"\" />\r\n" ); + fprintf ( OUT, "\t\t<Option compiler=\"gcc\" />\r\n" ); + fprintf ( OUT, "\t\t<Option virtualFolders=\"\" />\r\n" ); + fprintf ( OUT, "\t\t<Build>\r\n" ); + + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const CBConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\t<Target title=\"%s\">\r\n", cfg.name.c_str() ); + + if ( configuration.UseConfigurationInPath ) + { + fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(), module_type.c_str()); + fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str (), cfg.name.c_str() ); + } + else + { + fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() ); + fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str () ); + } + + bool console = exe && (module.type == Win32CUI); + + if ( console ) + fprintf ( OUT, "\t\t\t\t<Option type=\"1\" />\r\n" ); + else /* Win32 GUI */ + fprintf ( OUT, "\t\t\t\t<Option type=\"0\" />\r\n" ); + /* TODO: other subsystems */ + + fprintf ( OUT, "\t\t\t\t<Option compiler=\"gcc\" />\r\n" ); + fprintf ( OUT, "\t\t\t\t<Compiler>\r\n" ); + /* defines */ + for ( i = 0; i < common_defines.size(); i++ ) + { + const string& define = common_defines[i]; + fprintf ( OUT, "\t\t\t\t\t<Add option=\"-D%s\" />\r\n", define.c_str() ); + } + /* includes */ + for ( i = 0; i < includes.size(); i++ ) + { + const string& include = includes[i]; + fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", include.c_str() ); + } + fprintf ( OUT, "\t\t\t\t</Compiler>\r\n" ); + + /* includes */ + fprintf ( OUT, "\t\t\t\t<ResourceCompiler>\r\n" ); + for ( i = 0; i < includes.size(); i++ ) + { + const string& include = includes[i]; + fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", include.c_str() ); + } + fprintf ( OUT, "\t\t\t\t</ResourceCompiler>\r\n" ); + + /* libraries */ + fprintf ( OUT, "\t\t\t\t<Linker>\r\n" ); + for ( i = 0; i < libraries.size(); i++ ) + { + const string& lib = libraries[i]; + fprintf ( OUT, "\t\t\t\t\t<Add library=\"%s\" />\r\n", lib.c_str() ); + } + for ( i = 0; i < libpaths.size(); i++ ) + { + const string& lib = libpaths[i]; + fprintf ( OUT, "\t\t\t\t\t<Add directory=\"%s\" />\r\n", lib.c_str() ); + } + fprintf ( OUT, "\t\t\t\t</Linker>\r\n" ); + + fprintf ( OUT, "\t\t\t</Target>\r\n" ); + + } + fprintf ( OUT, "\t\t</Build>\r\n" ); + + /* header files */ + for ( i = 0; i < header_files.size(); i++ ) + { + const string& header_file = header_files[i]; + fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", header_file.c_str() ); + fprintf ( OUT, "\t\t\t<Option compilerVar=\"CPP\" />\r\n" ); + fprintf ( OUT, "\t\t\t<Option compile=\"0\" />\r\n" ); + fprintf ( OUT, "\t\t\t<Option link=\"0\" />\r\n" ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const CBConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); + } + fprintf ( OUT, "\t\t</Unit>\r\n" ); + } + + /* source files */ + for ( size_t isrcfile = 0; isrcfile < source_files.size(); isrcfile++ ) + { + string source_file = DosSeparator(source_files[isrcfile]); + fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", source_file.c_str() ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const CBConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); + } + fprintf ( OUT, "\t\t</Unit>\r\n" ); + } + + /* resource files */ + for ( i = 0; i < resource_files.size(); i++ ) + { + const string& resource_file = resource_files[i]; + fprintf ( OUT, "\t\t<Unit filename=\"%s\">\r\n", resource_file.c_str() ); + fprintf ( OUT, "\t\t\t<Option compilerVar=\"WINDRES\" />\r\n" ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const CBConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\t<Option target=\"%s\" />\r\n" , cfg.name.c_str() ); + } + fprintf ( OUT, "\t\t</Unit>\r\n" ); + } + + fprintf ( OUT, "\t\t<Extensions />\r\n" ); + fprintf ( OUT, "\t</Project>\r\n" ); + fprintf ( OUT, "</CodeBlocks_project_file>\r\n" ); + + + fclose ( OUT ); +} + +CBConfiguration::CBConfiguration ( const OptimizationType optimization, const std::string &name ) +{ + this->optimization = optimization; + if ( name != "" ) + this->name = name; + else + { + if ( optimization == Debug ) + this->name = "Debug"; + else if ( optimization == Release ) + this->name = "Release"; + else + this->name = "Unknown"; + } +} Added: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
============================================================================== --- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h (added) +++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.h Wed Nov 22 18:18:51 2006 @@ -1,0 +1,101 @@ +/* + * Copyright (C) 2005 Trevor McCort + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef __CODEBLOCKS_H__ +#define __CODEBLOCKS_H__ + +#include <fstream> +#include <vector> +#include <string> + +#include "../backend.h" + +class FileUnit +{ + public: + std::string filename; + std::string folder; +}; + +enum OptimizationType +{ + Debug, + Release +}; + +class CBConfiguration +{ + public: + CBConfiguration(const OptimizationType optimization, + const std::string &name = ""); + virtual ~CBConfiguration() {} + std::string name; + OptimizationType optimization; +}; + +class CBBackend : public Backend +{ + public: + + CBBackend(Project &project, + Configuration& configuration); + virtual ~CBBackend() {} + + virtual void Process(); + + private: + + void ProcessModules(); + void ProcessFile(std::string &filename); + + bool CheckFolderAdded(std::string &folder); + void AddFolders(std::string &folder); + + void OutputFolders(); + void OutputFileUnits(); + + std::string CbpFileName ( const Module& module ) const; + std::string LayoutFileName ( const Module& module ) const; + std::string DependFileName ( const Module& module ) const; + + std::vector<CBConfiguration*> m_configurations; + + std::vector<FileUnit> m_fileUnits; + std::vector<std::string> m_folders; + + int m_unitCount; + + FILE* m_wrkspaceFile; + + std::string _replace_str( + std::string string1, + const std::string &find_str, + const std::string &replace_str); + + void _generate_workspace ( FILE* OUT ); + void _generate_cbproj ( const Module& module ); + + void _clean_project_files ( void ); + void _get_object_files ( const Module& module, std::vector<std::string>& out ) const; + void _install_files ( const std::string& vcdir, const std::string& config ); + bool _copy_file ( const std::string& inputname, const std::string& targetname ) const; + const Property* _lookup_property ( const Module& module, const std::string& name ) const; +}; + +#endif // __MSVC_H__ + Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp (original) +++ trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp Wed Nov 22 18:18:51 2006 @@ -310,7 +310,7 @@ vector<string> cfgs; - if ( configuration.UseVSConfigurationInPath ) + if ( configuration.UseConfigurationInPath ) { cfgs.push_back ( intenv + "Debug" ); cfgs.push_back ( intenv + "Release" ); Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp (original) +++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Wed Nov 22 18:18:51 2006 @@ -238,7 +238,7 @@ fprintf ( OUT, "\t\t<Configuration\r\n" ); fprintf ( OUT, "\t\t\tName=\"%s|Win32\"\r\n", cfg.name.c_str() ); - if ( configuration.UseVSConfigurationInPath ) + if ( configuration.UseConfigurationInPath ) { fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\\%s\"\r\n", outdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str (), cfg.name.c_str() ); fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\\%s\"\r\n", intdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str (), cfg.name.c_str() ); Modified: trunk/reactos/tools/rbuild/configuration.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/configuration…
============================================================================== --- trunk/reactos/tools/rbuild/configuration.cpp (original) +++ trunk/reactos/tools/rbuild/configuration.cpp Wed Nov 22 18:18:51 2006 @@ -30,7 +30,7 @@ MakeHandlesInstallDirectories = false; GenerateProxyMakefilesInSourceTree = false; InstallFiles = false; - UseVSConfigurationInPath = false; + UseConfigurationInPath = false; UseVSVersionInPath = false; } Modified: trunk/reactos/tools/rbuild/rbuild.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.cpp?re…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.cpp (original) +++ trunk/reactos/tools/rbuild/rbuild.cpp Wed Nov 22 18:18:51 2006 @@ -122,7 +122,7 @@ } temp = string (&switchStart[3]); if ( temp.find ("configuration") != string::npos ) - configuration.UseVSConfigurationInPath = true; + configuration.UseConfigurationInPath = true; if ( temp.find ("version") != string::npos ) configuration.UseVSVersionInPath = true; Modified: trunk/reactos/tools/rbuild/rbuild.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.h (original) +++ trunk/reactos/tools/rbuild/rbuild.h Wed Nov 22 18:18:51 2006 @@ -143,7 +143,7 @@ std::string VSProjectVersion; std::string VSConfigurationType; bool UseVSVersionInPath; - bool UseVSConfigurationInPath; + bool UseConfigurationInPath; bool MakeHandlesInstallDirectories; bool GenerateProxyMakefilesInSourceTree; bool InstallFiles; Modified: trunk/reactos/tools/rbuild/rbuild.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.mak?re…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.mak (original) +++ trunk/reactos/tools/rbuild/rbuild.mak Wed Nov 22 18:18:51 2006 @@ -102,6 +102,24 @@ ${mkdir} $@ endif +RBUILD_CODEBLOCKS_BASE = $(RBUILD_BACKEND_BASE_)codeblocks +RBUILD_CODEBLOCKS_BASE_ = $(RBUILD_CODEBLOCKS_BASE)$(SEP) +RBUILD_CODEBLOCKS_INT = $(INTERMEDIATE_)$(RBUILD_CODEBLOCKS_BASE) +RBUILD_CODEBLOCKS_INT_ = $(RBUILD_CODEBLOCKS_INT)$(SEP) +RBUILD_CODEBLOCKS_OUT = $(OUTPUT_)$(RBUILD_CODEBLOCKS_BASE) +RBUILD_CODEBLOCKS_OUT_ = $(RBUILD_CODEBLOCKS_OUT)$(SEP) + +$(RBUILD_CODEBLOCKS_INT): | $(RBUILD_BACKEND_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_CODEBLOCKS_OUT): | $(RBUILD_BACKEND_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + + RBUILD_MSVC_BASE = $(RBUILD_BACKEND_BASE_)msvc RBUILD_MSVC_BASE_ = $(RBUILD_MSVC_BASE)$(SEP) RBUILD_MSVC_INT = $(INTERMEDIATE_)$(RBUILD_MSVC_BASE) @@ -136,6 +154,10 @@ devcpp.cpp \ ) +RBUILD_BACKEND_CODEBLOCKS_BASE_SOURCES = $(addprefix $(RBUILD_CODEBLOCKS_BASE_), \ + codeblocks.cpp \ + ) + RBUILD_BACKEND_MSVC_BASE_SOURCES = $(addprefix $(RBUILD_MSVC_BASE_), \ genguid.cpp \ msvc.cpp \ @@ -147,6 +169,7 @@ $(RBUILD_BACKEND_MINGW_BASE_SOURCES) \ $(RBUILD_BACKEND_DEVCPP_BASE_SOURCES) \ $(RBUILD_BACKEND_MSVC_BASE_SOURCES) \ + $(RBUILD_BACKEND_CODEBLOCKS_BASE_SOURCES) \ $(RBUILD_BACKEND_BASE_)backend.cpp RBUILD_COMMON_SOURCES = \ @@ -199,6 +222,9 @@ RBUILD_BACKEND_MSVCCPP_HEADERS = \ msvc.h +RBUILD_BACKEND_CODEBLOCKS_HEADERS = \ + codeblocks.h + RBUILD_BACKEND_MINGW_HEADERS = \ mingw.h \ modulehandler.h @@ -207,7 +233,8 @@ backend.h \ $(addprefix devcpp$(SEP), $(RBUILD_BACKEND_DEVCPP_HEADERS)) \ $(addprefix msvc$(SEP), $(RBUILD_BACKEND_MSVC_HEADERS)) \ - $(addprefix mingw$(SEP), $(RBUILD_BACKEND_MINGW_HEADERS)) + $(addprefix mingw$(SEP), $(RBUILD_BACKEND_MINGW_HEADERS)) \ + $(addprefix codeblocks$(SEP), $(RBUILD_BACKEND_CODEBLOCKS_HEADERS)) RBUILD_HEADERS = \ $(addprefix $(RBUILD_BASE_), \ @@ -372,6 +399,10 @@ $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ +$(RBUILD_CODEBLOCKS_INT_)codeblocks.o: $(RBUILD_CODEBLOCKS_BASE_)codeblocks.cpp $(RBUILD_HEADERS) | $(RBUILD_CODEBLOCKS_INT) + $(ECHO_CC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + $(RBUILD_MSVC_INT_)genguid.o: $(RBUILD_MSVC_BASE_)genguid.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
18 years, 1 month
1
0
0
0
[fireball] 24798: The code expects synchronous behaviour here, so until a better solution exists, IoSynchronousInvalidateDeviceRelations() is going to be used. This fixes the "Loading ndis.sys" problems. Thanks to Dmitry Gorbachev, confirmed by Herve Poussineau. See issue #1875 for more details.
by fireball@svn.reactos.org
Author: fireball Date: Wed Nov 22 13:15:51 2006 New Revision: 24798 URL:
http://svn.reactos.org/svn/reactos?rev=24798&view=rev
Log: The code expects synchronous behaviour here, so until a better solution exists, IoSynchronousInvalidateDeviceRelations() is going to be used. This fixes the "Loading ndis.sys" problems. Thanks to Dmitry Gorbachev, confirmed by Herve Poussineau. See issue #1875 for more details. Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Wed Nov 22 13:15:51 2006 @@ -43,6 +43,13 @@ IN PDEVICE_OBJECT DeviceObject, IN PVOID InvalidateContext); +VOID +NTAPI +IoSynchronousInvalidateDeviceRelations( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_RELATION_TYPE Type); + + /* FUNCTIONS *****************************************************************/ PDEVICE_NODE @@ -144,7 +151,9 @@ if (IopDeviceNodeHasFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY)) { DPRINT("Device needs enumeration, invalidating bus relations\n"); - IoInvalidateDeviceRelations(DeviceNode->PhysicalDeviceObject, BusRelations); + /* Invalidate device relations synchronously + (otherwise there will be dirty read of DeviceNode) */ + IoSynchronousInvalidateDeviceRelations(DeviceNode->PhysicalDeviceObject, BusRelations); IopDeviceNodeClearFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY); } }
18 years, 1 month
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
33
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Results per page:
10
25
50
100
200