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
2025
January
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
January 2006
----- 2025 -----
January 2025
----- 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
23 participants
586 discussions
Start a n
N
ew thread
[mbosma] 20543: fix typos.
by mbosma@svn.reactos.org
fix typos. Modified: trunk/rosapps/packmgr/gui/main.c Modified: trunk/rosapps/packmgr/lib/de.rc Modified: trunk/rosapps/packmgr/tree/7zip.inst.rps Deleted: trunk/rosapps/packmgr/tree/mozcontrol.xml Deleted: trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps Modified: trunk/rosapps/packmgr/tree/putty.inst.rps Modified: trunk/rosapps/packmgr/tree/tiny.xml Modified: trunk/rosapps/packmgr/tree/tree.xml Modified: trunk/rosapps/packmgr/tree/tree_bare.xml _____ Modified: trunk/rosapps/packmgr/gui/main.c --- trunk/rosapps/packmgr/gui/main.c 2006-01-03 00:24:37 UTC (rev 20542) +++ trunk/rosapps/packmgr/gui/main.c 2006-01-03 11:49:59 UTC (rev 20543) @@ -1,453 +1,453 @@ -//////////////////////////////////////////////////////// -// -// main.cpp -// -// Implementation of the Package Manager GUI -// -// -// Maarten Bosma, 09.01.2004 -// maarten.paul(a)bosma.de -// -//////////////////////////////////////////////////////////////////// - -#include "main.h" - -// This is the struct where the toolbar is defined -const TBBUTTON Buttons [] = -{ - {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, - - {0, 1, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // No Action - {1, 2, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Install - {2, 3, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Install from source - {3, 4, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Update - {4, 5, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Unistall - - {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, - {5, 6, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // DoIt (tm) - {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, - - {6, 7, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // Help - {7, 8, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // Options - - {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, -}; - - -// Application's Entry Point -int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) -{ - HWND hwnd; - MSG msg; - WNDCLASSEX wc = {0}; - WCHAR errbuf[2000]; - - // Window creation - wc.cbSize = sizeof(WNDCLASSEX); - wc.lpszClassName = L"pgkmgr"; - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = (WNDPROC)WndProc; - wc.hInstance = hinst; - wc.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(IDI_MAIN)); - wc.hbrBackground = (HBRUSH)(COLOR_SCROLLBAR); - - RegisterClassEx(&wc); - - hwnd = CreateWindow(L"pgkmgr", - L"ReactOS - Package Manager v0.3", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - 500, 600, - NULL, NULL, - hinst, - NULL); - - - // Toolbar creation - InitCommonControls(); - - hTBar = CreateToolbarEx(hwnd, WS_CHILD|WS_VISIBLE|TBSTYLE_FLAT, 0, 8, hinst, IDB_TOOLBAR, - Buttons, sizeof(Buttons)/sizeof(TBBUTTON), TBSIZE, TBSIZE, TBSIZE, TBSIZE, sizeof(TBBUTTON)); - - // Show the windows - ShowWindow(hwnd, SW_SHOW); - UpdateWindow(hwnd); - - // Load the tree - int error = PML_LoadTree(&tree, "tree_bare.xml", AddItem); - - if(error) - { - MessageBox(0,PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0); - return 0; - } - - // Read the help - Help(); - - // Start getting messages - while(GetMessage(&msg,NULL,0,0)) - { - if(!TranslateAccelerator(hwnd, hHotKeys, &msg)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - - // Close our handle - PML_CloseTree (tree); - - return 0; -} - -// Add a item to our tree -int AddItem (int id, const char* name, int parent, int icon) -{ - TV_INSERTSTRUCT tvins; - - tvins.item.lParam = (UINT)id; - tvins.item.mask = TVIF_TEXT|TVIF_PARAM; - tvins.item.pszText = (WCHAR*)name; //that is ok - tvins.item.cchTextMax = strlen(name); - tvins.hInsertAfter = TVI_LAST; - - if(icon) - { - tvins.item.iImage = icon; - tvins.item.iSelectedImage = icon; - tvins.item.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE; - } - - if (parent==0) - tvins.hParent = TVI_ROOT; - else - tvins.hParent = nodes[parent]; - - nodes[id] = (HTREEITEM)SendMessage(hTree, TVM_INSERTITEMA, 0, (LPARAM)&tvins); - - return 0; -} - -// Load the Help from file and display it -void Help (void) -{ - int i; - char buffer [2000]; - FILE* file = fopen ("help.txt", "r"); - - if(!file) - return; - - for(i=0; i<2000; i++) - { - buffer[i] = getc(file); - if(buffer[i]==EOF) break; - } - buffer[i] = 0; - - SetText(buffer); -} - -// Create our Controls -void InitControls (HWND hwnd) -{ - - HINSTANCE hinst = GetModuleHandle(NULL); - WCHAR errbuf[2000]; - - // Create the controls - hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTON S, - 0, 0, 0, 0, hwnd, NULL, hinst, NULL); - - hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD, errbuf, sizeof(errbuf)/sizeof(WCHAR)), WS_CHILD|WS_VISIBLE|ES_MULTILINE, - 0, 0, 100, 100, hwnd, NULL, hinst, NULL); - - hPopup = LoadMenu(hinst, MAKEINTRESOURCE(IDR_POPUP)); - - // Create Tree Icons - HIMAGELIST hIcon = ImageList_Create(16,16,ILC_COLOR32,1,1); - SendMessage(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)(HIMAGELIST)hIcon); - - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(1))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(11))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(12))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(13))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(14))); - - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(2))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(3))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(4))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(5))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(6))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(7))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(8))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(9))); - ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10))); - - // Setup Hotkeys - hHotKeys = LoadAccelerators (hinst, MAKEINTRESOURCE(IDR_HOTKEYS)); -} - -// Set the Icons -int SetIcon (int id, int icon) -{ - TVITEMEX item; - - item.hItem = nodes[id]; - item.iImage = icon; - item.iSelectedImage = icon; - item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; - - TreeView_SetItem(hTree, &item); - - return 1; -} - -// Set the Icons -int Ask (const WCHAR* message) -{ - int ans = MessageBox (0,message,0,MB_YESNO); - - if(ans == IDYES) - return 1; - - return 0; -} - -// En- or Disable a Button inside of the toolbar and the Context Menu -int SetButton (DWORD id, BOOL state) -{ - // Change the Toorbar Button - TBBUTTONINFO ti; - - ti.cbSize = sizeof (ti); - ti.dwMask = TBIF_STATE; - - if(state) - ti.fsState = TBSTATE_ENABLED; - else - ti.fsState = TBSTATE_INDETERMINATE; - - SendMessage (hTBar, TB_SETBUTTONINFO, id, (LPARAM)&ti); - - // Change the Context Menu item - MENUITEMINFO mi; - - mi.cbSize = sizeof (mi); - mi.fMask = MIIM_STATE; - - if(state) - mi.fState = MFS_ENABLED; - - else - mi.fState = MFS_GRAYED; - - SetMenuItemInfo(hPopup, id, FALSE, &mi); - - return 0; -} - -// Set the text of the text box -int SetText (const char* text) -{ - int i, j; - char buffer [2000]; - - if(!text) - return 1; - - // the windows does not need "\n" - // for new lines but "\r\n" - for(i=0,j=0; text[i]; i++,j++) - { - buffer[j] = text[i]; - if(buffer[j] == '\n') - { - buffer[j] = '\r'; - buffer[++j] = '\n'; - } - } - buffer[j] = 0; - - SetWindowTextA(hEdit, buffer); - - return 0; -} - -// Windows Message Callback (this is where most things happen) -LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - // at the very beginning ... - case WM_CREATE: - { - InitControls(hwnd); - } - break; - - // calculate the size of the controls - case WM_SIZE: - { - RECT rcl; - SendMessage(hTBar, TB_AUTOSIZE, 0L, 0L); - GetWindowRect(hTBar, &rcl); - - int win_top = rcl.bottom - rcl.top; - int win_hight = HIWORD(lParam) - win_top; - - MoveWindow(hTree, 0, win_top, LOWORD(lParam), splitter_pos*win_hight/100, TRUE); - MoveWindow(hEdit, 0, (splitter_pos*win_hight/100)+win_top, LOWORD(lParam), win_hight, TRUE); - } - break; - - // for the treeview - case WM_NOTIFY: - { - if(((LPNMHDR)lParam)->code == TVN_SELCHANGED) - { - selected = ((LPNMTREEVIEW)lParam)->itemNew.lParam; - PML_LoadPackage (tree, selected, SetButton); - SetText(PML_GetDescription (tree, selected)); - } - - else if ((int)(((LPNMHDR)lParam)->code) == NM_RCLICK) // <= aarrggg LISP - { - // which item has been click on - HTREEITEM item = TreeView_GetDropHilight(hTree); - - if(item != NULL) - { - // mark the one as seleacted - SendMessage (hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)item); - TreeView_EnsureVisible (hTree, item); - } - - // create the context menu - if(selected != 0) - { - POINT pt; - GetCursorPos (&pt); - TrackPopupMenu (GetSubMenu(hPopup, 0), 0, (UINT)pt.x, (UINT)pt.y, 0, hwnd, NULL); - } - } - } - break; - - // for the toolbar - case WM_COMMAND: - { - // All Actions - if(LOWORD(wParam) <= 5 && LOWORD(wParam) >= 1) - { - if(selected) - if(PML_SetAction(tree, selected, LOWORD(wParam)-1, SetIcon, Ask) == ERR_OK) - break; - - MessageBeep(MB_ICONHAND); - } - - // DoIt - else if(LOWORD(wParam)==6) - { - if(PML_DoIt(tree, SetStatus, Ask) == ERR_OK) - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DOIT), hwnd, StatusProc); - else - MessageBeep(MB_ICONHAND); - } - - // Help - else if(LOWORD(wParam)==7) - Help(); - - // Options - else if(LOWORD(wParam)==8) - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_OPTIONS), hwnd, OptionsProc); - } - break; - - // prozess hotkeys - case WM_HOTKEY: - { - if(PML_SetAction(tree, selected, wParam, SetIcon, Ask) != ERR_OK) - MessageBeep(MB_ICONHAND); - } - break; - - // ... at the very end - case WM_DESTROY: - { - PostQuitMessage(0); - return 0; - } - } - - return DefWindowProc (hwnd, message, wParam, lParam); -} - -// Warning: This function is called from another thread -int SetStatus (int status1, int status2, WCHAR* text) -{ - WCHAR errbuf[2000]; - - // Set the Rage to 1000 - SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETRANGE32, 0, 1000); - SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETRANGE32, 0, 1000); - - // The prozessbars and the text filds - if(text) - SetDlgItemText(hStatus, IDC_TSTATUS, text); - - if(status1!=-1) - SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETPOS, status1, 0); - - if(status2!=-1) - SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETPOS, status2, 0); - - // If the Status is 1000 very thing is done - if(status1==1000) - { - EndDialog(hStatus, TRUE); - MessageBox(0,PML_TransError(status2, errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0); - } - - return 0; -} - -// Callback for the Status Dialog -INT_PTR CALLBACK StatusProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) - { - case WM_INITDIALOG: - { - hStatus = hwnd; - - } break; - - case WM_COMMAND: // can only be the about button - case WM_CLOSE: // the close-window-[x] - { - PML_Abort(); - EndDialog(hwnd, TRUE); - return 0; - } - } - - return 0; -} - -// Callback for the Options Dialog -INT_PTR CALLBACK OptionsProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) - { - case WM_CLOSE: - EndDialog(hwnd, TRUE); - return 0; - } - - return 0; -} +//////////////////////////////////////////////////////// +// +// main.cpp +// +// Implementation of the Package Manager GUI +// +// +// Maarten Bosma, 09.01.2004 +// maarten.paul(a)bosma.de +// +//////////////////////////////////////////////////////////////////// + +#include "main.h" + +// This is the struct where the toolbar is defined +const TBBUTTON Buttons [] = +{ + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, + + {0, 1, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // No Action + {1, 2, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Install + {2, 3, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Install from source + {3, 4, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Update + {4, 5, TBSTATE_INDETERMINATE, TBSTYLE_BUTTON}, // Unistall + + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, + {5, 6, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // DoIt (tm) + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, + + {6, 7, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // Help + {7, 8, TBSTATE_ENABLED, TBSTYLE_BUTTON}, // Options + + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}, +}; + + +// Application's Entry Point +int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) +{ + HWND hwnd; + MSG msg; + WNDCLASSEX wc = {0}; + WCHAR errbuf[2000]; + + // Window creation + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpszClassName = L"pgkmgr"; + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = (WNDPROC)WndProc; + wc.hInstance = hinst; + wc.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(IDI_MAIN)); + wc.hbrBackground = (HBRUSH)(COLOR_SCROLLBAR); + + RegisterClassEx(&wc); + + hwnd = CreateWindow(L"pgkmgr", + L"ReactOS - Package Manager v0.3", + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, + CW_USEDEFAULT, + 500, 600, + NULL, NULL, + hinst, + NULL); + + + // Toolbar creation + InitCommonControls(); + + hTBar = CreateToolbarEx(hwnd, WS_CHILD|WS_VISIBLE|TBSTYLE_FLAT, 0, 8, hinst, IDB_TOOLBAR, + Buttons, sizeof(Buttons)/sizeof(TBBUTTON), TBSIZE, TBSIZE, TBSIZE, TBSIZE, sizeof(TBBUTTON)); + + // Show the windows + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + + // Load the tree + int error = PML_LoadTree(&tree, "tree_bare.xml", AddItem); + + if(error) + { + MessageBox(0,PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0); + return 0; + } + + // Read the help + Help(); + + // Start getting messages + while(GetMessage(&msg,NULL,0,0)) + { + if(!TranslateAccelerator(hwnd, hHotKeys, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + // Close our handle + PML_CloseTree (tree); + + return 0; +} + +// Add a item to our tree +int AddItem (int id, const char* name, int parent, int icon) +{ + TV_INSERTSTRUCT tvins; + + tvins.item.lParam = (UINT)id; + tvins.item.mask = TVIF_TEXT|TVIF_PARAM; + tvins.item.pszText = (WCHAR*)name; //that is ok + tvins.item.cchTextMax = strlen(name); + tvins.hInsertAfter = TVI_LAST; + + if(icon) + { + tvins.item.iImage = icon; + tvins.item.iSelectedImage = icon; + tvins.item.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE; + } + + if (parent==0) + tvins.hParent = TVI_ROOT; + else + tvins.hParent = nodes[parent]; + + nodes[id] = (HTREEITEM)SendMessage(hTree, TVM_INSERTITEMA, 0, (LPARAM)&tvins); + + return 0; +} + +// Load the Help from file and display it +void Help (void) +{ + int i; + char buffer [2000]; + FILE* file = fopen ("help.txt", "r"); + + if(!file) + return; + + for(i=0; i<2000; i++) + { + buffer[i] = getc(file); + if(buffer[i]==EOF) break; + } + buffer[i] = 0; + + SetText(buffer); +} + +// Create our Controls +void InitControls (HWND hwnd) +{ + + HINSTANCE hinst = GetModuleHandle(NULL); + WCHAR errbuf[2000]; + + // Create the controls + hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTON S, + 0, 0, 0, 0, hwnd, NULL, hinst, NULL); + + hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD, errbuf, sizeof(errbuf)/sizeof(WCHAR)), WS_CHILD|WS_VISIBLE|ES_MULTILINE, + 0, 0, 100, 100, hwnd, NULL, hinst, NULL); + + hPopup = LoadMenu(hinst, MAKEINTRESOURCE(IDR_POPUP)); + + // Create Tree Icons + HIMAGELIST hIcon = ImageList_Create(16,16,ILC_COLOR32,1,1); + SendMessage(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)(HIMAGELIST)hIcon); + + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(1))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(11))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(12))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(13))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(14))); + + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(2))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(3))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(4))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(5))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(6))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(7))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(8))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(9))); + ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10))); + + // Setup Hotkeys + hHotKeys = LoadAccelerators (hinst, MAKEINTRESOURCE(IDR_HOTKEYS)); +} + +// Set the Icons +int SetIcon (int id, int icon) +{ + TVITEMEX item; + + item.hItem = nodes[id]; + item.iImage = icon; + item.iSelectedImage = icon; + item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; + + TreeView_SetItem(hTree, &item); + + return 1; +} + +// Set the Icons +int Ask (const WCHAR* message) +{ + int ans = MessageBox (0,message,0,MB_YESNO); + + if(ans == IDYES) + return 1; + + return 0; +} + +// En- or Disable a Button inside of the toolbar and the Context Menu +int SetButton (DWORD id, BOOL state) +{ + // Change the Toorbar Button + TBBUTTONINFO ti; + + ti.cbSize = sizeof (ti); + ti.dwMask = TBIF_STATE; + + if(state) + ti.fsState = TBSTATE_ENABLED; + else + ti.fsState = TBSTATE_INDETERMINATE; + + SendMessage (hTBar, TB_SETBUTTONINFO, id, (LPARAM)&ti); + + // Change the Context Menu item + MENUITEMINFO mi; + + mi.cbSize = sizeof (mi); + mi.fMask = MIIM_STATE; + + if(state) + mi.fState = MFS_ENABLED; + + else + mi.fState = MFS_GRAYED; + + SetMenuItemInfo(hPopup, id, FALSE, &mi); + + return 0; +} + +// Set the text of the text box +int SetText (const char* text) +{ + int i, j; + char buffer [2000]; + + if(!text) + return 1; + + // the windows does not need "\n" + // for new lines but "\r\n" + for(i=0,j=0; text[i]; i++,j++) + { + buffer[j] = text[i]; + if(buffer[j] == '\n') + { + buffer[j] = '\r'; + buffer[++j] = '\n'; + } + } + buffer[j] = 0; + + SetWindowTextA(hEdit, buffer); + + return 0; +} + +// Windows Message Callback (this is where most things happen) +LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + // at the very beginning ... + case WM_CREATE: + { + InitControls(hwnd); + } + break; + + // calculate the size of the controls + case WM_SIZE: + { + RECT rcl; + SendMessage(hTBar, TB_AUTOSIZE, 0L, 0L); + GetWindowRect(hTBar, &rcl); + + int win_top = rcl.bottom - rcl.top; + int win_hight = HIWORD(lParam) - win_top; + + MoveWindow(hTree, 0, win_top, LOWORD(lParam), splitter_pos*win_hight/100, TRUE); + MoveWindow(hEdit, 0, (splitter_pos*win_hight/100)+win_top, LOWORD(lParam), win_hight, TRUE); + } + break; + + // for the treeview + case WM_NOTIFY: + { + if(((LPNMHDR)lParam)->code == TVN_SELCHANGED) + { + selected = ((LPNMTREEVIEW)lParam)->itemNew.lParam; + PML_LoadPackage (tree, selected, SetButton); + SetText(PML_GetDescription (tree, selected)); + } + + else if ((int)(((LPNMHDR)lParam)->code) == NM_RCLICK) // <= aarrggg LISP + { + // which item has been click on + HTREEITEM item = TreeView_GetDropHilight(hTree); + + if(item != NULL) + { + // mark the one as seleacted + SendMessage (hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)item); + TreeView_EnsureVisible (hTree, item); + } + + // create the context menu + if(selected != 0) + { + POINT pt; + GetCursorPos (&pt); + TrackPopupMenu (GetSubMenu(hPopup, 0), 0, (UINT)pt.x, (UINT)pt.y, 0, hwnd, NULL); + } + } + } + break; + + // for the toolbar + case WM_COMMAND: + { + // All Actions + if(LOWORD(wParam) <= 5 && LOWORD(wParam) >= 1) + { + if(selected) + if(PML_SetAction(tree, selected, LOWORD(wParam)-1, SetIcon, Ask) == ERR_OK) + break; + + MessageBeep(MB_ICONHAND); + } + + // DoIt + else if(LOWORD(wParam)==6) + { + if(PML_DoIt(tree, SetStatus, Ask) == ERR_OK) + DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DOIT), hwnd, StatusProc); + else + MessageBeep(MB_ICONHAND); + } + + // Help + else if(LOWORD(wParam)==7) + Help(); + + // Options + else if(LOWORD(wParam)==8) + DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_OPTIONS), hwnd, OptionsProc); + } + break; + + // prozess hotkeys + case WM_HOTKEY: + { + if(PML_SetAction(tree, selected, wParam, SetIcon, Ask) != ERR_OK) + MessageBeep(MB_ICONHAND); + } + break; + + // ... at the very end + case WM_DESTROY: + { + PostQuitMessage(0); + return 0; + } + } + + return DefWindowProc (hwnd, message, wParam, lParam); +} + +// Warning: This function is called from another thread +int SetStatus (int status1, int status2, WCHAR* text) +{ + WCHAR errbuf[2000]; + + // Set the Rage to 1000 + SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETRANGE32, 0, 1000); + SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETRANGE32, 0, 1000); + + // The prozessbars and the text filds + if(text) + SetDlgItemText(hStatus, IDC_TSTATUS, text); + + if(status1!=-1) + SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETPOS, status1, 0); + + if(status2!=-1) + SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETPOS, status2, 0); + + // If the Status is 1000 everything is done + if(status1==1000) + { + EndDialog(hStatus, TRUE); + MessageBox(0,PML_TransError(status2, errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0); + } + + return 0; +} + +// Callback for the Status Dialog +INT_PTR CALLBACK StatusProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_INITDIALOG: + { + hStatus = hwnd; + + } break; + + case WM_COMMAND: // can only be the about button + case WM_CLOSE: // the close-window-[x] + { + PML_Abort(); + EndDialog(hwnd, TRUE); + return 0; + } + } + + return 0; +} + +// Callback for the Options Dialog +INT_PTR CALLBACK OptionsProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_CLOSE: + EndDialog(hwnd, TRUE); + return 0; + } + + return 0; +} Property changes on: trunk/rosapps/packmgr/gui/main.c ___________________________________________________________________ Name: svn:eol-style - native _____ Modified: trunk/rosapps/packmgr/lib/de.rc --- trunk/rosapps/packmgr/lib/de.rc 2006-01-03 00:24:37 UTC (rev 20542) +++ trunk/rosapps/packmgr/lib/de.rc 2006-01-03 11:49:59 UTC (rev 20543) @@ -8,7 +8,7 @@ ERR_OK "Fertig." ERR_PACK "Es konnten nicht alle Packages installiert werden.\n\nF³r mehr Details schauen Sie bitte in ""logfile.html""." ERR_GENERIC "Ein Fehler ist aufgetreten. \nnF³r mehr Details schauen Sie bitte in ""logfile.html""." - ERR_DOWNL "Eine ben÷tigte Datei konnte nicht runtergeladen werden!\nnF³r mehr Details schauen Sie bitte in ""logfile.html""." + ERR_DOWNL "Eine ben÷tigte Datei konnte nicht runtergeladen werden!\nF³r mehr Details schauen Sie bitte in ""logfile.html""." ERR_FILE "Bei der Scriptausf³rhung trat ein Fehler auf.\nDatei konnte nicht ge÷ffnet werden." ERR_SYNATX "Bei der Scriptausf³rhung trat ein Fehler auf.\nSynatx-Fehler." _____ Modified: trunk/rosapps/packmgr/tree/7zip.inst.rps --- trunk/rosapps/packmgr/tree/7zip.inst.rps 2006-01-03 00:24:37 UTC (rev 20542) +++ trunk/rosapps/packmgr/tree/7zip.inst.rps 2006-01-03 11:49:59 UTC (rev 20543) @@ -1,9 +1,9 @@ Sub Main ' ToDo: Choose from different mirrors - download "
http://prdownloads.sourceforge.net/sevenzip/7z432.exe?use_mirror=ovh
", "7z432.exe" + download "
http://ovh.dl.sourceforge.net/sourceforge/sevenzip/7z432.exe
", "7z432.exe" End Sub Sub After shell 7z432.exe ' ToDo: Delete 7z432.exe -End Sub \ No newline at end of file +End Sub _____ Deleted: trunk/rosapps/packmgr/tree/mozcontrol.xml --- trunk/rosapps/packmgr/tree/mozcontrol.xml 2006-01-03 00:24:37 UTC (rev 20542) +++ trunk/rosapps/packmgr/tree/mozcontrol.xml 2006-01-03 11:49:59 UTC (rev 20543) @@ -1,11 +0,0 @@ -<!-- -Not in use since reactos can download it itself now. ---> - -<package> - <name>Mozilla Control</name> - <version>1.6</version> - <description>Provides the Gekko Engine for ReactOS.</description> - <scripts inst="mozillacontrol.inst.rps"/> -</package> - _____ Deleted: trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps --- trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps 2006-01-03 00:24:37 UTC (rev 20542) +++ trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps 2006-01-03 11:49:59 UTC (rev 20543) @@ -1,8 +0,0 @@ -' Not in use anymore because reactos can download it without Package Manager -Sub Main - download ("
http://www.iol.ie/~locka/mozilla/MozillaControl16.exe
", "mozillacontrol16.exe") -End Sub - -Sub After - shell mozillacontrol16.exe -End Sub \ No newline at end of file _____ Modified: trunk/rosapps/packmgr/tree/putty.inst.rps --- trunk/rosapps/packmgr/tree/putty.inst.rps 2006-01-03 00:24:37 UTC (rev 20542) +++ trunk/rosapps/packmgr/tree/putty.inst.rps 2006-01-03 11:49:59 UTC (rev 20543) @@ -1,4 +1,4 @@ Sub Main - ' ToDo: Download putty.exe to programm files - download ("
http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
", "putty.exe") -End Sub \ No newline at end of file + ' ToDo: Download putty.exe in own dir + download ("
http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
", "C:\Program Files\putty.exe") +End Sub _____ Modified: trunk/rosapps/packmgr/tree/tiny.xml --- trunk/rosapps/packmgr/tree/tiny.xml 2006-01-03 00:24:37 UTC (rev 20542) +++ trunk/rosapps/packmgr/tree/tiny.xml 2006-01-03 11:49:59 UTC (rev 20543) @@ -1,3 +1,7 @@ +<!-- +ToDo: +Implement Unzipping +--> <package> <name>Ritlab Tiny Webserver</name> <version>1.93</version> [truncated at 1000 lines; 35 more skipped]
19 years
1
0
0
0
[mbosma] 20542: fix spelling mistake.
by mbosma@svn.reactos.org
fix spelling mistake. Modified: trunk/rosapps/packmgr/tree/tree.xml Modified: trunk/rosapps/packmgr/tree/tree_bare.xml _____ Modified: trunk/rosapps/packmgr/tree/tree.xml --- trunk/rosapps/packmgr/tree/tree.xml 2006-01-03 00:17:31 UTC (rev 20541) +++ trunk/rosapps/packmgr/tree/tree.xml 2006-01-03 00:24:37 UTC (rev 20542) @@ -1,6 +1,6 @@ <tree> <node name="Internet and Network" icon="5"> - <node name="Firefox" file="firebox.xml"/> + <node name="Firefox" file="firefox.xml"/> <!--<node name="Mozilla Control" file="mozcontrol.xml"/>--> <node name="Putty" file="putty.xml"/> <node name="Tiny Webserver" file="tiny.xml"/> _____ Modified: trunk/rosapps/packmgr/tree/tree_bare.xml --- trunk/rosapps/packmgr/tree/tree_bare.xml 2006-01-03 00:17:31 UTC (rev 20541) +++ trunk/rosapps/packmgr/tree/tree_bare.xml 2006-01-03 00:24:37 UTC (rev 20542) @@ -2,7 +2,7 @@ <node name="7Zip" file="7zip.xml"/> <node name="AbiWord" file="abiword.xml"/> <node name="Build Envirment" file="rosbe.xml"/> - <node name="Firefox" file="firebox.xml"/> + <node name="Firefox" file="firefox.xml"/> <node name="IrfanView" file="irfanview.xml"/> <!--<node name="mPlayer" file="mplayer.xml"/>--> <!-- ToDo: Choose a good one from all the installers and frondends --> <!--<node name="OpenOffice 1" file="openoffice.xml"/>--> <!-- Needs Zip support -->
19 years
1
0
0
0
[mbosma] 20541: Change URL to svn.reactos.org
by mbosma@svn.reactos.org
Change URL to
svn.reactos.org
Modified: trunk/rosapps/packmgr/lib/options.cpp Modified: trunk/rosapps/packmgr/lib/options.xml _____ Modified: trunk/rosapps/packmgr/lib/options.cpp --- trunk/rosapps/packmgr/lib/options.cpp 2006-01-03 00:12:35 UTC (rev 20540) +++ trunk/rosapps/packmgr/lib/options.cpp 2006-01-03 00:17:31 UTC (rev 20541) @@ -83,7 +83,7 @@ { Log("* Load options.xml from the Internet (Temporary Hack)"); - CopyFileA( PML_Download(tree, "
http://svn.reactos.com/viewcvs/*checkout*/trunk/rosapps/packmgr/lib/opt
ions.xml", NULL, "options.xml"), "options.xml", TRUE); + CopyFileA( PML_Download(tree, "
http://svn.reactos.org/viewcvs/*checkout*/trunk/rosapps/packmgr/lib/opt
ions.xml", NULL, "options.xml"), "options.xml", TRUE); return ERR_OK; } _____ Modified: trunk/rosapps/packmgr/lib/options.xml --- trunk/rosapps/packmgr/lib/options.xml 2006-01-03 00:12:35 UTC (rev 20540) +++ trunk/rosapps/packmgr/lib/options.xml 2006-01-03 00:17:31 UTC (rev 20541) @@ -1,3 +1,3 @@ <options> - <source>
http://svn.reactos.com/viewcvs/*checkout*/trunk/rosapps/packmgr/
tree/</source> + <source>
http://svn.reactos.org/viewcvs/*checkout*/trunk/rosapps/packmgr/
tree/</source> </options> \ No newline at end of file
19 years
1
0
0
0
[mbosma] 20540: Add some Apps and change tree version to the bare one.
by mbosma@svn.reactos.org
Add some Apps and change tree version to the bare one. Modified: trunk/rosapps/packmgr/cmd-line/main.c Modified: trunk/rosapps/packmgr/gui/main.c Added: trunk/rosapps/packmgr/tree/7zip.inst.rps Added: trunk/rosapps/packmgr/tree/7zip.xml Modified: trunk/rosapps/packmgr/tree/abiword.inst.rps Modified: trunk/rosapps/packmgr/tree/abiword.xml Added: trunk/rosapps/packmgr/tree/firefox.inst.rps Added: trunk/rosapps/packmgr/tree/firefox.xml Added: trunk/rosapps/packmgr/tree/irfanview.inst.rps Added: trunk/rosapps/packmgr/tree/irfanview.xml Modified: trunk/rosapps/packmgr/tree/mozcontrol.xml Modified: trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps Added: trunk/rosapps/packmgr/tree/mplayer.inst.rps Added: trunk/rosapps/packmgr/tree/mplayer.xml Added: trunk/rosapps/packmgr/tree/openoffice.inst.rps Added: trunk/rosapps/packmgr/tree/openoffice.xml Added: trunk/rosapps/packmgr/tree/putty.inst.rps Added: trunk/rosapps/packmgr/tree/putty.xml Added: trunk/rosapps/packmgr/tree/rosbe.inst.rps Added: trunk/rosapps/packmgr/tree/rosbe.xml Added: trunk/rosapps/packmgr/tree/tiny.inst.rps Added: trunk/rosapps/packmgr/tree/tiny.xml Modified: trunk/rosapps/packmgr/tree/tree.xml Modified: trunk/rosapps/packmgr/tree/tree_bare.xml Modified: trunk/rosapps/packmgr/tree/tree_withsubs.xml Added: trunk/rosapps/packmgr/tree/tuxpaint.inst.rps Added: trunk/rosapps/packmgr/tree/tuxpaint.xml _____ Modified: trunk/rosapps/packmgr/cmd-line/main.c --- trunk/rosapps/packmgr/cmd-line/main.c 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/cmd-line/main.c 2006-01-03 00:12:35 UTC (rev 20540) @@ -185,7 +185,7 @@ WCHAR errbuf[2000]; // load the tree - error = PML_LoadTree (&tree, "tree.xml", NULL); + error = PML_LoadTree (&tree, "tree_bare.xml", NULL); if(error) { wprintf(PML_TransError(error, errbuf, sizeof(errbuf)/sizeof(WCHAR))); _____ Modified: trunk/rosapps/packmgr/gui/main.c --- trunk/rosapps/packmgr/gui/main.c 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/gui/main.c 2006-01-03 00:12:35 UTC (rev 20540) @@ -75,7 +75,7 @@ UpdateWindow(hwnd); // Load the tree - int error = PML_LoadTree(&tree, "tree.xml", AddItem); + int error = PML_LoadTree(&tree, "tree_bare.xml", AddItem); if(error) { _____ Added: trunk/rosapps/packmgr/tree/7zip.inst.rps --- trunk/rosapps/packmgr/tree/7zip.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/7zip.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,9 @@ +Sub Main + ' ToDo: Choose from different mirrors + download "
http://prdownloads.sourceforge.net/sevenzip/7z432.exe?use_mirror=ovh
", "7z432.exe" +End Sub + +Sub After + shell 7z432.exe + ' ToDo: Delete 7z432.exe +End Sub \ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/7zip.xml --- trunk/rosapps/packmgr/tree/7zip.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/7zip.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,7 @@ +<package> + <name>7Zip</name> + <version>4.32</version> + <description>Utility to create and open zip, tar, rar and other archive files.</description> + <scripts inst="7zip.inst.rps"/> +</package> + _____ Modified: trunk/rosapps/packmgr/tree/abiword.inst.rps --- trunk/rosapps/packmgr/tree/abiword.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/abiword.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -1,9 +1,8 @@ -'Install rutine for abiword - Sub Main - download ("
http://www.abisource.com/downloads/abiword/2.2.5/Windows/abiword-setup
-2.2.5.exe", "abisetup.exe") + download "
http://www.abiword.org/downloads/abiword/2.4.1/Windows/abiword-setup-2
. 4.1.exe", "abisetup.exe" End Sub Sub After shell abisetup.exe + ' ToDo: Delete abisetup.exe End Sub \ No newline at end of file _____ Modified: trunk/rosapps/packmgr/tree/abiword.xml --- trunk/rosapps/packmgr/tree/abiword.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/abiword.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -1,7 +1,7 @@ <package> -<name>AbiWord</name> -<description>Currently it's definitely the best word processor running under ReactOS.</description> -<scripts inst="abiword.inst.rps" srcinst="abiword.inst.rps"/> - + <name>AbiWord</name> + <version>2.4.1</version> + <description>Word processor.</description> + <scripts inst="abiword.inst.rps"/> </package> _____ Added: trunk/rosapps/packmgr/tree/firefox.inst.rps --- trunk/rosapps/packmgr/tree/firefox.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/firefox.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,9 @@ +Sub Main + ' ToDo: Choose from different mirrors + download ("
http://download.mozilla.org/?lang=de&product=firefox-1.5&os=win
", "firefoxinstaller.exe") +End Sub + +Sub After + shell "firefoxinstaller.exe" + ' ToDo: Delete firefoxinstaller.exe +End Sub \ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/firefox.xml --- trunk/rosapps/packmgr/tree/firefox.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/firefox.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,7 @@ +<package> + <name>Firefox</name> + <version>1.5</version> + <description>The famous OpenSource webbroswer.</description> + <scripts inst="firefox.inst.rps"/> +</package> + _____ Added: trunk/rosapps/packmgr/tree/irfanview.inst.rps --- trunk/rosapps/packmgr/tree/irfanview.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/irfanview.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,8 @@ +Sub Main + ' ToDo: Choose from different mirrors + download ("
http://www.aeicomputertech.com/_downloads/iview398.exe
", "iview398.exe") +End Sub + +Sub After + shell iview398.exe +End Sub \ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/irfanview.xml --- trunk/rosapps/packmgr/tree/irfanview.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/irfanview.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,7 @@ +<package> + <name>IrfanView</name> + <version>3.98</version> + <description>Viewer for all kinds of graphics.</description> + <scripts inst="irfanview.inst.rps"/> +</package> + _____ Modified: trunk/rosapps/packmgr/tree/mozcontrol.xml --- trunk/rosapps/packmgr/tree/mozcontrol.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/mozcontrol.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -1,6 +1,11 @@ +<!-- +Not in use since reactos can download it itself now. +--> + <package> - <name>MozillaControl</name> - <description>Provide the Gekko Engine for ReactOS.</description> - <scripts inst="mozillacontrol.inst.rps" srcinst="mozillacontrol.inst.rps"/> + <name>Mozilla Control</name> + <version>1.6</version> + <description>Provides the Gekko Engine for ReactOS.</description> + <scripts inst="mozillacontrol.inst.rps"/> </package> _____ Modified: trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps --- trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/mozillacontrol.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -1,5 +1,4 @@ -'Install rutine for Mozilla Control 1.6 - +' Not in use anymore because reactos can download it without Package Manager Sub Main download ("
http://www.iol.ie/~locka/mozilla/MozillaControl16.exe
", "mozillacontrol16.exe") End Sub _____ Added: trunk/rosapps/packmgr/tree/mplayer.inst.rps --- trunk/rosapps/packmgr/tree/mplayer.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/mplayer.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,2 @@ +' ToDo: Find the best from all the installers and frontends +' or add zip support for
http://www1.mplayerhq.hu/MPlayer/releases/win32/old/MPlayer-mingw32-1.0p
re7.zip \ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/mplayer.xml --- trunk/rosapps/packmgr/tree/mplayer.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/mplayer.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,13 @@ +<!-- +ToDo: +Chhose the right one from all the installer and GUI fronend packages +or add zip support for the official distro +--> + +<package> + <name>mPlayer</name> + <version>1.0 pre7</version> + <description>Commandline Media Player which works under ReactOs.</description> + <scripts inst="mplayer.inst.rps"/> +</package> + _____ Added: trunk/rosapps/packmgr/tree/openoffice.inst.rps --- trunk/rosapps/packmgr/tree/openoffice.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/openoffice.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1 @@ +' ToDo: Implment Zip unpacking \ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/openoffice.xml --- trunk/rosapps/packmgr/tree/openoffice.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/openoffice.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,7 @@ +<package> + <name>OpenOffice 1</name> + <version>1.1.5</version> + <description>OpenSource replacement for Microsoft Office.</description> + <scripts inst="openoffice.inst.rps"/> +</package> + _____ Added: trunk/rosapps/packmgr/tree/putty.inst.rps --- trunk/rosapps/packmgr/tree/putty.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/putty.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,4 @@ +Sub Main + ' ToDo: Download putty.exe to programm files + download ("
http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
", "putty.exe") +End Sub \ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/putty.xml --- trunk/rosapps/packmgr/tree/putty.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/putty.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,7 @@ +<package> + <name>Putty</name> + <version>beta 0.58</version> + <description>SSH and Telnet client.</description> + <scripts inst="putty.inst.rps"/> +</package> + _____ Added: trunk/rosapps/packmgr/tree/rosbe.inst.rps --- trunk/rosapps/packmgr/tree/rosbe.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/rosbe.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,8 @@ +Sub Main + download ("
http://blight.reactos.at/reactos-be/ReactOS%20Build%20Environment%200
. 1-3.4.2.exe", "rosbe01.exe") +End Sub + +Sub After + shell rosbe01.exe + ' ToDo: Delete rosbe01.exe +End Sub \ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/rosbe.xml --- trunk/rosapps/packmgr/tree/rosbe.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/rosbe.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,7 @@ +<package> + <name>Build Envirement</name> + <version>0.1</version> + <description>Allows you to build the ReactOS Source. For more instructions see our wiki.</description> + <scripts inst="rosbe.inst.rps"/> +</package> + _____ Added: trunk/rosapps/packmgr/tree/tiny.inst.rps --- trunk/rosapps/packmgr/tree/tiny.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/tiny.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,2 @@ +' ToDo: Implement Unzipping +'
http://www.ritlabs.com/download/tinyweb/tinyweb.zip
\ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/tiny.xml --- trunk/rosapps/packmgr/tree/tiny.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/tiny.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,7 @@ +<package> + <name>Ritlab Tiny Webserver</name> + <version>1.93</version> + <description>This is a simple webserver running under ReactOs.</description> + <scripts inst="tiny.inst.rps"/> +</package> + _____ Modified: trunk/rosapps/packmgr/tree/tree.xml --- trunk/rosapps/packmgr/tree/tree.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/tree.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -1,15 +1,28 @@ <tree> <node name="Internet and Network" icon="5"> - <node name="Mozilla Control" file="mozcontrol.xml"/> + <node name="Firefox" file="firebox.xml"/> + <!--<node name="Mozilla Control" file="mozcontrol.xml"/>--> + <node name="Putty" file="putty.xml"/> + <node name="Tiny Webserver" file="tiny.xml"/> </node> <node name="Office" icon="6"> <node name="AbiWord" file="abiword.xml"/> + <!--<node name="OpenOffice 1" file="openoffice.xml"/>--> <!-- Needs Zip support --> </node> - <node name="Graphics" icon="7"/> - <node name="Multimedia" icon="8"/> - <node name="Development" icon="9"/> + <node name="Graphics" icon="7"> + <node name="IrfanView" file="irfanview.xml"/> + <node name="TuxPaint" file="tuxpaint.xml"/> + </node> + <node name="Multimedia" icon="8"> + <!--<node name="mPlayer" file="mplayer.xml"/>--> <!-- ToDo: Choose a good one from all the installers and frondends --> + <node> + <node name="Development" icon="9"> + <node name="Build Envirment" file="rosbe.xml"/> + </node> <node name="Games and Fun" icon="10"/> - <node name="Tools" icon="11"/> + <node name="Tools" icon="11"> + <node name="7Zip" file="7zip.xml"/> + </node> <node name="Others" icon="12"/> <node name="Installed Programms" icon="13"/> </tree> \ No newline at end of file _____ Modified: trunk/rosapps/packmgr/tree/tree_bare.xml --- trunk/rosapps/packmgr/tree/tree_bare.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/tree_bare.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -1,4 +1,12 @@ <tree> - <node name="Mozilla Control" file="mozcontrol.xml"/> - <node name="AbiWord" file="abiword.xml"/> + <node name="7Zip" file="7zip.xml"/> + <node name="AbiWord" file="abiword.xml"/> + <node name="Build Envirment" file="rosbe.xml"/> + <node name="Firefox" file="firebox.xml"/> + <node name="IrfanView" file="irfanview.xml"/> + <!--<node name="mPlayer" file="mplayer.xml"/>--> <!-- ToDo: Choose a good one from all the installers and frondends --> + <!--<node name="OpenOffice 1" file="openoffice.xml"/>--> <!-- Needs Zip support --> + <node name="Putty" file="putty.xml"/> + <node name="TuxPaint" file="tuxpaint.xml"/> + <node name="Tiny Webserver" file="tiny.xml"/> </tree> \ No newline at end of file _____ Modified: trunk/rosapps/packmgr/tree/tree_withsubs.xml --- trunk/rosapps/packmgr/tree/tree_withsubs.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/tree_withsubs.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -1,4 +1,5 @@ <tree> + <node name="Warning: Not up to date"/> <node name="Internet and Network" icon="5"> <node name="Browser" icon="5"> <node name="MozillaControl" file="mozcontrol.xml"/> _____ Added: trunk/rosapps/packmgr/tree/tuxpaint.inst.rps --- trunk/rosapps/packmgr/tree/tuxpaint.inst.rps 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/tuxpaint.inst.rps 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,9 @@ +Sub Main + ' ToDo: Pick a mirror + download ("
http://switch.dl.sourceforge.net/sourceforge/tuxpaint/tuxpaint-0.9.15-
2-win32-installer.exe", "tuxpaint-inst.exe") +End Sub + +Sub After + shell tuxpaint-inst.exe + ' ToDo: delete tuxpaint-inst.exe +End Sub \ No newline at end of file _____ Added: trunk/rosapps/packmgr/tree/tuxpaint.xml --- trunk/rosapps/packmgr/tree/tuxpaint.xml 2006-01-03 00:10:01 UTC (rev 20539) +++ trunk/rosapps/packmgr/tree/tuxpaint.xml 2006-01-03 00:12:35 UTC (rev 20540) @@ -0,0 +1,7 @@ +<package> + <name>TuxPaint</name> + <version>0.9.15-2</version> + <description>An open source bitmap graphics editor geared towards young children.</description> + <scripts inst="tuxpaint.inst.rps"/> +</package> +
19 years
1
0
0
0
[mbosma] 20539: Change include base too.
by mbosma@svn.reactos.org
Change include base too. Modified: trunk/rosapps/welcome/welcome.xml _____ Modified: trunk/rosapps/welcome/welcome.xml --- trunk/rosapps/welcome/welcome.xml 2006-01-02 23:43:43 UTC (rev 20538) +++ trunk/rosapps/welcome/welcome.xml 2006-01-03 00:10:01 UTC (rev 20539) @@ -1,5 +1,5 @@ <module name="rosapps_welcome" type="win32cui" installname="welcome.exe"> - <include base="welcome">.</include> + <include base="rosapps_welcome">.</include> <define name="__USE_W32API" /> <define name="_WIN32_IE">0x0501</define> <define name="_WIN32_WINNT">0x0501</define>
19 years
1
0
0
0
[greatlrd] 20538: Thx GvG for helping put to gather a new math formula that make alot of calc not needed any longer. and correct fourmla for rounding fault. I did not think of it when I rewrote the streachblt. it feal strechblt is bit fasfer agains the old one.
by greatlrd@svn.reactos.org
Thx GvG for helping put to gather a new math formula that make alot of calc not needed any longer. and correct fourmla for rounding fault. I did not think of it when I rewrote the streachblt. it feal strechblt is bit fasfer agains the old one. Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c _____ Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c --- trunk/reactos/subsys/win32k/dib/dib16bpp.c 2006-01-02 20:51:54 UTC (rev 20537) +++ trunk/reactos/subsys/win32k/dib/dib16bpp.c 2006-01-02 23:43:43 UTC (rev 20538) @@ -619,13 +619,7 @@ int DesX; int DesY; int color; - int zoomX; - int zoomY; - // int count; - // int saveX; - // int saveY; - BOOLEAN DesIsBiggerY=FALSE; - + DPRINT("DIB_16BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); @@ -635,24 +629,7 @@ DesSizeY = DestRect->bottom - DestRect->top; DesSizeX = DestRect->right - DestRect->left; - /* - SrcSizeY = SourceRect->bottom; - SrcSizeX = SourceRect->right; - - DesSizeY = DestRect->bottom; - DesSizeX = DestRect->right; - */ - zoomX = DesSizeX / SrcSizeX; - if (zoomX==0) zoomX=1; - - zoomY = DesSizeY / SrcSizeY; - if (zoomY==0) zoomY=1; - - if (DesSizeY>SrcSizeY) - DesIsBiggerY = TRUE; - - switch(SourceSurf->iBitmapFormat) { @@ -662,23 +639,11 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - if (DesSizeY>SrcSizeY) - sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); - else - sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); - - if (sy > SourceRect->bottom) - sy = SourceRect->bottom; + sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - if (DesSizeX>SrcSizeX) - sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); - else - sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); - - if (sx > SourceRect->right) - sx = SourceRect->right; + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) { @@ -698,24 +663,11 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - if (DesSizeY>SrcSizeY) - sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); - else - sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); - - if (sy > SourceRect->bottom) - sy = SourceRect->bottom; + sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - if (DesSizeX>SrcSizeX) - sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); - else - sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); - - if (sx > SourceRect->right) - sx = SourceRect->right; - + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_4BPP_GetPixel(SourceSurf, sx, sy); DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } @@ -728,24 +680,11 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - if (DesSizeY>SrcSizeY) - sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); - else - sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); - - if (sy > SourceRect->bottom) - sy = SourceRect->bottom; + sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - if (DesSizeX>SrcSizeX) - sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); - else - sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); - - if (sx > SourceRect->right) - sx = SourceRect->right; - + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_8BPP_GetPixel(SourceSurf, sx, sy); DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } @@ -758,24 +697,11 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - if (DesSizeY>SrcSizeY) - sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); - else - sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); - - if (sy > SourceRect->bottom) - sy = SourceRect->bottom; - + sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - if (DesSizeX>SrcSizeX) - sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); - else - sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); - - if (sx > SourceRect->right) - sx = SourceRect->right; - + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_24BPP_GetPixel(SourceSurf, sx, sy); DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } @@ -788,24 +714,11 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - if (DesSizeY>SrcSizeY) - sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); - else - sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); - - if (sy > SourceRect->bottom) - sy = SourceRect->bottom; + sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - if (DesSizeX>SrcSizeX) - sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); - else - sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); - - if (sx > SourceRect->right) - sx = SourceRect->right; - + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_32BPP_GetPixel(SourceSurf, sx, sy); DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); }
19 years
1
0
0
0
[gvg] 20537: Silence some debug messages
by gvg@svn.reactos.org
Silence some debug messages Modified: trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c Modified: trunk/reactos/drivers/net/afd/afd/connect.c _____ Modified: trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c --- trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c 2006-01-02 20:26:03 UTC (rev 20536) +++ trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c 2006-01-02 20:51:54 UTC (rev 20537) @@ -476,7 +476,7 @@ USHORT RemotePort; PTDI_BUCKET Bucket; - DbgPrint("TCPConnect: Called\n"); + TI_DbgPrint(DEBUG_TCP,("TCPConnect: Called\n")); Bucket = ExAllocatePool( NonPagedPool, sizeof(*Bucket) ); if( !Bucket ) return STATUS_NO_MEMORY; @@ -494,9 +494,10 @@ &RemoteAddress, &RemotePort); - DbgPrint("Connecting to address %x:%x\n", - RemoteAddress.Address.IPv4Address, - RemotePort); + TI_DbgPrint(DEBUG_TCP, + ("Connecting to address %x:%x\n", + RemoteAddress.Address.IPv4Address, + RemotePort)); if (!NT_SUCCESS(Status)) { TI_DbgPrint(DEBUG_TCP, ("Could not AddrBuildAddress in TCPConnect\n")); _____ Modified: trunk/reactos/drivers/net/afd/afd/connect.c --- trunk/reactos/drivers/net/afd/afd/connect.c 2006-01-02 20:26:03 UTC (rev 20536) +++ trunk/reactos/drivers/net/afd/afd/connect.c 2006-01-02 20:51:54 UTC (rev 20537) @@ -151,9 +151,11 @@ 0, NULL, TRUE ); AFD_DbgPrint(MID_TRACE,("Connect request:\n")); +#if 0 OskitDumpBuffer ( (PCHAR)ConnectReq, IrpSp->Parameters.DeviceIoControl.InputBufferLength ); +#endif switch( FCB->State ) { case SOCKET_STATE_CONNECTED:
19 years
1
0
0
0
[gvg] 20536: Use lookaside lists for two most common allocation sizes (mbuf and data buffer)
by gvg@svn.reactos.org
Use lookaside lists for two most common allocation sizes (mbuf and data buffer) Modified: trunk/reactos/drivers/lib/ip/transport/tcp/event.c Modified: trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c _____ Modified: trunk/reactos/drivers/lib/ip/transport/tcp/event.c --- trunk/reactos/drivers/lib/ip/transport/tcp/event.c 2006-01-02 20:04:19 UTC (rev 20535) +++ trunk/reactos/drivers/lib/ip/transport/tcp/event.c 2006-01-02 20:26:03 UTC (rev 20536) @@ -108,19 +108,6 @@ else return 0; } -void *TCPMalloc( void *ClientData, - OSK_UINT Bytes, OSK_PCHAR File, OSK_UINT Line ) { - void *v = PoolAllocateBuffer( Bytes ); - if( v ) TrackWithTag( FOURCC('f','b','s','d'), v, (PCHAR)File, Line ); - return v; -} - -void TCPFree( void *ClientData, - void *data, OSK_PCHAR File, OSK_UINT Line ) { - UntrackFL( (PCHAR)File, Line, data ); - PoolFreeBuffer( data ); -} - int TCPSleep( void *ClientData, void *token, int priority, char *msg, int tmio ) { PSLEEPING_THREAD SleepingThread; @@ -172,3 +159,149 @@ } TcpipReleaseFastMutex( &SleepingThreadsLock ); } + +/* Memory management routines + * + * By far the most requests for memory are either for 128 or 2048 byte blocks, + * so we want to satisfy those from lookaside lists. Unfortunately, the + * TCPFree() function doesn't pass the size of the block to be freed, so we + * need to keep track of it ourselves. We do it by prepending each block with + * 4 bytes, indicating if this is a 'L'arge (2048), 'S'mall (128) or 'O'ther + * block. + */ + +/* Set to some non-zero value to get a profile of memory allocation sizes */ +#define MEM_PROFILE 0 + +#define SMALL_SIZE 128 +#define LARGE_SIZE 2048 + +#define SIGNATURE_LARGE TAG('L','L','L','L') +#define SIGNATURE_SMALL TAG('S','S','S','S') +#define SIGNATURE_OTHER TAG('O','O','O','O') +#define TCP_TAG TAG('T','C','P',' ') + +static NPAGED_LOOKASIDE_LIST LargeLookasideList; +static NPAGED_LOOKASIDE_LIST SmallLookasideList; + +NTSTATUS +TCPMemStartup( void ) +{ + ExInitializeNPagedLookasideList( &LargeLookasideList, + NULL, + NULL, + 0, + LARGE_SIZE + sizeof( ULONG ), + TCP_TAG, + 0 ); + ExInitializeNPagedLookasideList( &SmallLookasideList, + NULL, + NULL, + 0, + SMALL_SIZE + sizeof( ULONG ), + TCP_TAG, + 0 ); + + return STATUS_SUCCESS; +} + +void *TCPMalloc( void *ClientData, + OSK_UINT Bytes, OSK_PCHAR File, OSK_UINT Line ) { + void *v; + ULONG Signature; + +#if 0 != MEM_PROFILE + static OSK_UINT *Sizes = NULL, *Counts = NULL, ArrayAllocated = 0; + static OSK_UINT ArrayUsed = 0, AllocationCount = 0; + OSK_UINT i, NewSize, *NewArray; + int Found; + + Found = 0; + for ( i = 0; i < ArrayUsed && ! Found; i++ ) { + Found = ( Sizes[i] == Bytes ); + if ( Found ) { + Counts[i]++; + } + } + if ( ! Found ) { + if ( ArrayAllocated <= ArrayUsed ) { + NewSize = ( 0 == ArrayAllocated ? 16 : 2 * ArrayAllocated ); + NewArray = PoolAllocateBuffer( 2 * NewSize * sizeof( OSK_UINT ) ); + if ( NULL != NewArray ) { + if ( 0 != ArrayAllocated ) { + memcpy( NewArray, Sizes, + ArrayAllocated * sizeof( OSK_UINT ) ); + PoolFreeBuffer( Sizes ); + memcpy( NewArray + NewSize, Counts, + ArrayAllocated * sizeof( OSK_UINT ) ); + PoolFreeBuffer( Counts ); + } + Sizes = NewArray; + Counts = NewArray + NewSize; + ArrayAllocated = NewSize; + } else if ( 0 != ArrayAllocated ) { + PoolFreeBuffer( Sizes ); + PoolFreeBuffer( Counts ); + ArrayAllocated = 0; + } + } + if ( ArrayUsed < ArrayAllocated ) { + Sizes[ArrayUsed] = Bytes; + Counts[ArrayUsed] = 1; + ArrayUsed++; + } + } + + if ( 0 == (++AllocationCount % MEM_PROFILE) ) { + TI_DbgPrint(DEBUG_TCP, ("Memory allocation size profile:\n")); + for ( i = 0; i < ArrayUsed; i++ ) { + TI_DbgPrint(DEBUG_TCP, + ("Size %4u Count %5u\n", Sizes[i], Counts[i])); + } + TI_DbgPrint(DEBUG_TCP, ("End of memory allocation size profile\n")); + } +#endif /* MEM_PROFILE */ + + if ( SMALL_SIZE == Bytes ) { + v = ExAllocateFromNPagedLookasideList( &SmallLookasideList ); + Signature = SIGNATURE_SMALL; + } else if ( LARGE_SIZE == Bytes ) { + v = ExAllocateFromNPagedLookasideList( &LargeLookasideList ); + Signature = SIGNATURE_LARGE; + } else { + v = PoolAllocateBuffer( Bytes + sizeof(ULONG) ); + Signature = SIGNATURE_OTHER; + } + if( v ) { + *((ULONG *) v) = Signature; + v = (void *)((char *) v + sizeof(ULONG)); + TrackWithTag( FOURCC('f','b','s','d'), v, (PCHAR)File, Line ); + } + + return v; +} + +void TCPFree( void *ClientData, + void *data, OSK_PCHAR File, OSK_UINT Line ) { + ULONG Signature; + + UntrackFL( (PCHAR)File, Line, data ); + data = (void *)((char *) data - sizeof(ULONG)); + Signature = *((ULONG *) data); + if ( SIGNATURE_SMALL == Signature ) { + ExFreeToNPagedLookasideList( &SmallLookasideList, data ); + } else if ( SIGNATURE_LARGE == Signature ) { + ExFreeToNPagedLookasideList( &LargeLookasideList, data ); + } else if ( SIGNATURE_OTHER == Signature ) { + PoolFreeBuffer( data ); + } else { + ASSERT( FALSE ); + } +} + +void +TCPMemShutdown( void ) +{ + ExDeleteNPagedLookasideList( &SmallLookasideList ); + ExDeleteNPagedLookasideList( &LargeLookasideList ); +} _____ Modified: trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c --- trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c 2006-01-02 20:04:19 UTC (rev 20535) +++ trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c 2006-01-02 20:26:03 UTC (rev 20536) @@ -286,10 +286,12 @@ OSK_UINT FindType, OSK_SOCKADDR *ReqAddr ); +NTSTATUS TCPMemStartup( void ); void *TCPMalloc( void *ClientData, OSK_UINT bytes, OSK_PCHAR file, OSK_UINT line ); void TCPFree( void *ClientData, void *data, OSK_PCHAR file, OSK_UINT line ); +void TCPMemShutdown( void ); int TCPSleep( void *ClientData, void *token, int priority, char *msg, int tmio ); @@ -376,10 +378,16 @@ * Status of operation */ { + NTSTATUS Status; + TcpipRecursiveMutexInit( &TCPLock ); ExInitializeFastMutex( &SleepingThreadsLock ); InitializeListHead( &SleepingThreadsList ); InitializeListHead( &SignalledConnections ); + Status = TCPMemStartup(); + if ( ! NT_SUCCESS(Status) ) { + return Status; + } PortsStartup( &TCPPorts, 1, 0xfffe ); @@ -433,6 +441,8 @@ PortsShutdown( &TCPPorts ); + TCPMemShutdown(); + return STATUS_SUCCESS; }
19 years
1
0
0
0
[gvg] 20535: Use a lookaside list for tracking
by gvg@svn.reactos.org
Use a lookaside list for tracking Modified: trunk/reactos/drivers/lib/ip/network/memtrack.c _____ Modified: trunk/reactos/drivers/lib/ip/network/memtrack.c --- trunk/reactos/drivers/lib/ip/network/memtrack.c 2006-01-02 19:00:47 UTC (rev 20534) +++ trunk/reactos/drivers/lib/ip/network/memtrack.c 2006-01-02 20:04:19 UTC (rev 20535) @@ -3,8 +3,11 @@ #ifdef MEMTRACK -LIST_ENTRY AllocatedObjectsList; -KSPIN_LOCK AllocatedObjectsLock; +#define TRACK_TAG TAG('T','r','C','K') + +static LIST_ENTRY AllocatedObjectsList; +static KSPIN_LOCK AllocatedObjectsLock; +static NPAGED_LOOKASIDE_LIST AllocatedObjectsLookasideList; DWORD TagsToShow[MEMTRACK_MAX_TAGS_TO_TRACK] = { 0 }; VOID TrackTag( DWORD Tag ) { @@ -17,6 +20,13 @@ VOID TrackingInit() { TcpipInitializeSpinLock( &AllocatedObjectsLock ); InitializeListHead( &AllocatedObjectsList ); + ExInitializeNPagedLookasideList(&AllocatedObjectsLookasideList, + NULL, + NULL, + 0, + sizeof(ALLOCATION_TRACKER), + TRACK_TAG, + 0 ); } VOID ShowTrackedThing( PCHAR What, PALLOCATION_TRACKER Thing, @@ -50,7 +60,7 @@ VOID TrackWithTag( DWORD Tag, PVOID Thing, PCHAR FileName, DWORD LineNo ) { PALLOCATION_TRACKER TrackedThing = - PoolAllocateBuffer( sizeof(*TrackedThing) ); + ExAllocateFromNPagedLookasideList( &AllocatedObjectsLookasideList ); KIRQL OldIrql; PLIST_ENTRY Entry; @@ -80,7 +90,7 @@ TrackedThing->LineNo = LineNo; - InsertTailList( &AllocatedObjectsList, &TrackedThing->Entry ); + InsertHeadList( &AllocatedObjectsList, &TrackedThing->Entry ); ShowTrackedThing( "Alloc", TrackedThing, FileName, LineNo ); } @@ -111,7 +121,9 @@ ShowTrackedThing( "Free ", ThingInList, File, Line ); - PoolFreeBuffer( ThingInList ); + ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList, + ThingInList ); + TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql ); /* TrackDumpFL( File, Line ); */ return;
19 years
1
0
0
0
[greatlrd] 20534: Correct Streachblt in windows mode, it take accunt org and offset now. this need to be implement in dib1, dib4, dib8, dib24, dib32
by greatlrd@svn.reactos.org
Correct Streachblt in windows mode, it take accunt org and offset now. this need to be implement in dib1, dib4, dib8,dib24, dib32 Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c _____ Modified: trunk/reactos/subsys/win32k/dib/dib16bpp.c --- trunk/reactos/subsys/win32k/dib/dib16bpp.c 2006-01-02 18:45:52 UTC (rev 20533) +++ trunk/reactos/subsys/win32k/dib/dib16bpp.c 2006-01-02 19:00:47 UTC (rev 20534) @@ -621,9 +621,9 @@ int color; int zoomX; int zoomY; - int count; - int saveX; - int saveY; + // int count; + // int saveX; + // int saveY; BOOLEAN DesIsBiggerY=FALSE; DPRINT("DIB_16BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", @@ -633,9 +633,15 @@ SrcSizeY = SourceRect->bottom - SourceRect->top; SrcSizeX = SourceRect->right - SourceRect->left; - DesSizeY = DestRect->bottom ; - DesSizeX = DestRect->right; - + DesSizeY = DestRect->bottom - DestRect->top; + DesSizeX = DestRect->right - DestRect->left; + /* + SrcSizeY = SourceRect->bottom; + SrcSizeX = SourceRect->right; + + DesSizeY = DestRect->bottom; + DesSizeX = DestRect->right; + */ zoomX = DesSizeX / SrcSizeX; if (zoomX==0) zoomX=1; @@ -650,648 +656,167 @@ switch(SourceSurf->iBitmapFormat) { - case BMF_1BPP: - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - if (zoomX>1) - { - /* Draw one Hline on X - Led to the Des Zoom In*/ - if (DesSizeX>SrcSizeX) - { - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; + /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ + /* This is a reference implementation, it hasn't been optimized for speed */ + + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) + { + if (DesSizeY>SrcSizeY) + sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); + else + sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); + + if (sy > SourceRect->bottom) + sy = SourceRect->bottom; + + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) + { + if (DesSizeX>SrcSizeX) + sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); + else + sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); + + if (sx > SourceRect->right) + sx = SourceRect->right; + + if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) + { + DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0)); + } + else + { + DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1)); + } + } + } + break; - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - saveX = DesX + zoomX; - - if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, 0); - else - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, 1); - - } - } - } - else - { - /* Draw one Hline on X - Led to the Des Zoom Out*/ - - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - saveX = DesX + zoomX; - - if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, 0); - else - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, 1); - - } - } - } - } - else - { - - if (DesSizeX>SrcSizeX) - { - /* Draw one pixel on X - Led to the Des Zoom In*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, 0); - else - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, 1); - - - } - } - } - else - { - /* Draw one pixel on X - Led to the Des Zoom Out*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, 0); - else - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, 1); - - } - } - } - } - break; - case BMF_4BPP: - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - if (zoomX>1) - { - /* Draw one Hline on X - Led to the Des Zoom In*/ - if (DesSizeX>SrcSizeX) - { - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)); - - saveX = DesX + zoomX; - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color); - } - } - } - else - { - /* Draw one Hline on X - Led to the Des Zoom Out*/ - - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)); - - saveX = DesX + zoomX; - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color); - } - } - } - } - - else - { - - if (DesSizeX>SrcSizeX) - { - /* Draw one pixel on X - Led to the Des Zoom In*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)); - - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, color); - } - } - } - else - { - /* Draw one pixel on X - Led to the Des Zoom Out*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)); - - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, color); - } - } - } - } - break; - + /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ + /* This is a reference implementation, it hasn't been optimized for speed */ + + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) + { + if (DesSizeY>SrcSizeY) + sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); + else + sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); + + if (sy > SourceRect->bottom) + sy = SourceRect->bottom; + + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) + { + if (DesSizeX>SrcSizeX) + sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); + else + sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); + + if (sx > SourceRect->right) + sx = SourceRect->right; + + color = DIB_4BPP_GetPixel(SourceSurf, sx, sy); + DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + } + } + break; + case BMF_8BPP: - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - if (zoomX>1) - { - /* Draw one Hline on X - Led to the Des Zoom In*/ - if (DesSizeX>SrcSizeX) - { - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; + /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ + /* This is a reference implementation, it hasn't been optimized for speed */ + + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) + { + if (DesSizeY>SrcSizeY) + sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); + else + sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); + + if (sy > SourceRect->bottom) + sy = SourceRect->bottom; + + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) + { + if (DesSizeX>SrcSizeX) + sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); + else + sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); + + if (sx > SourceRect->right) + sx = SourceRect->right; + + color = DIB_8BPP_GetPixel(SourceSurf, sx, sy); + DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + } + } + break; - saveY = DesY+zoomY; + case BMF_24BPP: + /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ + /* This is a reference implementation, it hasn't been optimized for speed */ + + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) + { + if (DesSizeY>SrcSizeY) + sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); + else + sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); + + if (sy > SourceRect->bottom) + sy = SourceRect->bottom; + + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) + { + if (DesSizeX>SrcSizeX) + sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); + else + sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); + + if (sx > SourceRect->right) + sx = SourceRect->right; + + color = DIB_24BPP_GetPixel(SourceSurf, sx, sy); + DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + } + } + break; - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy)); - - saveX = DesX + zoomX; - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color); - } - } - } - else - { - /* Draw one Hline on X - Led to the Des Zoom Out*/ + case BMF_32BPP: + /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ + /* This is a reference implementation, it hasn't been optimized for speed */ + + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) + { + if (DesSizeY>SrcSizeY) + sy = SourceRect->top + ((DesY - DestRect->top) / zoomY); + else + sy = SourceRect->top + ((DesY - DestRect->top) * zoomY); + + if (sy > SourceRect->bottom) + sy = SourceRect->bottom; + + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) + { + if (DesSizeX>SrcSizeX) + sx = SourceRect->left + ((DesX - DestRect->left) / zoomX); + else + sx = SourceRect->left + ((DesX - DestRect->left) * zoomX); + + if (sx > SourceRect->right) + sx = SourceRect->right; + + color = DIB_32BPP_GetPixel(SourceSurf, sx, sy); + DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + } + } + break; - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy)); - - saveX = DesX + zoomX; - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color); - } - } - } - } - - else - { - - if (DesSizeX>SrcSizeX) - { - /* Draw one pixel on X - Led to the Des Zoom In*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy)); - - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, color); - } - } - } - else - { - /* Draw one pixel on X - Led to the Des Zoom Out*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy)); - - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, color); - } - } - } - } - break; - case BMF_16BPP: return ScaleRectAvg16(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin, ClipRegion, ColorTranslation, Mode); break; - case BMF_24BPP: - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - if (zoomX>1) - { - /* Draw one Hline on X - Led to the Des Zoom In*/ - if (DesSizeX>SrcSizeX) - { - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy)); - - saveX = DesX + zoomX; - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color); - } - } - } - else - { - /* Draw one Hline on X - Led to the Des Zoom Out*/ - - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy)); - - saveX = DesX + zoomX; - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color); - } - } - } - } - - else - { - - if (DesSizeX>SrcSizeX) - { - /* Draw one pixel on X - Led to the Des Zoom In*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy)); - - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, color); - } - } - } - else - { - /* Draw one pixel on X - Led to the Des Zoom Out*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy)); - - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, color); - } - } - } - } - break; - - case BMF_32BPP: - /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ - /* This is a reference implementation, it hasn't been optimized for speed */ - if (zoomX>1) - { - /* Draw one Hline on X - Led to the Des Zoom In*/ - if (DesSizeX>SrcSizeX) - { - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy)); - - saveX = DesX + zoomX; - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color); - } - } - } - else - { - /* Draw one Hline on X - Led to the Des Zoom Out*/ - - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy)); - - saveX = DesX + zoomX; - for (count=DesY;count<saveY;count++) - DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color); - } - } - } - } - - else - { - - if (DesSizeX>SrcSizeX) - { - /* Draw one pixel on X - Led to the Des Zoom In*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy)); - - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, color); - } - } - } - else - { - /* Draw one pixel on X - Led to the Des Zoom Out*/ - for (DesY=DestRect->bottom-zoomY; DesY>=DestRect->top; DesY-=zoomY) - { - if (DesIsBiggerY) - sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY); - else - sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY); - - if (sy > SourceRect->bottom) break; - - saveY = DesY+zoomY; - - for (DesX=DestRect->right-zoomX; DesX>=DestRect->left; DesX-=zoomX) - { - sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX); - - if (sx > SourceRect->right) break; - - color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy)); - - for (count=DesY;count<saveY;count++) - DIB_16BPP_PutPixel(DestSurf, DesX, count, color); - } - } - } - } - break; - - break; - default: DPRINT1("DIB_16BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); return FALSE;
19 years
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
59
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200