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
May 2008
----- 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
25 participants
586 discussions
Start a n
N
ew thread
[dchapyshev] 33741: - Start implementing shimgvw.dll
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed May 28 14:52:46 2008 New Revision: 33741 URL:
http://svn.reactos.org/svn/reactos?rev=33741&view=rev
Log: - Start implementing shimgvw.dll Added: trunk/reactos/dll/win32/shimgvw/ trunk/reactos/dll/win32/shimgvw/lang/ trunk/reactos/dll/win32/shimgvw/lang/en-US.rc (with props) trunk/reactos/dll/win32/shimgvw/res/ trunk/reactos/dll/win32/shimgvw/res/main.ico (with props) trunk/reactos/dll/win32/shimgvw/res/next.bmp (with props) trunk/reactos/dll/win32/shimgvw/res/prev.bmp (with props) trunk/reactos/dll/win32/shimgvw/res/print.bmp (with props) trunk/reactos/dll/win32/shimgvw/res/rot1.bmp (with props) trunk/reactos/dll/win32/shimgvw/res/rot2.bmp (with props) trunk/reactos/dll/win32/shimgvw/res/save.bmp (with props) trunk/reactos/dll/win32/shimgvw/res/zoomm.bmp (with props) trunk/reactos/dll/win32/shimgvw/res/zoomp.bmp (with props) trunk/reactos/dll/win32/shimgvw/resource.h (with props) trunk/reactos/dll/win32/shimgvw/rsrc.rc (with props) trunk/reactos/dll/win32/shimgvw/shimgvw.c (with props) trunk/reactos/dll/win32/shimgvw/shimgvw.h (with props) trunk/reactos/dll/win32/shimgvw/shimgvw.rbuild (with props) trunk/reactos/dll/win32/shimgvw/shimgvw.rc (with props) trunk/reactos/dll/win32/shimgvw/shimgvw.spec (with props) Modified: trunk/reactos/dll/win32/win32.rbuild Added: trunk/reactos/dll/win32/shimgvw/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/lang/en-…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/lang/en-US.rc (added) +++ trunk/reactos/dll/win32/shimgvw/lang/en-US.rc [iso-8859-1] Wed May 28 14:52:46 2008 @@ -1,0 +1,17 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +STRINGTABLE +BEGIN + IDS_APPTITLE "ReactOS Picture and Fax Viewer" + IDS_SETASDESKBG "Set as Desktop Background" + + /* Tooltips */ + IDS_TOOLTIP_NEXT_PIC "Next Picture" + IDS_TOOLTIP_PREV_PIC "Previous Picture" + IDS_TOOLTIP_ZOOM_IN "Zoom In (+)" + IDS_TOOLTIP_ZOOM_OUT "Zoom Out (-)" + IDS_TOOLTIP_ROT_CLOCKW "Rotate Clockwise (Ctrl+K)" + IDS_TOOLTIP_ROT_COUNCW "Rotate Counterclockwise (Ctrl+L)" + IDS_TOOLTIP_PRINT "Print (Ctrl+P)" + IDS_TOOLTIP_SAVEAS "Save As... (Ctrl+S)" +END Propchange: trunk/reactos/dll/win32/shimgvw/lang/en-US.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shimgvw/res/main.ico URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/main…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/main.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/res/next.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/next…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/next.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/res/prev.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/prev…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/prev.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/res/print.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/prin…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/print.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/res/rot1.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/rot1…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/rot1.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/res/rot2.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/rot2…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/rot2.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/res/save.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/save…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/save.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/res/zoomm.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/zoom…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/zoomm.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/res/zoomp.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/res/zoom…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/dll/win32/shimgvw/res/zoomp.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/dll/win32/shimgvw/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/resource…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/resource.h (added) +++ trunk/reactos/dll/win32/shimgvw/resource.h [iso-8859-1] Wed May 28 14:52:46 2008 @@ -1,0 +1,53 @@ +#ifndef __SHIMGVW_RESOURCE_H +#define __SHIMGVW_RESOURCE_H + +/* Icons */ +#define IDI_APPICON 1 +#define IDI_BMP_ICON 2 +#define IDI_GIF_ICON 3 +#define IDI_JPG_ICON 4 +#define IDI_PNG_ICON 5 + +#define IDB_PREVICON 50 +#define IDB_NEXTICON 51 +#define IDB_ZOOMPICON 52 +#define IDB_ZOOMMICON 53 +#define IDB_SAVEICON 54 +#define IDB_PRINTICON 55 +#define IDB_ROT1ICON 56 +#define IDB_ROT2ICON 57 + +/* ToolBar buttons */ +#define IDC_PREV 500 +#define IDC_NEXT 501 +#define IDC_ZOOMP 502 +#define IDC_ZOOMM 503 +#define IDC_SAVE 504 +#define IDC_PRINT 505 +#define IDC_ROT1 506 +#define IDC_ROT2 507 + +#define TBICON_PREV 0 +#define TBICON_NEXT 1 +#define TBICON_ZOOMP 2 +#define TBICON_ZOOMM 3 +#define TBICON_SAVE 4 +#define TBICON_PRINT 5 +#define TBICON_ROT1 6 +#define TBICON_ROT2 7 + +/* Strings */ +#define IDS_APPTITLE 100 +#define IDS_SETASDESKBG 101 + +/* Tooltips strings */ +#define IDS_TOOLTIP_NEXT_PIC 300 +#define IDS_TOOLTIP_PREV_PIC 301 +#define IDS_TOOLTIP_ZOOM_IN 302 +#define IDS_TOOLTIP_ZOOM_OUT 304 +#define IDS_TOOLTIP_ROT_CLOCKW 305 +#define IDS_TOOLTIP_ROT_COUNCW 306 +#define IDS_TOOLTIP_PRINT 307 +#define IDS_TOOLTIP_SAVEAS 308 + +#endif /* __SHIMGVW_RESOURCE_H */ Propchange: trunk/reactos/dll/win32/shimgvw/resource.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shimgvw/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/rsrc.rc?…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/rsrc.rc (added) +++ trunk/reactos/dll/win32/shimgvw/rsrc.rc [iso-8859-1] Wed May 28 14:52:46 2008 @@ -1,0 +1,4 @@ +#include <windows.h> +#include "resource.h" + +#include "lang/en-US.rc" Propchange: trunk/reactos/dll/win32/shimgvw/rsrc.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shimgvw/shimgvw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/shimgvw.…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/shimgvw.c (added) +++ trunk/reactos/dll/win32/shimgvw/shimgvw.c [iso-8859-1] Wed May 28 14:52:46 2008 @@ -1,0 +1,496 @@ +/* + * + * PROJECT: ReactOS Picture and Fax Viewer + * FILE: dll/win32/shimgvw/shimgvw.c + * PURPOSE: shimgvw.dll + * PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) + * + * UPDATE HISTORY: + * 28/05/2008 Created + */ + +#include <stdio.h> +#include <stdlib.h> +#include <stdarg.h> + +#include <windows.h> +#include <commctrl.h> +#include <gdiplus.h> +#include <tchar.h> + +#include "shimgvw.h" + + +HINSTANCE hInstance; +SHIMGVW_SETTINGS shiSettings; +WCHAR szOpenFileName[MAX_PATH]; + +HWND hDispWnd, hToolBar; + +/* ToolBar Buttons */ +static const TBBUTTON Buttons [] = +{ /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */ + {TBICON_PREV, IDC_PREV, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_NEXT, IDC_NEXT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, + {TBICON_ZOOMP, IDC_ZOOMP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_ZOOMM, IDC_ZOOMM, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, + {TBICON_ROT1, IDC_ROT1, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_ROT2, IDC_ROT2, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, + {TBICON_SAVE, IDC_SAVE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, + {TBICON_PRINT, IDC_PRINT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, +}; + +static VOID +ImageView_DrawImage(HWND hwnd) +{ + GpGraphics *graphics; + GpImage *image; + UINT uImgWidth, uImgHeight; + UINT height = 0, width = 0, x = 0, y = 0; + PAINTSTRUCT ps; + RECT rect; + HDC hdc; + + if (GetFileAttributesW(szOpenFileName) == 0xFFFFFFFF) + return; + + hdc = BeginPaint(hwnd, &ps); + + GdipCreateFromHDC(hdc, &graphics); + GdipLoadImageFromFile(szOpenFileName, &image); + GdipGetImageWidth(image, &uImgWidth); + GdipGetImageHeight(image, &uImgHeight); + + if (GetClientRect(hwnd, &rect)) + { + FillRect(hdc, &rect, (HBRUSH)COLOR_WINDOW); + + if ((rect.right == uImgWidth)&&(rect.bottom == uImgHeight)) + { + x = 0, y = 0, width = rect.right, height = rect.bottom; + } + else if ((rect.right >= uImgWidth)&&(rect.bottom >= uImgHeight)) + { + x = (rect.right/2)-(uImgWidth/2); + y = (rect.bottom/2)-(uImgHeight/2); + width = uImgWidth; + height = uImgHeight; + } + else if ((rect.right < uImgWidth)||(rect.bottom < uImgHeight)) + { + if (rect.bottom < uImgHeight) + { + height = rect.bottom; + width = uImgWidth*(UINT)rect.bottom/uImgHeight; + x = (rect.right/2)-(width/2); + y = (rect.bottom/2)-(height/2); + } + if (rect.right < uImgWidth) + { + width = rect.right; + height = uImgHeight*(UINT)rect.right/uImgWidth; + x = (rect.right/2)-(width/2); + y = (rect.bottom/2)-(height/2); + } + if ((height > rect.bottom)||(width > rect.right)) + { + for (;;) + { + if (((int)width - 1 < 0)||((int)height - 1 < 0)) break; + width -= 1; + height -= 1; + y = (rect.bottom/2)-(height/2); + x = (rect.right/2)-(width/2); + if ((height < rect.bottom)&&(width < rect.right)) break; + } + } + } + else if ((rect.right <= uImgWidth)&&(rect.bottom <= uImgHeight)) + { + height = uImgHeight*(UINT)rect.right/uImgWidth; + y = (rect.bottom/2)-(height/2); + width = rect.right; + + if ((height > rect.bottom)||(width > rect.right)) + { + for (;;) + { + if (((int)width - 1 < 0)||((int)height - 1 < 0)) break; + width -= 1; + height -= 1; + y = (rect.bottom/2)-(height/2); + x = (rect.right/2)-(width/2); + if ((height < rect.bottom)&&(width < rect.right)) break; + } + } + } + + //TCHAR szBuf[MAX_PATH]; + //wsprintf(szBuf, _T("x = %d\ny = %d\nWidth = %d\nHeight = %d\n\nrect.right = %d\nrect.bottom = %d\n\nuImgWidth = %d\nuImgHeight = %d"), x, y, width, height, rect.right, rect.bottom, uImgWidth, uImgHeight); + //MessageBox(0, szBuf, NULL, MB_OK); + GdipDrawImageRect(graphics, image, x, y, width, height); + } + + DeleteDC(hdc); + EndPaint(hwnd, &ps); +} + +static BOOL +ImageView_LoadSettings() +{ + HKEY hKey; + DWORD dwSize; + + if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\ReactOS\\shimgvw"), 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + dwSize = sizeof(SHIMGVW_SETTINGS); + if (RegQueryValueEx(hKey, _T("Settings"), NULL, NULL, (LPBYTE)&shiSettings, &dwSize) == ERROR_SUCCESS) + { + RegCloseKey(hKey); + return TRUE; + } + + RegCloseKey(hKey); + } + + return FALSE; +} + +static VOID +ImageView_SaveSettings(HWND hwnd) +{ + WINDOWPLACEMENT wp; + HKEY hKey; + + ShowWindow(hwnd, SW_HIDE); + wp.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(hwnd, &wp); + + shiSettings.Left = wp.rcNormalPosition.left; + shiSettings.Top = wp.rcNormalPosition.top; + shiSettings.Right = wp.rcNormalPosition.right; + shiSettings.Bottom = wp.rcNormalPosition.bottom; + shiSettings.Maximized = (IsZoomed(hwnd) || (wp.flags & WPF_RESTORETOMAXIMIZED)); + + if (RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software\\ReactOS\\shimgvw"), 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS) + { + RegSetValueEx(hKey, _T("Settings"), 0, REG_BINARY, (LPBYTE)&shiSettings, sizeof(SHIMGVW_SETTINGS)); + RegCloseKey(hKey); + } +} + +static BOOL +ImageView_CreateToolBar(HWND hwnd) +{ + INT numButtons = sizeof(Buttons) / sizeof(Buttons[0]); + + hToolBar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, + WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | CCS_BOTTOM | TBSTYLE_TOOLTIPS, + 0, 0, 0, 0, hwnd, + 0, hInstance, NULL); + if(hToolBar != NULL) + { + HIMAGELIST hImageList; + + SendMessage(hToolBar, TB_SETEXTENDEDSTYLE, + 0, TBSTYLE_EX_HIDECLIPPEDBUTTONS); + + SendMessage(hToolBar, TB_BUTTONSTRUCTSIZE, + sizeof(Buttons[0]), 0); + + hImageList = ImageList_Create(TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, ILC_MASK | ILC_COLOR24, 1, 1); + + ImageList_AddMasked(hImageList, LoadImage(hInstance, MAKEINTRESOURCE(IDB_PREVICON), IMAGE_BITMAP, + TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, LR_DEFAULTCOLOR), RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, LoadImage(hInstance, MAKEINTRESOURCE(IDB_NEXTICON), IMAGE_BITMAP, + TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, LR_DEFAULTCOLOR), RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, LoadImage(hInstance, MAKEINTRESOURCE(IDB_ZOOMPICON), IMAGE_BITMAP, + TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, LR_DEFAULTCOLOR), RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, LoadImage(hInstance, MAKEINTRESOURCE(IDB_ZOOMMICON), IMAGE_BITMAP, + TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, LR_DEFAULTCOLOR), RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, LoadImage(hInstance, MAKEINTRESOURCE(IDB_SAVEICON), IMAGE_BITMAP, + TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, LR_DEFAULTCOLOR), RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, LoadImage(hInstance, MAKEINTRESOURCE(IDB_PRINTICON), IMAGE_BITMAP, + TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, LR_DEFAULTCOLOR), RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, LoadImage(hInstance, MAKEINTRESOURCE(IDB_ROT1ICON), IMAGE_BITMAP, + TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, LR_DEFAULTCOLOR), RGB(255, 255, 255)); + + ImageList_AddMasked(hImageList, LoadImage(hInstance, MAKEINTRESOURCE(IDB_ROT2ICON), IMAGE_BITMAP, + TB_IMAGE_WIDTH, TB_IMAGE_HEIGHT, LR_DEFAULTCOLOR), RGB(255, 255, 255)); + + if (hImageList == NULL) return FALSE; + + ImageList_Destroy((HIMAGELIST)SendMessage(hToolBar, TB_SETIMAGELIST, + 0, (LPARAM)hImageList)); + + SendMessage(hToolBar, TB_ADDBUTTONS, + numButtons, (LPARAM)Buttons); + + return TRUE; + } + + return FALSE; +} + +static VOID +ImageView_InitControls(HWND hwnd) +{ + MoveWindow(hwnd, shiSettings.Left, shiSettings.Top, + shiSettings.Right - shiSettings.Left, + shiSettings.Bottom - shiSettings.Top, TRUE); + + if (shiSettings.Maximized) ShowWindow(hwnd, SW_MAXIMIZE); + + hDispWnd = CreateWindowEx(WS_EX_TRANSPARENT, _T("STATIC"), _T(""), + WS_CHILD | WS_VISIBLE, + 0, 0, 0, 0, hwnd, NULL, hInstance, NULL); + + ImageView_CreateToolBar(hwnd); +} + +LRESULT CALLBACK +ImageView_WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) +{ + switch (Message) + { + case WM_CREATE: + { + ImageView_InitControls(hwnd); + } + break; + + case WM_COMMAND: + { + switch (wParam) + { + case IDC_PREV: + + break; + case IDC_NEXT: + + break; + case IDC_ZOOMP: + + break; + case IDC_ZOOMM: + + break; + case IDC_SAVE: + + break; + case IDC_PRINT: + + break; + case IDC_ROT1: + + break; + case IDC_ROT2: + + break; + } + } + break; + + case WM_NOTIFY: + { + LPNMHDR pnmhdr = (LPNMHDR)lParam; + + switch (pnmhdr->code) + { + case TTN_GETDISPINFO: + { + LPTOOLTIPTEXT lpttt; + UINT idButton; + + lpttt = (LPTOOLTIPTEXT)lParam; + idButton = (UINT)lpttt->hdr.idFrom; + + switch (idButton) + { + case IDC_PREV: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PREV_PIC); + break; + case IDC_NEXT: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_NEXT_PIC); + break; + case IDC_ZOOMP: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_ZOOM_IN); + break; + case IDC_ZOOMM: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_ZOOM_OUT); + break; + case IDC_SAVE: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_SAVEAS); + break; + case IDC_PRINT: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PRINT); + break; + case IDC_ROT1: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_ROT_COUNCW); + break; + case IDC_ROT2: + lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_ROT_CLOCKW); + break; + } + } + } + } + break; + + case WM_PAINT: + { + ImageView_DrawImage(hDispWnd); + } + break; + + case WM_SIZING: + { + LPRECT pRect = (LPRECT)lParam; + if (pRect->right-pRect->left < 350) + pRect->right = pRect->left + 350; + + if (pRect->bottom-pRect->top < 290) + pRect->bottom = pRect->top + 290; + } + break; + + case WM_SIZE: + { + MoveWindow(hDispWnd, 1, 1, LOWORD(lParam)-1, HIWORD(lParam)-35, TRUE); + SendMessage(hToolBar, TB_AUTOSIZE, 0, 0); + } + break; + + case WM_DESTROY: + { + ImageView_SaveSettings(hwnd); + PostQuitMessage(0); + } + break; + } + + return DefWindowProc(hwnd, Message, wParam, lParam); +} + +LONG +ImageView_CreateWindow(HWND hwnd, LPWSTR szFileName) +{ + struct GdiplusStartupInput gdiplusStartupInput; + ULONG_PTR gdiplusToken; + WNDCLASS WndClass = {0}; + TCHAR szBuf[512]; + HWND hMainWnd; + MSG msg; + + wcscpy(szOpenFileName, szFileName); + + if (!ImageView_LoadSettings()) + { + shiSettings.Maximized = FALSE; + shiSettings.Left = 0; + shiSettings.Top = 0; + shiSettings.Right = 520; + shiSettings.Bottom = 400; + } + + // Initialize GDI+ + gdiplusStartupInput.GdiplusVersion = 1; + gdiplusStartupInput.DebugEventCallback = NULL; + gdiplusStartupInput.SuppressBackgroundThread = 0; + gdiplusStartupInput.SuppressExternalCodecs = 0; + + GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + + // Create the window + WndClass.lpszClassName = _T("shimgvw_window"); + WndClass.lpfnWndProc = (WNDPROC)ImageView_WndProc; + WndClass.hInstance = hInstance; + WndClass.style = CS_HREDRAW | CS_VREDRAW; + WndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON)); + WndClass.hCursor = LoadCursor(hInstance, IDC_ARROW); + WndClass.hbrBackground = (HBRUSH)COLOR_WINDOW; + + if (!RegisterClass(&WndClass)) return -1; + + LoadString(hInstance, IDS_APPTITLE, szBuf, sizeof(szBuf) / sizeof(TCHAR)); + hMainWnd = CreateWindow(_T("shimgvw_window"), szBuf, + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_VISIBLE | WS_CAPTION, + CW_USEDEFAULT, CW_USEDEFAULT, + 0, 0, NULL, NULL, hInstance, NULL); + + // Show it + ShowWindow(hMainWnd, SW_SHOW); + UpdateWindow(hMainWnd); + + // Message Loop + while(GetMessage(&msg,NULL,0,0)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + + GdiplusShutdown(gdiplusToken); + return -1; +} + +LONG +CALLBACK +ImageView_FullscreenW(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2) +{ + return ImageView_CreateWindow(hwnd, (LPWSTR)lParam1); +} + +LONG +CALLBACK +ImageView_Fullscreen(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2) +{ + WCHAR szFile[MAX_PATH]; + + if (MultiByteToWideChar(CP_ACP, 0, (char*)lParam1, strlen((char*)lParam1)+1, szFile, MAX_PATH)) + { + return ImageView_CreateWindow(hwnd, (LPWSTR)szFile); + } + + return -1; +} + +LONG +CALLBACK +ImageView_FullscreenA(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2) +{ + WCHAR szFile[MAX_PATH]; + + if (MultiByteToWideChar(CP_ACP, 0, (char*)lParam1, strlen((char*)lParam1)+1, szFile, MAX_PATH)) + { + return ImageView_CreateWindow(hwnd, (LPWSTR)szFile); + } + + return -1; +} + +BOOL WINAPI +DllMain(IN HINSTANCE hinstDLL, + IN DWORD dwReason, + IN LPVOID lpvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + hInstance = hinstDLL; + break; + } + + return TRUE; +} + Propchange: trunk/reactos/dll/win32/shimgvw/shimgvw.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shimgvw/shimgvw.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/shimgvw.…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/shimgvw.h (added) +++ trunk/reactos/dll/win32/shimgvw/shimgvw.h [iso-8859-1] Wed May 28 14:52:46 2008 @@ -1,0 +1,17 @@ +#include <windows.h> + +#include "resource.h" + +#define TB_IMAGE_WIDTH 16 +#define TB_IMAGE_HEIGHT 16 + +extern HINSTANCE hInstance; + +typedef struct +{ + BOOL Maximized; + INT Left; + INT Top; + INT Right; + INT Bottom; +} SHIMGVW_SETTINGS; Propchange: trunk/reactos/dll/win32/shimgvw/shimgvw.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shimgvw/shimgvw.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/shimgvw.…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/shimgvw.rbuild (added) +++ trunk/reactos/dll/win32/shimgvw/shimgvw.rbuild [iso-8859-1] Wed May 28 14:52:46 2008 @@ -1,0 +1,15 @@ +<module name="shimgvw" type="win32dll" baseaddress="${BASEADDRESS_SHIMGVW}" installbase="system32" installname="shimgvw.dll"> + <importlibrary definition="shimgvw.spec.def" /> + <include base="shimgvw">.</include> + <define name="_DISABLE_TIDENTS" /> + <library>kernel32</library> + <library>advapi32</library> + <library>comctl32</library> + <library>ntdll</library> + <library>user32</library> + <library>gdi32</library> + <library>gdiplus</library> + <file>shimgvw.c</file> + <file>shimgvw.rc</file> + <file>shimgvw.spec</file> +</module> Propchange: trunk/reactos/dll/win32/shimgvw/shimgvw.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shimgvw/shimgvw.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/shimgvw.…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/shimgvw.rc (added) +++ trunk/reactos/dll/win32/shimgvw/shimgvw.rc [iso-8859-1] Wed May 28 14:52:46 2008 @@ -1,0 +1,21 @@ +#include <windows.h> +#include "resource.h" + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Picture and Fax Viewer\0" +#define REACTOS_STR_INTERNAL_NAME "shimgvw\0" +#define REACTOS_STR_ORIGINAL_FILENAME "shimgvw.dll\0" +#include <reactos/version.rc> + +IDI_APPICON ICON "res/main.ico" + +IDB_PREVICON BITMAP "res/prev.bmp" +IDB_NEXTICON BITMAP "res/next.bmp" +IDB_ZOOMPICON BITMAP "res/zoomp.bmp" +IDB_ZOOMMICON BITMAP "res/zoomm.bmp" +IDB_SAVEICON BITMAP "res/save.bmp" +IDB_PRINTICON BITMAP "res/print.bmp" +IDB_ROT1ICON BITMAP "res/rot1.bmp" +IDB_ROT2ICON BITMAP "res/rot2.bmp" + +#include "rsrc.rc" Propchange: trunk/reactos/dll/win32/shimgvw/shimgvw.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shimgvw/shimgvw.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/shimgvw.…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/shimgvw.spec (added) +++ trunk/reactos/dll/win32/shimgvw/shimgvw.spec [iso-8859-1] Wed May 28 14:52:46 2008 @@ -1,0 +1,14 @@ +@ stub ImageView_COMServer +@ stdcall ImageView_Fullscreen(ptr long ptr ptr) +@ stdcall ImageView_FullscreenA(ptr long ptr ptr) +@ stdcall ImageView_FullscreenW(ptr long ptr ptr) +@ stub ImageView_PrintTo +@ stub ImageView_PrintToA +@ stub ImageView_PrintToW +@ stub imageview_fullscreenW +@ stub ConvertDIBSECTIONToThumbnail +@ stub DllCanUnloadNow +@ stub DllGetClassObject +@ stub DllInstall +@ stub DllRegisterServer +@ stub DllUnregisterServer Propchange: trunk/reactos/dll/win32/shimgvw/shimgvw.spec ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Wed May 28 14:52:46 2008 @@ -292,6 +292,9 @@ <directory name="shfolder"> <xi:include href="shfolder/shfolder.rbuild" /> </directory> +<directory name="shimgvw"> + <xi:include href="shimgvw/shimgvw.rbuild" /> +</directory> <directory name="shlwapi"> <xi:include href="shlwapi/shlwapi.rbuild" /> </directory>
16 years, 8 months
1
0
0
0
[dchapyshev] 33740: - Update Russian translation
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed May 28 14:47:11 2008 New Revision: 33740 URL:
http://svn.reactos.org/svn/reactos?rev=33740&view=rev
Log: - Update Russian translation Modified: trunk/reactos/subsystems/win32/csrss/win32csr/lang/ru-RU.rc Modified: trunk/reactos/subsystems/win32/csrss/win32csr/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/lang/ru-RU.rc [iso-8859-1] Wed May 28 14:47:11 2008 @@ -8,7 +8,7 @@ LTEXT "Çàâåðøåíèå ïðîãðàììû... Ïàæàëóéñòà ïîäîæäèòå",IDC_STATIC,7,7,186,11 CONTROL "Progress",IDC_PROGRESS,"msctls_progress32",WS_BORDER, 7,20,186,13 - LTEXT "Åñëè âû çàâåðøèòå ïðîãðàììó ñåé÷àñ, òî âû ìîæåòå ïîòåðÿòü íåñîõðàíåííûå äàííûå. ×òîáû çàâåøèòü ïðîãðàììó ñåé÷àñ íàæìèòå Çàâåðøèòü", + LTEXT "Åñëè âû çàâåðøèòå ïðîãðàììó ñåé÷àñ, òî âû ìîæåòå ïîòåðÿòü íåñîõðàíåííûå äàííûå. ×òîáû çàâåøèòü ïðîãðàììó ñåé÷àñ íàæìèòå ""Çàâåðøèòü""", IDC_STATIC,7,40,186,26 DEFPUSHBUTTON "&Çàâåøèòü",IDC_END_NOW,150,71,43,17 END @@ -21,28 +21,28 @@ DEFPUSHBUTTON "Îòìåíà",IDCANCEL,142,98,43,17 PUSHBUTTON "&Çàâåðøèòü",IDC_END_NOW,78,98,43,17 LTEXT "Ýòà ïðîãðàììà íå îòâå÷àåò",IDC_STATIC,7,7,178,8 - LTEXT "Äëÿ âîçâðàòà â ReactOS è ñîõðàíåíèÿ äàííûõ íàæìèòå Îòìåíà", + LTEXT "Äëÿ âîçâðàòà â ReactOS è ñîõðàíåíèÿ äàííûõ íàæìèòå ""Îòìåíà""", IDC_STATIC,7,26,178,16 - LTEXT "Åñëè âû çàâåðøèòå ïðîãðàììó ñåé÷àñ, òî âû ìîæåòå ïîòåðÿòü íåñîõðàíåííûå äàííûå. ×òîáû çàâåøèòü ïðîãðàììó ñåé÷àñ íàæìèòå Çàâåðøèòü", + LTEXT "Åñëè âû çàâåðøèòå ïðîãðàììó ñåé÷àñ, òî âû ìîæåòå ïîòåðÿòü íåñîõðàíåííûå äàííûå. ×òîáû çàâåøèòü ïðîãðàììó ñåé÷àñ íàæìèòå ""Çàâåðøèòü""", IDC_STATIC,7,53,178,26 END STRINGTABLE BEGIN - IDS_EDIT "Ðåäàêòèðîâàòü" + IDS_EDIT "Èçìåíèòü" IDS_MARK "Ïîìåòèòü" IDS_COPY "Êîïèðîâàòü\tEnter" IDS_PASTE "Âñòàâèòü" IDS_SELECTALL "Âûäåëèòü âñå" IDS_SCROLL "Ïðîêðóòèòü" IDS_FIND "Èñêàòü..." - IDS_DEFAULTS "Defaults" + IDS_DEFAULTS "Óìîë÷àíèÿ" IDS_PROPERTIES "Ñâîéñòâà" IDS_SCROLLHERE "Scroll Here" IDS_SCROLLTOP "Scroll Top" IDS_SCROLLBOTTOM "Ïðîêðóòèòü âíèç" - IDS_SCROLLPAGE_UP "Page Up" - IDS_SCROLLPAGE_DOWN "Page Down" + IDS_SCROLLPAGE_UP "Ââåðõ ñòðàíèöû" + IDS_SCROLLPAGE_DOWN "Âíèç ñòðàíèöû" IDS_SCROLLUP "Ïðîêðóòèòü ââåðõ" IDS_SCROLLDOWN "Scroll Down" END
16 years, 8 months
1
0
0
0
[tkreuzer] 33739: EngCreateClip must allocate CLIPGDI, not only CLIPOBJ
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed May 28 12:22:49 2008 New Revision: 33739 URL:
http://svn.reactos.org/svn/reactos?rev=33739&view=rev
Log: EngCreateClip must allocate CLIPGDI, not only CLIPOBJ Modified: trunk/reactos/subsystems/win32/win32k/eng/clip.c Modified: trunk/reactos/subsystems/win32/win32k/eng/clip.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/clip.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/clip.c [iso-8859-1] Wed May 28 12:22:49 2008 @@ -266,7 +266,7 @@ CLIPOBJ * STDCALL EngCreateClip(VOID) { - CLIPGDI *Clip = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPOBJ), TAG_CLIPOBJ); + CLIPGDI *Clip = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPGDI), TAG_CLIPOBJ); if(Clip != NULL) { return GDIToObj(Clip, CLIP);
16 years, 8 months
1
0
0
0
[tkreuzer] 33738: [FORMATTING] Apply consistent indentation (4 spaces)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed May 28 10:20:56 2008 New Revision: 33738 URL:
http://svn.reactos.org/svn/reactos?rev=33738&view=rev
Log: [FORMATTING] Apply consistent indentation (4 spaces) Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] Wed May 28 10:20:56 2008 @@ -32,35 +32,35 @@ int Y, LPPOINT Point) { - BOOL PathIsOpen; - PDC_ATTR Dc_Attr = dc->pDc_Attr; - if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - if ( Point ) - { - if ( Dc_Attr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit! - { - Point->x = Dc_Attr->ptfxCurrent.x; // ret prev before change. - Point->y = Dc_Attr->ptfxCurrent.y; - IntDPtoLP ( dc, Point, 1); // reconvert back. - } - else - { - Point->x = Dc_Attr->ptlCurrent.x; - Point->y = Dc_Attr->ptlCurrent.y; - } - } - Dc_Attr->ptlCurrent.x = X; - Dc_Attr->ptlCurrent.y = Y; - Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; - CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx - Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); - - PathIsOpen = PATH_IsPathOpen(dc->w.path); - - if ( PathIsOpen ) - return PATH_MoveTo ( dc ); - - return TRUE; + BOOL PathIsOpen; + PDC_ATTR Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + if ( Point ) + { + if ( Dc_Attr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit! + { + Point->x = Dc_Attr->ptfxCurrent.x; // ret prev before change. + Point->y = Dc_Attr->ptfxCurrent.y; + IntDPtoLP ( dc, Point, 1); // reconvert back. + } + else + { + Point->x = Dc_Attr->ptlCurrent.x; + Point->y = Dc_Attr->ptlCurrent.y; + } + } + Dc_Attr->ptlCurrent.x = X; + Dc_Attr->ptlCurrent.y = Y; + Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; + CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx + Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); + + PathIsOpen = PATH_IsPathOpen(dc->w.path); + + if ( PathIsOpen ) + return PATH_MoveTo ( dc ); + + return TRUE; } // Should use Fx in pt @@ -68,20 +68,20 @@ VOID FASTCALL IntGetCurrentPositionEx(PDC dc, LPPOINT pt) { - PDC_ATTR Dc_Attr = dc->pDc_Attr; - if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - if ( pt ) - { - if (Dc_Attr->ulDirty_ & DIRTY_PTFXCURRENT) - { - Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; - CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx - Dc_Attr->ulDirty_ &= ~(DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); - } - pt->x = Dc_Attr->ptlCurrent.x; - pt->y = Dc_Attr->ptlCurrent.y; - } + PDC_ATTR Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + if ( pt ) + { + if (Dc_Attr->ulDirty_ & DIRTY_PTFXCURRENT) + { + Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; + CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx + Dc_Attr->ulDirty_ &= ~(DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); + } + pt->x = Dc_Attr->ptlCurrent.x; + pt->y = Dc_Attr->ptlCurrent.y; + } } BOOL FASTCALL @@ -89,88 +89,88 @@ int XEnd, int YEnd) { - BITMAPOBJ *BitmapObj; - BOOL Ret = TRUE; - PGDIBRUSHOBJ PenBrushObj; - GDIBRUSHINST PenBrushInst; - RECTL Bounds; - POINT Points[2]; - PDC_ATTR Dc_Attr = dc->pDc_Attr; - - if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - if (PATH_IsPathOpen(dc->w.path)) - { - Ret = PATH_LineTo(dc, XEnd, YEnd); - if (Ret) - { - // FIXME - PATH_LineTo should maybe do this... - Dc_Attr->ptlCurrent.x = XEnd; - Dc_Attr->ptlCurrent.y = YEnd; + BITMAPOBJ *BitmapObj; + BOOL Ret = TRUE; + PGDIBRUSHOBJ PenBrushObj; + GDIBRUSHINST PenBrushInst; + RECTL Bounds; + POINT Points[2]; + PDC_ATTR Dc_Attr = dc->pDc_Attr; + + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + if (PATH_IsPathOpen(dc->w.path)) + { + Ret = PATH_LineTo(dc, XEnd, YEnd); + if (Ret) + { + // FIXME - PATH_LineTo should maybe do this... + Dc_Attr->ptlCurrent.x = XEnd; + Dc_Attr->ptlCurrent.y = YEnd; Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); - } - return Ret; - } - else - { - BitmapObj = BITMAPOBJ_LockBitmap ( dc->w.hBitmap ); - if (NULL == BitmapObj) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - - Points[0].x = Dc_Attr->ptlCurrent.x; - Points[0].y = Dc_Attr->ptlCurrent.y; - Points[1].x = XEnd; - Points[1].y = YEnd; - - IntLPtoDP(dc, Points, 2); - - /* FIXME: Is it correct to do this after the transformation? */ - Points[0].x += dc->w.DCOrgX; - Points[0].y += dc->w.DCOrgY; - Points[1].x += dc->w.DCOrgX; - Points[1].y += dc->w.DCOrgY; - - Bounds.left = min(Points[0].x, Points[1].x); - Bounds.top = min(Points[0].y, Points[1].y); - Bounds.right = max(Points[0].x, Points[1].x); - Bounds.bottom = max(Points[0].y, Points[1].y); - - /* get BRUSHOBJ from current pen. */ - PenBrushObj = PENOBJ_LockPen( Dc_Attr->hpen ); - /* FIXME - PenBrushObj can be NULL!!!! Don't assert here! */ - ASSERT(PenBrushObj); - - if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) - { - IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen); - Ret = IntEngLineTo(&BitmapObj->SurfObj, - dc->CombinedClip, - &PenBrushInst.BrushObject, - Points[0].x, Points[0].y, - Points[1].x, Points[1].y, - &Bounds, - ROP2_TO_MIX(Dc_Attr->jROP2)); - } - - BITMAPOBJ_UnlockBitmap ( BitmapObj ); - PENOBJ_UnlockPen( PenBrushObj ); - } - - if (Ret) - { - Dc_Attr->ptlCurrent.x = XEnd; - Dc_Attr->ptlCurrent.y = YEnd; - Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; - CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx - Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); - } - - return Ret; + } + return Ret; + } + else + { + BitmapObj = BITMAPOBJ_LockBitmap ( dc->w.hBitmap ); + if (NULL == BitmapObj) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + + Points[0].x = Dc_Attr->ptlCurrent.x; + Points[0].y = Dc_Attr->ptlCurrent.y; + Points[1].x = XEnd; + Points[1].y = YEnd; + + IntLPtoDP(dc, Points, 2); + + /* FIXME: Is it correct to do this after the transformation? */ + Points[0].x += dc->w.DCOrgX; + Points[0].y += dc->w.DCOrgY; + Points[1].x += dc->w.DCOrgX; + Points[1].y += dc->w.DCOrgY; + + Bounds.left = min(Points[0].x, Points[1].x); + Bounds.top = min(Points[0].y, Points[1].y); + Bounds.right = max(Points[0].x, Points[1].x); + Bounds.bottom = max(Points[0].y, Points[1].y); + + /* get BRUSHOBJ from current pen. */ + PenBrushObj = PENOBJ_LockPen( Dc_Attr->hpen ); + /* FIXME - PenBrushObj can be NULL!!!! Don't assert here! */ + ASSERT(PenBrushObj); + + if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) + { + IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen); + Ret = IntEngLineTo(&BitmapObj->SurfObj, + dc->CombinedClip, + &PenBrushInst.BrushObject, + Points[0].x, Points[0].y, + Points[1].x, Points[1].y, + &Bounds, + ROP2_TO_MIX(Dc_Attr->jROP2)); + } + + BITMAPOBJ_UnlockBitmap ( BitmapObj ); + PENOBJ_UnlockPen( PenBrushObj ); + } + + if (Ret) + { + Dc_Attr->ptlCurrent.x = XEnd; + Dc_Attr->ptlCurrent.y = YEnd; + Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; + CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx + Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); + } + + return Ret; } BOOL FASTCALL @@ -178,27 +178,27 @@ LPPOINT pt, DWORD Count) { - BOOL ret = FALSE; // default to FAILURE - - if ( PATH_IsPathOpen(dc->w.path) ) - { - return PATH_PolyBezier ( dc, pt, Count ); - } - - /* We'll convert it into line segments and draw them using Polyline */ - { - POINT *Pts; - INT nOut; - - Pts = GDI_Bezier ( pt, Count, &nOut ); - if ( Pts ) - { - ret = IntGdiPolyline(dc, Pts, nOut); - ExFreePool(Pts); - } - } - - return ret; + BOOL ret = FALSE; // default to FAILURE + + if ( PATH_IsPathOpen(dc->w.path) ) + { + return PATH_PolyBezier ( dc, pt, Count ); + } + + /* We'll convert it into line segments and draw them using Polyline */ + { + POINT *Pts; + INT nOut; + + Pts = GDI_Bezier ( pt, Count, &nOut ); + if ( Pts ) + { + ret = IntGdiPolyline(dc, Pts, nOut); + ExFreePool(Pts); + } + } + + return ret; } BOOL FASTCALL @@ -206,35 +206,37 @@ LPPOINT pt, DWORD Count) { - BOOL ret = FALSE; // default to failure - PDC_ATTR Dc_Attr = dc->pDc_Attr; - - if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - if ( PATH_IsPathOpen(dc->w.path) ) - ret = PATH_PolyBezierTo ( dc, pt, Count ); - else /* We'll do it using PolyBezier */ - { - POINT *npt; - npt = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * (Count + 1), TAG_BEZIER); - if ( npt ) - { - npt[0].x = Dc_Attr->ptlCurrent.x; - npt[0].y = Dc_Attr->ptlCurrent.y; - memcpy(npt + 1, pt, sizeof(POINT) * Count); - ret = IntGdiPolyBezier(dc, npt, Count+1); - ExFreePool(npt); - } - } - if ( ret ) - { - Dc_Attr->ptlCurrent.x = pt[Count-1].x; - Dc_Attr->ptlCurrent.y = pt[Count-1].y; - Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; - CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx - Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); - } - - return ret; + BOOL ret = FALSE; // default to failure + PDC_ATTR Dc_Attr = dc->pDc_Attr; + + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + if ( PATH_IsPathOpen(dc->w.path) ) + ret = PATH_PolyBezierTo ( dc, pt, Count ); + else /* We'll do it using PolyBezier */ + { + POINT *npt; + npt = ExAllocatePoolWithTag(PagedPool, + sizeof(POINT) * (Count + 1), + TAG_BEZIER); + if ( npt ) + { + npt[0].x = Dc_Attr->ptlCurrent.x; + npt[0].y = Dc_Attr->ptlCurrent.y; + memcpy(npt + 1, pt, sizeof(POINT) * Count); + ret = IntGdiPolyBezier(dc, npt, Count+1); + ExFreePool(npt); + } + } + if ( ret ) + { + Dc_Attr->ptlCurrent.x = pt[Count-1].x; + Dc_Attr->ptlCurrent.y = pt[Count-1].y; + Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; + CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx + Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); + } + + return ret; } BOOL FASTCALL @@ -242,59 +244,63 @@ LPPOINT pt, int Count) { - BITMAPOBJ *BitmapObj; - GDIBRUSHOBJ *PenBrushObj; - GDIBRUSHINST PenBrushInst; - LPPOINT Points; - BOOL Ret = TRUE; - LONG i; - PDC_ATTR Dc_Attr = dc->pDc_Attr; - - if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - if (PATH_IsPathOpen(dc->w.path)) - return PATH_Polyline(dc, pt, Count); - - /* Get BRUSHOBJ from current pen. */ - PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen); - /* FIXME - PenBrushObj can be NULL! Don't assert here! */ - ASSERT(PenBrushObj); - - if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) - { - Points = EngAllocMem(0, Count * sizeof(POINT), TAG_COORD); - if (Points != NULL) - { - BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap); - /* FIXME - BitmapObj can be NULL!!!! Don't assert but handle this case gracefully! */ - ASSERT(BitmapObj); - - RtlCopyMemory(Points, pt, Count * sizeof(POINT)); - IntLPtoDP(dc, Points, Count); - - /* Offset the array of point by the dc->w.DCOrg */ - for (i = 0; i < Count; i++) - { - Points[i].x += dc->w.DCOrgX; - Points[i].y += dc->w.DCOrgY; - } - - IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen); - Ret = IntEngPolyline(&BitmapObj->SurfObj, dc->CombinedClip, - &PenBrushInst.BrushObject, Points, Count, - ROP2_TO_MIX(Dc_Attr->jROP2)); - - BITMAPOBJ_UnlockBitmap(BitmapObj); - EngFreeMem(Points); - } - else - { - Ret = FALSE; - } - } - - PENOBJ_UnlockPen(PenBrushObj); - - return Ret; + BITMAPOBJ *BitmapObj; + GDIBRUSHOBJ *PenBrushObj; + GDIBRUSHINST PenBrushInst; + LPPOINT Points; + BOOL Ret = TRUE; + LONG i; + PDC_ATTR Dc_Attr = dc->pDc_Attr; + + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + if (PATH_IsPathOpen(dc->w.path)) + return PATH_Polyline(dc, pt, Count); + + /* Get BRUSHOBJ from current pen. */ + PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen); + /* FIXME - PenBrushObj can be NULL! Don't assert here! */ + ASSERT(PenBrushObj); + + if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) + { + Points = EngAllocMem(0, Count * sizeof(POINT), TAG_COORD); + if (Points != NULL) + { + BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap); + /* FIXME - BitmapObj can be NULL!!!! + Don't assert but handle this case gracefully! */ + ASSERT(BitmapObj); + + RtlCopyMemory(Points, pt, Count * sizeof(POINT)); + IntLPtoDP(dc, Points, Count); + + /* Offset the array of point by the dc->w.DCOrg */ + for (i = 0; i < Count; i++) + { + Points[i].x += dc->w.DCOrgX; + Points[i].y += dc->w.DCOrgY; + } + + IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen); + Ret = IntEngPolyline(&BitmapObj->SurfObj, + dc->CombinedClip, + &PenBrushInst.BrushObject, + Points, + Count, + ROP2_TO_MIX(Dc_Attr->jROP2)); + + BITMAPOBJ_UnlockBitmap(BitmapObj); + EngFreeMem(Points); + } + else + { + Ret = FALSE; + } + } + + PENOBJ_UnlockPen(PenBrushObj); + + return Ret; } BOOL FASTCALL @@ -302,36 +308,38 @@ LPPOINT pt, DWORD Count) { - BOOL ret = FALSE; // default to failure - PDC_ATTR Dc_Attr = dc->pDc_Attr; - - if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - if(PATH_IsPathOpen(dc->w.path)) - { - ret = PATH_PolylineTo(dc, pt, Count); - } - else /* do it using Polyline */ - { - POINT *pts = ExAllocatePoolWithTag(PagedPool, sizeof(POINT) * (Count + 1), TAG_SHAPE); - if ( pts ) - { - pts[0].x = Dc_Attr->ptlCurrent.x; - pts[0].y = Dc_Attr->ptlCurrent.y; - memcpy( pts + 1, pt, sizeof(POINT) * Count); - ret = IntGdiPolyline(dc, pts, Count + 1); - ExFreePool(pts); - } - } - if ( ret ) - { - Dc_Attr->ptlCurrent.x = pt[Count-1].x; - Dc_Attr->ptlCurrent.y = pt[Count-1].y; - Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; - CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx - Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); - } - - return ret; + BOOL ret = FALSE; // default to failure + PDC_ATTR Dc_Attr = dc->pDc_Attr; + + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + if (PATH_IsPathOpen(dc->w.path)) + { + ret = PATH_PolylineTo(dc, pt, Count); + } + else /* do it using Polyline */ + { + POINT *pts = ExAllocatePoolWithTag(PagedPool, + sizeof(POINT) * (Count + 1), + TAG_SHAPE); + if ( pts ) + { + pts[0].x = Dc_Attr->ptlCurrent.x; + pts[0].y = Dc_Attr->ptlCurrent.y; + memcpy( pts + 1, pt, sizeof(POINT) * Count); + ret = IntGdiPolyline(dc, pts, Count + 1); + ExFreePool(pts); + } + } + if ( ret ) + { + Dc_Attr->ptlCurrent.x = pt[Count-1].x; + Dc_Attr->ptlCurrent.y = pt[Count-1].y; + Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent; + CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx + Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); + } + + return ret; } @@ -341,24 +349,24 @@ LPDWORD PolyPoints, DWORD Count) { - int i; - LPPOINT pts; - LPDWORD pc; - BOOL ret = FALSE; // default to failure - pts = pt; - pc = PolyPoints; - - for (i = 0; i < Count; i++) - { - ret = IntGdiPolyline ( dc, pts, *pc ); - if (ret == FALSE) - { - return ret; - } - pts+=*pc++; - } - - return ret; + int i; + LPPOINT pts; + LPDWORD pc; + BOOL ret = FALSE; // default to failure + pts = pt; + pc = PolyPoints; + + for (i = 0; i < Count; i++) + { + ret = IntGdiPolyline ( dc, pts, *pc ); + if (ret == FALSE) + { + return ret; + } + pts+=*pc++; + } + + return ret; } /******************************************************************************/ @@ -373,37 +381,37 @@ IN DWORD dwStartAngle, IN DWORD dwSweepAngle) { - UNIMPLEMENTED; - return FALSE; + UNIMPLEMENTED; + return FALSE; } BOOL STDCALL NtGdiLineTo(HDC hDC, - int XEnd, - int YEnd) -{ - DC *dc; - BOOL Ret; - - dc = DC_LockDc(hDC); - if(!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - if (dc->DC_Type == DC_TYPE_INFO) - { + int XEnd, + int YEnd) +{ + DC *dc; + BOOL Ret; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + if (dc->DC_Type == DC_TYPE_INFO) + { + DC_UnlockDc(dc); + /* Yes, Windows really returns TRUE in this case */ + return TRUE; + } + + Ret = IntGdiLineTo(dc, XEnd, YEnd); + DC_UnlockDc(dc); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - Ret = IntGdiLineTo(dc, XEnd, YEnd); - - DC_UnlockDc(dc); - return Ret; + return Ret; } BOOL @@ -419,9 +427,9 @@ POINT lastmove; unsigned int i; PDC_ATTR Dc_Attr = NULL; - + dc = DC_LockDc(hdc); - if(!dc) return FALSE; + if (!dc) return FALSE; Dc_Attr = dc->pDc_Attr; if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; @@ -431,12 +439,14 @@ ProbeArrayForRead(lpbTypes, sizeof(BYTE), cCount, sizeof(BYTE)); /* check for each bezierto if there are two more points */ - for( i = 0; i < cCount; i++ ) - if( lpbTypes[i] != PT_MOVETO && - lpbTypes[i] & PT_BEZIERTO ) - { - if( cCount < i+3 ) _SEH_LEAVE; - else i += 2; + for ( i = 0; i < cCount; i++ ) + { + if ( lpbTypes[i] != PT_MOVETO && + lpbTypes[i] & PT_BEZIERTO ) + { + if ( cCount < i+3 ) _SEH_LEAVE; + else i += 2; + } } /* if no moveto occurs, we will close the figure here */ @@ -444,17 +454,17 @@ lastmove.y = Dc_Attr->ptlCurrent.y; /* now let's draw */ - for( i = 0; i < cCount; i++ ) - { - if( lpbTypes[i] == PT_MOVETO ) + for ( i = 0; i < cCount; i++ ) + { + if ( lpbTypes[i] == PT_MOVETO ) { IntGdiMoveToEx( dc, lppt[i].x, lppt[i].y, NULL ); lastmove.x = Dc_Attr->ptlCurrent.x; lastmove.y = Dc_Attr->ptlCurrent.y; } - else if( lpbTypes[i] & PT_LINETO ) + else if ( lpbTypes[i] & PT_LINETO ) IntGdiLineTo( dc, lppt[i].x, lppt[i].y ); - else if( lpbTypes[i] & PT_BEZIERTO ) + else if ( lpbTypes[i] & PT_BEZIERTO ) { POINT pts[4]; pts[0].x = Dc_Attr->ptlCurrent.x; @@ -465,9 +475,12 @@ } else _SEH_LEAVE; - if( lpbTypes[i] & PT_CLOSEFIGURE ) + if ( lpbTypes[i] & PT_CLOSEFIGURE ) { - if( PATH_IsPathOpen( dc->w.path ) ) IntGdiCloseFigure( dc ); + if ( PATH_IsPathOpen(dc->w.path) ) + { + IntGdiCloseFigure( dc ); + } else IntGdiLineTo( dc, lastmove.x, lastmove.y ); } }
16 years, 8 months
1
0
0
0
[tkreuzer] 33737: [FORMATTING] Fix indentation: 4 spaces, no code change
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed May 28 09:32:06 2008 New Revision: 33737 URL:
http://svn.reactos.org/svn/reactos?rev=33737&view=rev
Log: [FORMATTING] Fix indentation: 4 spaces, no code change Modified: trunk/reactos/subsystems/win32/win32k/eng/lineto.c Modified: trunk/reactos/subsystems/win32/win32k/eng/lineto.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/lineto.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/lineto.c [iso-8859-1] Wed May 28 09:32:06 2008 @@ -27,17 +27,17 @@ static void FASTCALL TranslateRects(RECT_ENUM *RectEnum, POINTL* Translate) { - RECTL* CurrentRect; - - if (0 != Translate->x || 0 != Translate->y) - { - for (CurrentRect = RectEnum->arcl; CurrentRect < RectEnum->arcl + RectEnum->c; CurrentRect++) - { - CurrentRect->left += Translate->x; - CurrentRect->right += Translate->x; - CurrentRect->top += Translate->y; - CurrentRect->bottom += Translate->y; - } + RECTL* CurrentRect; + + if (0 != Translate->x || 0 != Translate->y) + { + for (CurrentRect = RectEnum->arcl; CurrentRect < RectEnum->arcl + RectEnum->c; CurrentRect++) + { + CurrentRect->left += Translate->x; + CurrentRect->right += Translate->x; + CurrentRect->top += Translate->y; + CurrentRect->bottom += Translate->y; + } } } @@ -49,69 +49,69 @@ BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay, POINTL* Translate) { - int i; - int error; - BOOLEAN EnumMore; - RECTL* ClipRect; - RECT_ENUM RectEnum; - ULONG Pixel = Brush->iSolidColor; - LONG delta; - - CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0); - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - TranslateRects(&RectEnum, Translate); - ClipRect = RectEnum.arcl; - delta = max(deltax, deltay); - i = 0; - error = delta >> 1; - while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore)) - { - while ((ClipRect < RectEnum.arcl + RectEnum.c /* there's still a current clip rect */ - && (ClipRect->bottom <= y /* but it's above us */ - || (ClipRect->top <= y && ClipRect->right <= x))) /* or to the left of us */ - || EnumMore) /* no current clip rect, but rects left */ - { - /* Skip to the next clip rect */ - if (RectEnum.arcl + RectEnum.c <= ClipRect) - { - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - TranslateRects(&RectEnum, Translate); - ClipRect = RectEnum.arcl; - } - else - { - ClipRect++; - } - } - if (ClipRect < RectEnum.arcl + RectEnum.c) /* If there's no current clip rect we're done */ - { - if (ClipRect->left <= x && ClipRect->top <= y) - { - DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel( - OutputObj, x, y, Pixel); - } - if (deltax < deltay) - { - y++; - error = error + deltax; - if (deltay <= error) - { - x++; - error = error - deltay; - } - } - else - { - x++; - error = error + deltay; - if (deltax <= error) - { - y++; - error = error - deltax; - } - } - i++; - } + int i; + int error; + BOOLEAN EnumMore; + RECTL* ClipRect; + RECT_ENUM RectEnum; + ULONG Pixel = Brush->iSolidColor; + LONG delta; + + CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0); + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + TranslateRects(&RectEnum, Translate); + ClipRect = RectEnum.arcl; + delta = max(deltax, deltay); + i = 0; + error = delta >> 1; + while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore)) + { + while ((ClipRect < RectEnum.arcl + RectEnum.c /* there's still a current clip rect */ + && (ClipRect->bottom <= y /* but it's above us */ + || (ClipRect->top <= y && ClipRect->right <= x))) /* or to the left of us */ + || EnumMore) /* no current clip rect, but rects left */ + { + /* Skip to the next clip rect */ + if (RectEnum.arcl + RectEnum.c <= ClipRect) + { + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + TranslateRects(&RectEnum, Translate); + ClipRect = RectEnum.arcl; + } + else + { + ClipRect++; + } + } + if (ClipRect < RectEnum.arcl + RectEnum.c) /* If there's no current clip rect we're done */ + { + if (ClipRect->left <= x && ClipRect->top <= y) + { + DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel( + OutputObj, x, y, Pixel); + } + if (deltax < deltay) + { + y++; + error = error + deltax; + if (deltay <= error) + { + x++; + error = error - deltay; + } + } + else + { + x++; + error = error + deltay; + if (deltax <= error) + { + y++; + error = error - deltax; + } + } + i++; + } } } @@ -120,68 +120,68 @@ BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay, POINTL* Translate) { - int i; - int error; - BOOLEAN EnumMore; - RECTL* ClipRect; - RECT_ENUM RectEnum; - ULONG Pixel = Brush->iSolidColor; - LONG delta; - - CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTUP, 0); - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - TranslateRects(&RectEnum, Translate); - ClipRect = RectEnum.arcl; - delta = max(deltax, deltay); - i = 0; - error = delta >> 1; - while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore)) - { - while ((ClipRect < RectEnum.arcl + RectEnum.c - && (y < ClipRect->top - || (y < ClipRect->bottom && ClipRect->right <= x))) - || EnumMore) - { - if (RectEnum.arcl + RectEnum.c <= ClipRect) - { - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - TranslateRects(&RectEnum, Translate); - ClipRect = RectEnum.arcl; - } - else - { - ClipRect++; - } - } - if (ClipRect < RectEnum.arcl + RectEnum.c) - { - if (ClipRect->left <= x && y < ClipRect->bottom) - { - DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel( - OutputObj, x, y, Pixel); - } - if (deltax < deltay) - { - y--; - error = error + deltax; - if (deltay <= error) - { - x++; - error = error - deltay; - } - } - else - { - x++; - error = error + deltay; - if (deltax <= error) - { - y--; - error = error - deltax; - } - } - i++; - } + int i; + int error; + BOOLEAN EnumMore; + RECTL* ClipRect; + RECT_ENUM RectEnum; + ULONG Pixel = Brush->iSolidColor; + LONG delta; + + CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTUP, 0); + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + TranslateRects(&RectEnum, Translate); + ClipRect = RectEnum.arcl; + delta = max(deltax, deltay); + i = 0; + error = delta >> 1; + while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore)) + { + while ((ClipRect < RectEnum.arcl + RectEnum.c + && (y < ClipRect->top + || (y < ClipRect->bottom && ClipRect->right <= x))) + || EnumMore) + { + if (RectEnum.arcl + RectEnum.c <= ClipRect) + { + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + TranslateRects(&RectEnum, Translate); + ClipRect = RectEnum.arcl; + } + else + { + ClipRect++; + } + } + if (ClipRect < RectEnum.arcl + RectEnum.c) + { + if (ClipRect->left <= x && y < ClipRect->bottom) + { + DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel( + OutputObj, x, y, Pixel); + } + if (deltax < deltay) + { + y--; + error = error + deltax; + if (deltay <= error) + { + x++; + error = error - deltay; + } + } + else + { + x++; + error = error + deltay; + if (deltax <= error) + { + y--; + error = error - deltax; + } + } + i++; + } } } @@ -190,68 +190,68 @@ BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay, POINTL* Translate) { - int i; - int error; - BOOLEAN EnumMore; - RECTL* ClipRect; - RECT_ENUM RectEnum; - ULONG Pixel = Brush->iSolidColor; - LONG delta; - - CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_LEFTDOWN, 0); - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - TranslateRects(&RectEnum, Translate); - ClipRect = RectEnum.arcl; - delta = max(deltax, deltay); - i = 0; - error = delta >> 1; - while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore)) - { - while ((ClipRect < RectEnum.arcl + RectEnum.c - && (ClipRect->bottom <= y - || (ClipRect->top <= y && x < ClipRect->left))) - || EnumMore) - { - if (RectEnum.arcl + RectEnum.c <= ClipRect) - { - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - TranslateRects(&RectEnum, Translate); - ClipRect = RectEnum.arcl; - } - else - { - ClipRect++; - } - } - if (ClipRect < RectEnum.arcl + RectEnum.c) - { - if (x < ClipRect->right && ClipRect->top <= y) - { - DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel( - OutputObj, x, y, Pixel); - } - if (deltax < deltay) - { - y++; - error = error + deltax; - if (deltay <= error) - { - x--; - error = error - deltay; - } - } - else - { - x--; - error = error + deltay; - if (deltax <= error) - { - y++; - error = error - deltax; - } - } - i++; - } + int i; + int error; + BOOLEAN EnumMore; + RECTL* ClipRect; + RECT_ENUM RectEnum; + ULONG Pixel = Brush->iSolidColor; + LONG delta; + + CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_LEFTDOWN, 0); + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + TranslateRects(&RectEnum, Translate); + ClipRect = RectEnum.arcl; + delta = max(deltax, deltay); + i = 0; + error = delta >> 1; + while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore)) + { + while ((ClipRect < RectEnum.arcl + RectEnum.c + && (ClipRect->bottom <= y + || (ClipRect->top <= y && x < ClipRect->left))) + || EnumMore) + { + if (RectEnum.arcl + RectEnum.c <= ClipRect) + { + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + TranslateRects(&RectEnum, Translate); + ClipRect = RectEnum.arcl; + } + else + { + ClipRect++; + } + } + if (ClipRect < RectEnum.arcl + RectEnum.c) + { + if (x < ClipRect->right && ClipRect->top <= y) + { + DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel( + OutputObj, x, y, Pixel); + } + if (deltax < deltay) + { + y++; + error = error + deltax; + if (deltay <= error) + { + x--; + error = error - deltay; + } + } + else + { + x--; + error = error + deltay; + if (deltax <= error) + { + y++; + error = error - deltax; + } + } + i++; + } } } @@ -260,68 +260,68 @@ BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay, POINTL* Translate) { - int i; - int error; - BOOLEAN EnumMore; - RECTL* ClipRect; - RECT_ENUM RectEnum; - ULONG Pixel = Brush->iSolidColor; - LONG delta; - - CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_LEFTUP, 0); - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - TranslateRects(&RectEnum, Translate); - ClipRect = RectEnum.arcl; - delta = max(deltax, deltay); - i = 0; - error = delta >> 1; - while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore)) - { - while ((ClipRect < RectEnum.arcl + RectEnum.c - && (y < ClipRect->top - || (y < ClipRect->bottom && x < ClipRect->left))) - || EnumMore) - { - if (RectEnum.arcl + RectEnum.c <= ClipRect) - { - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - TranslateRects(&RectEnum, Translate); - ClipRect = RectEnum.arcl; - } - else - { - ClipRect++; - } - } - if (ClipRect < RectEnum.arcl + RectEnum.c) - { - if (x < ClipRect->right && y < ClipRect->bottom) - { - DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel( - OutputObj, x, y, Pixel); - } - if (deltax < deltay) - { - y--; - error = error + deltax; - if (deltay <= error) - { - x--; - error = error - deltay; - } - } - else - { - x--; - error = error + deltay; - if (deltax <= error) - { - y--; - error = error - deltax; - } - } - i++; - } + int i; + int error; + BOOLEAN EnumMore; + RECTL* ClipRect; + RECT_ENUM RectEnum; + ULONG Pixel = Brush->iSolidColor; + LONG delta; + + CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_LEFTUP, 0); + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + TranslateRects(&RectEnum, Translate); + ClipRect = RectEnum.arcl; + delta = max(deltax, deltay); + i = 0; + error = delta >> 1; + while (i < delta && (ClipRect < RectEnum.arcl + RectEnum.c || EnumMore)) + { + while ((ClipRect < RectEnum.arcl + RectEnum.c + && (y < ClipRect->top + || (y < ClipRect->bottom && x < ClipRect->left))) + || EnumMore) + { + if (RectEnum.arcl + RectEnum.c <= ClipRect) + { + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + TranslateRects(&RectEnum, Translate); + ClipRect = RectEnum.arcl; + } + else + { + ClipRect++; + } + } + if (ClipRect < RectEnum.arcl + RectEnum.c) + { + if (x < ClipRect->right && y < ClipRect->bottom) + { + DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_PutPixel( + OutputObj, x, y, Pixel); + } + if (deltax < deltay) + { + y--; + error = error + deltax; + if (deltay <= error) + { + x--; + error = error - deltay; + } + } + else + { + x--; + error = error + deltay; + if (deltax <= error) + { + y--; + error = error - deltax; + } + } + i++; + } } } @@ -330,289 +330,289 @@ */ BOOL STDCALL EngLineTo(SURFOBJ *DestObj, - CLIPOBJ *Clip, - BRUSHOBJ *Brush, - LONG x1, - LONG y1, - LONG x2, - LONG y2, - RECTL *RectBounds, - MIX mix) -{ - LONG x, y, deltax, deltay, xchange, ychange, hx, vy; - ULONG i; - ULONG Pixel = Brush->iSolidColor; - SURFOBJ *OutputObj; - RECTL DestRect; - POINTL Translate; - INTENG_ENTER_LEAVE EnterLeave; - RECT_ENUM RectEnum; - BOOL EnumMore; - - if (x1 < x2) - { - DestRect.left = x1; - DestRect.right = x2; - } - else - { - DestRect.left = x2; - DestRect.right = x1 + 1; - } - if (y1 < y2) - { - DestRect.top = y1; - DestRect.bottom = y2; - } - else - { - DestRect.top = y2; - DestRect.bottom = y1 + 1; - } - - if (! IntEngEnter(&EnterLeave, DestObj, &DestRect, FALSE, &Translate, &OutputObj)) - { - return FALSE; - } - - x1 += Translate.x; - x2 += Translate.x; - y1 += Translate.y; - y2 += Translate.y; - - x = x1; - y = y1; - deltax = x2 - x1; - deltay = y2 - y1; - - if (0 == deltax && 0 == deltay) - { - return TRUE; - } - - if (deltax < 0) - { - xchange = -1; - deltax = - deltax; - hx = x2 + 1; - } - else - { - xchange = 1; - hx = x1; - } - - if (deltay < 0) - { - ychange = -1; - deltay = - deltay; - vy = y2 + 1; - } - else - { - ychange = 1; - vy = y1; - } - - if (y1 == y2) - { - CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0); - do - { - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - for (i = 0; i < RectEnum.c && RectEnum.arcl[i].top + Translate.y <= y1; i++) - { - if (y1 < RectEnum.arcl[i].bottom + Translate.y && - RectEnum.arcl[i].left + Translate.x <= hx + deltax && - hx < RectEnum.arcl[i].right + Translate.x && - max(hx, RectEnum.arcl[i].left + Translate.x) < - min(hx + deltax, RectEnum.arcl[i].right + Translate.x)) - { - DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_HLine( - OutputObj, - max(hx, RectEnum.arcl[i].left + Translate.x), - min(hx + deltax, RectEnum.arcl[i].right + Translate.x), - y1, Pixel); - } - } - } - while (EnumMore); - } - else if (x1 == x2) - { - CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0); - do - { - EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); - for (i = 0; i < RectEnum.c; i++) - { - if (RectEnum.arcl[i].left + Translate.x <= x1 && - x1 < RectEnum.arcl[i].right + Translate.x && - RectEnum.arcl[i].top + Translate.y <= vy + deltay && - vy < RectEnum.arcl[i].bottom + Translate.y) - { - DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_VLine( - OutputObj, x1, - max(vy, RectEnum.arcl[i].top + Translate.y), - min(vy + deltay, RectEnum.arcl[i].bottom + Translate.y), - Pixel); - } - } - } - while (EnumMore); - } - else - { - if (0 < xchange) - { - if (0 < ychange) - { - NWtoSE(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate); - } - else - { - SWtoNE(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate); - } - } - else - { - if (0 < ychange) - { - NEtoSW(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate); - } - else - { - SEtoNW(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate); - } - } - } - - return IntEngLeave(&EnterLeave); + CLIPOBJ *Clip, + BRUSHOBJ *Brush, + LONG x1, + LONG y1, + LONG x2, + LONG y2, + RECTL *RectBounds, + MIX mix) +{ + LONG x, y, deltax, deltay, xchange, ychange, hx, vy; + ULONG i; + ULONG Pixel = Brush->iSolidColor; + SURFOBJ *OutputObj; + RECTL DestRect; + POINTL Translate; + INTENG_ENTER_LEAVE EnterLeave; + RECT_ENUM RectEnum; + BOOL EnumMore; + + if (x1 < x2) + { + DestRect.left = x1; + DestRect.right = x2; + } + else + { + DestRect.left = x2; + DestRect.right = x1 + 1; + } + if (y1 < y2) + { + DestRect.top = y1; + DestRect.bottom = y2; + } + else + { + DestRect.top = y2; + DestRect.bottom = y1 + 1; + } + + if (! IntEngEnter(&EnterLeave, DestObj, &DestRect, FALSE, &Translate, &OutputObj)) + { + return FALSE; + } + + x1 += Translate.x; + x2 += Translate.x; + y1 += Translate.y; + y2 += Translate.y; + + x = x1; + y = y1; + deltax = x2 - x1; + deltay = y2 - y1; + + if (0 == deltax && 0 == deltay) + { + return TRUE; + } + + if (deltax < 0) + { + xchange = -1; + deltax = - deltax; + hx = x2 + 1; + } + else + { + xchange = 1; + hx = x1; + } + + if (deltay < 0) + { + ychange = -1; + deltay = - deltay; + vy = y2 + 1; + } + else + { + ychange = 1; + vy = y1; + } + + if (y1 == y2) + { + CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0); + do + { + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + for (i = 0; i < RectEnum.c && RectEnum.arcl[i].top + Translate.y <= y1; i++) + { + if (y1 < RectEnum.arcl[i].bottom + Translate.y && + RectEnum.arcl[i].left + Translate.x <= hx + deltax && + hx < RectEnum.arcl[i].right + Translate.x && + max(hx, RectEnum.arcl[i].left + Translate.x) < + min(hx + deltax, RectEnum.arcl[i].right + Translate.x)) + { + DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_HLine( + OutputObj, + max(hx, RectEnum.arcl[i].left + Translate.x), + min(hx + deltax, RectEnum.arcl[i].right + Translate.x), + y1, Pixel); + } + } + } + while (EnumMore); + } + else if (x1 == x2) + { + CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0); + do + { + EnumMore = CLIPOBJ_bEnum(Clip, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum); + for (i = 0; i < RectEnum.c; i++) + { + if (RectEnum.arcl[i].left + Translate.x <= x1 && + x1 < RectEnum.arcl[i].right + Translate.x && + RectEnum.arcl[i].top + Translate.y <= vy + deltay && + vy < RectEnum.arcl[i].bottom + Translate.y) + { + DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_VLine( + OutputObj, x1, + max(vy, RectEnum.arcl[i].top + Translate.y), + min(vy + deltay, RectEnum.arcl[i].bottom + Translate.y), + Pixel); + } + } + } + while (EnumMore); + } + else + { + if (0 < xchange) + { + if (0 < ychange) + { + NWtoSE(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate); + } + else + { + SWtoNE(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate); + } + } + else + { + if (0 < ychange) + { + NEtoSW(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate); + } + else + { + SEtoNW(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate); + } + } + } + + return IntEngLeave(&EnterLeave); } BOOL STDCALL IntEngLineTo(SURFOBJ *DestSurf, - CLIPOBJ *ClipObj, - BRUSHOBJ *Brush, - LONG x1, - LONG y1, - LONG x2, - LONG y2, - RECTL *RectBounds, - MIX Mix) -{ - BOOLEAN ret; - BITMAPOBJ *DestObj; - PGDIBRUSHINST GdiBrush; - RECTL b; - - ASSERT(DestSurf); - DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj); - ASSERT(DestObj); - - GdiBrush = CONTAINING_RECORD( - Brush, - GDIBRUSHINST, - BrushObject); - ASSERT(GdiBrush); - ASSERT(GdiBrush->GdiBrushObject); - - if (GdiBrush->GdiBrushObject->flAttrs & GDIBRUSH_IS_NULL) - return TRUE; - - /* No success yet */ - ret = FALSE; - - /* Clip lines totally outside the clip region. This is not done as an - * optimization (there are very few lines drawn outside the region) but - * as a workaround for what seems to be a problem in the CL54XX driver */ - if (NULL == ClipObj || DC_TRIVIAL == ClipObj->iDComplexity) - { - b.left = 0; - b.right = DestSurf->sizlBitmap.cx; - b.top = 0; - b.bottom = DestSurf->sizlBitmap.cy; - } - else - { - b = ClipObj->rclBounds; - } - if ((x1 < b.left && x2 < b.left) || (b.right <= x1 && b.right <= x2) || - (y1 < b.top && y2 < b.top) || (b.bottom <= y1 && b.bottom <= y2)) - { - return TRUE; - } - - b.left = min(x1, x2); - b.right = max(x1, x2); - b.top = min(y1, y2); - b.bottom = max(y1, y2); - if (b.left == b.right) b.right++; - if (b.top == b.bottom) b.bottom++; - - BITMAPOBJ_LockBitmapBits(DestObj); - MouseSafetyOnDrawStart(DestSurf, x1, y1, x2, y2); - - if (DestObj->flHooks & HOOK_LINETO) - { - /* Call the driver's DrvLineTo */ - ret = GDIDEVFUNCS(DestSurf).LineTo( - DestSurf, ClipObj, Brush, x1, y1, x2, y2, &b, Mix); + CLIPOBJ *ClipObj, + BRUSHOBJ *Brush, + LONG x1, + LONG y1, + LONG x2, + LONG y2, + RECTL *RectBounds, + MIX Mix) +{ + BOOLEAN ret; + BITMAPOBJ *DestObj; + PGDIBRUSHINST GdiBrush; + RECTL b; + + ASSERT(DestSurf); + DestObj = CONTAINING_RECORD(DestSurf, BITMAPOBJ, SurfObj); + ASSERT(DestObj); + + GdiBrush = CONTAINING_RECORD( + Brush, + GDIBRUSHINST, + BrushObject); + ASSERT(GdiBrush); + ASSERT(GdiBrush->GdiBrushObject); + + if (GdiBrush->GdiBrushObject->flAttrs & GDIBRUSH_IS_NULL) + return TRUE; + + /* No success yet */ + ret = FALSE; + + /* Clip lines totally outside the clip region. This is not done as an + * optimization (there are very few lines drawn outside the region) but + * as a workaround for what seems to be a problem in the CL54XX driver */ + if (NULL == ClipObj || DC_TRIVIAL == ClipObj->iDComplexity) + { + b.left = 0; + b.right = DestSurf->sizlBitmap.cx; + b.top = 0; + b.bottom = DestSurf->sizlBitmap.cy; + } + else + { + b = ClipObj->rclBounds; + } + if ((x1 < b.left && x2 < b.left) || (b.right <= x1 && b.right <= x2) || + (y1 < b.top && y2 < b.top) || (b.bottom <= y1 && b.bottom <= y2)) + { + return TRUE; + } + + b.left = min(x1, x2); + b.right = max(x1, x2); + b.top = min(y1, y2); + b.bottom = max(y1, y2); + if (b.left == b.right) b.right++; + if (b.top == b.bottom) b.bottom++; + + BITMAPOBJ_LockBitmapBits(DestObj); + MouseSafetyOnDrawStart(DestSurf, x1, y1, x2, y2); + + if (DestObj->flHooks & HOOK_LINETO) + { + /* Call the driver's DrvLineTo */ + ret = GDIDEVFUNCS(DestSurf).LineTo( + DestSurf, ClipObj, Brush, x1, y1, x2, y2, &b, Mix); } #if 0 - if (! ret && (DestObj->flHooks & HOOK_STROKEPATH)) - { - /* FIXME: Emulate LineTo using drivers DrvStrokePath and set ret on success */ + if (! ret && (DestObj->flHooks & HOOK_STROKEPATH)) + { + /* FIXME: Emulate LineTo using drivers DrvStrokePath and set ret on success */ } #endif - if (! ret) - { - ret = EngLineTo(DestSurf, ClipObj, Brush, x1, y1, x2, y2, RectBounds, Mix); - } - - MouseSafetyOnDrawEnd(DestSurf); - BITMAPOBJ_UnlockBitmapBits(DestObj); - - return ret; + if (! ret) + { + ret = EngLineTo(DestSurf, ClipObj, Brush, x1, y1, x2, y2, RectBounds, Mix); + } + + MouseSafetyOnDrawEnd(DestSurf); + BITMAPOBJ_UnlockBitmapBits(DestObj); + + return ret; } BOOL STDCALL IntEngPolyline(SURFOBJ *DestSurf, - CLIPOBJ *Clip, - BRUSHOBJ *Brush, - CONST LPPOINT pt, + CLIPOBJ *Clip, + BRUSHOBJ *Brush, + CONST LPPOINT pt, LONG dCount, - MIX Mix) -{ - LONG i; - RECTL rect; - BOOL ret = FALSE; - - //Draw the Polyline with a call to IntEngLineTo for each segment. - for (i = 1; i < dCount; i++) - { - rect.left = min(pt[i-1].x, pt[i].x); - rect.top = min(pt[i-1].y, pt[i].y); - rect.right = max(pt[i-1].x, pt[i].x); - rect.bottom = max(pt[i-1].y, pt[i].y); - ret = IntEngLineTo(DestSurf, - Clip, - Brush, - pt[i-1].x, - pt[i-1].y, - pt[i].x, - pt[i].y, - &rect, - Mix); - if (!ret) - { - break; - } - } - - return ret; + MIX Mix) +{ + LONG i; + RECTL rect; + BOOL ret = FALSE; + + //Draw the Polyline with a call to IntEngLineTo for each segment. + for (i = 1; i < dCount; i++) + { + rect.left = min(pt[i-1].x, pt[i].x); + rect.top = min(pt[i-1].y, pt[i].y); + rect.right = max(pt[i-1].x, pt[i].x); + rect.bottom = max(pt[i-1].y, pt[i].y); + ret = IntEngLineTo(DestSurf, + Clip, + Brush, + pt[i-1].x, + pt[i-1].y, + pt[i].x, + pt[i].y, + &rect, + Mix); + if (!ret) + { + break; + } + } + + return ret; } /* EOF */
16 years, 8 months
1
0
0
0
[dreimer] 33736: Updated winhelp from wine and renamed accordingly from winhelp to winhlp32.
by dreimer@svn.reactos.org
Author: dreimer Date: Wed May 28 02:43:38 2008 New Revision: 33736 URL:
http://svn.reactos.org/svn/reactos?rev=33736&view=rev
Log: Updated winhelp from wine and renamed accordingly from winhelp to winhlp32. Added: trunk/reactos/base/applications/winhlp32/ - copied from r33735, trunk/reactos/base/applications/winhelp/ trunk/reactos/base/applications/winhlp32/winhlp32.rbuild (with props) Removed: trunk/reactos/base/applications/winhelp/ trunk/reactos/base/applications/winhlp32/winhelp.rbuild Modified: trunk/reactos/base/applications/applications.rbuild trunk/reactos/base/applications/winhlp32/lang/da-DK.rc trunk/reactos/base/applications/winhlp32/lang/de-DE.rc trunk/reactos/base/applications/winhlp32/lang/fr-FR.rc trunk/reactos/base/applications/winhlp32/lang/it-IT.rc trunk/reactos/base/applications/winhlp32/lang/pl-PL.rc trunk/reactos/base/applications/winhlp32/lang/ru-RU.rc trunk/reactos/base/applications/winhlp32/lang/sv-SE.rc trunk/reactos/base/applications/winhlp32/winhelp.c Modified: trunk/reactos/base/applications/applications.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/applicat…
============================================================================== --- trunk/reactos/base/applications/applications.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/applications.rbuild [iso-8859-1] Wed May 28 02:43:38 2008 @@ -72,8 +72,8 @@ <directory name="taskmgr"> <xi:include href="taskmgr/taskmgr.rbuild" /> </directory> - <directory name="winhelp"> - <xi:include href="winhelp/winhelp.rbuild" /> + <directory name="winhlp32"> + <xi:include href="winhlp32/winhlp32.rbuild" /> </directory> <directory name="wordpad"> <xi:include href="wordpad/wordpad.rbuild" /> Modified: trunk/reactos/base/applications/winhlp32/lang/da-DK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/lang/da-DK.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/lang/da-DK.rc [iso-8859-1] Wed May 28 02:43:38 2008 @@ -3,6 +3,7 @@ * * Copyright 1997 Henrik Olsen * Copyright 2002 Sylvain Petreolle <spetreolle(a)yahoo.fr> + * Copyright 2008 Jens Albretsen<jens(a)albretsen.dk> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +25,7 @@ MAIN_MENU MENU LANGUAGE LANG_DANISH, SUBLANG_DEFAULT { POPUP "&Filer" { - MENUITEM "Å&bn...", MNID_FILE_OPEN + MENUITEM "Å&ben...", MNID_FILE_OPEN MENUITEM SEPARATOR MENUITEM "&Udskriv emne", MNID_FILE_PRINT MENUITEM "&Indstil printer", MNID_FILE_SETUP @@ -43,16 +44,24 @@ MENUITEM "&Brug af Hjælp", MNID_HELP_HELPON MENUITEM "Altid &øverst", MNID_HELP_HELPTOP MENUITEM SEPARATOR - MENUITEM "&Info...", MNID_HELP_ABOUT + MENUITEM "&Information...", MNID_HELP_ABOUT #ifdef WINELIB MENUITEM "Om &WINE", MNID_HELP_WINE #endif } } +IDD_INDEX DIALOG DISCARDABLE 0, 0, 200, 190 LANGUAGE LANG_DANISH, SUBLANG_DEFAULT +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +FONT 8, "MS Shell Dlg" +CAPTION "Index" +{ + LISTBOX IDC_INDEXLIST, 10, 10, 180, 150, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_BORDER + PUSHBUTTON "&OK", IDOK, 40, 170, 50, 12 + PUSHBUTTON "&Annuller", IDCANCEL, 120, 170, 50, 12 +} /* Strings */ - STRINGTABLE DISCARDABLE LANGUAGE LANG_DANISH, SUBLANG_DEFAULT { STID_WINE_HELP, "WINE Hjælp" @@ -65,9 +74,9 @@ STID_SEARCH, "&Søg" STID_BACK, "&Tilbage" STID_HISTORY, "&Oversigt" -STID_TOPICS, "To&pics" +STID_TOPICS, "&Emner" STID_ALL_FILES, "Alle filer (*.*)" STID_HELP_FILES_HLP, "Hjælpe filer (*.hlp)" -STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?" -STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting" +STID_FILE_NOT_FOUND_s "Kan ikke finde '%s'. Vil du selv finde filen?" +STID_NO_RICHEDIT "Kan ikke finde en 'richedit' implementering... Afbryder" } Modified: trunk/reactos/base/applications/winhlp32/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/lang/de-DE.rc [iso-8859-1] Wed May 28 02:43:38 2008 @@ -73,10 +73,33 @@ STID_CONTENTS, "&Inhalt" STID_SEARCH, "&Suchen" STID_BACK, "&Zurück" -STID_HISTORY, "&Bisher" +STID_HISTORY, "&Chronik" STID_TOPICS, "&Themen" STID_ALL_FILES, "Alle Dateien (*.*)" STID_HELP_FILES_HLP, "Hilfe-Dateien (*.hlp)" STID_FILE_NOT_FOUND_s "'%s' konnte nicht gefunden werden. Wollen Sie selber nach dieser Datei suchen?" -STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting" +STID_NO_RICHEDIT "Die Richedit Implementation konnte nicht gefunden werden... Breche ab." } + +CONTEXT_MENU MENU LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL +BEGIN +POPUP "" +BEGIN +MENUITEM "Anmerken...", MNID_CTXT_ANNOTATE +MENUITEM "Kopieren", MNID_CTXT_COPY +MENUITEM "Drucken...", MNID_CTXT_PRINT +POPUP "Schriftgröße" +BEGIN +MENUITEM "Klein", MNID_CTXT_FONTS_SMALL +MENUITEM "Normal", MNID_CTXT_FONTS_NORMAL +MENUITEM "Groß", MNID_CTXT_FONTS_LARGE +END +POPUP "Hilfe immer sichtbar" +BEGIN +MENUITEM "Standard", MNID_CTXT_HELP_DEFAULT +MENUITEM "Sichtbar", MNID_CTXT_HELP_VISIBLE +MENUITEM "Nicht sichtbar", MNID_CTXT_HELP_NONVISIBLE +END +MENUITEM "Systemfarben verwenden", MNID_CTXT_SYSTEM_COLORS +END +END Modified: trunk/reactos/base/applications/winhlp32/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/lang/fr-FR.rc [iso-8859-1] Wed May 28 02:43:38 2008 @@ -53,7 +53,7 @@ } } -IDD_INDEX DIALOG DISCARDABLE 0, 0, 200, 190 LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT +IDD_INDEX DIALOG DISCARDABLE 0, 0, 200, 190 LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Index" @@ -64,7 +64,7 @@ } /* Strings */ -STRINGTABLE DISCARDABLE LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT +STRINGTABLE DISCARDABLE LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL { STID_WINE_HELP, "Aide de WINE" STID_WHERROR, "ERREUR" Modified: trunk/reactos/base/applications/winhlp32/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/lang/it-IT.rc [iso-8859-1] Wed May 28 02:43:38 2008 @@ -68,5 +68,5 @@ STID_ALL_FILES, "Tutti i file (*.*)" STID_HELP_FILES_HLP, "File della Guida (*.hlp)" STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?" -STID_NO_RICHEDIT "Impossibile trovare una implementazione di richedit ... Interruzione in corso" +STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting" } Modified: trunk/reactos/base/applications/winhlp32/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/lang/pl-PL.rc [iso-8859-1] Wed May 28 02:43:38 2008 @@ -80,3 +80,27 @@ STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?" STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting" } + + +CONTEXT_MENU MENU LANGUAGE LANG_POLISH, SUBLANG_DEFAULT +BEGIN + POPUP "" + BEGIN + MENUITEM "Adnotacja...", MNID_CTXT_ANNOTATE + MENUITEM "Kopiuj", MNID_CTXT_COPY + MENUITEM "Drukuj...", MNID_CTXT_PRINT + POPUP "Czcionka" + BEGIN + MENUITEM "Ma³a", MNID_CTXT_FONTS_SMALL + MENUITEM "Normalna", MNID_CTXT_FONTS_NORMAL + MENUITEM "Du¿a", MNID_CTXT_FONTS_LARGE + END + POPUP "Pomoc zawsze widoczna" + BEGIN + MENUITEM "Domylnie", MNID_CTXT_HELP_DEFAULT + MENUITEM "Widoczna", MNID_CTXT_HELP_VISIBLE + MENUITEM "Niewidoczna", MNID_CTXT_HELP_NONVISIBLE + END + MENUITEM "U¿yj kolorów systemowych", MNID_CTXT_SYSTEM_COLORS + END +END Modified: trunk/reactos/base/applications/winhlp32/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/lang/ru-RU.rc [iso-8859-1] Wed May 28 02:43:38 2008 @@ -76,5 +76,28 @@ STID_ALL_FILES, "Âñå ôàéëû (*.*)" STID_HELP_FILES_HLP, "Ôàéëû ñïðàâêè (*.hlp)" STID_FILE_NOT_FOUND_s "Íå ìîãó íàéòè '%s'. Âû õîòèòå íàéòè ýòîò ôàéë ñàìîñòîÿòåëüíî?" -STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting" +STID_NO_RICHEDIT "Íå ìîãó íàéòè richedit" } + +CONTEXT_MENU MENU LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +BEGIN + POPUP "" + BEGIN + MENUITEM "Çàìåòêè...", MNID_CTXT_ANNOTATE + MENUITEM "Êîïèðîâàòü", MNID_CTXT_COPY + MENUITEM "Ïå÷àòü...", MNID_CTXT_PRINT + POPUP "Øðèôò" + BEGIN + MENUITEM "Ìåëêèé", MNID_CTXT_FONTS_SMALL + MENUITEM "Îáû÷íûé", MNID_CTXT_FONTS_NORMAL + MENUITEM "Êðóïíûé", MNID_CTXT_FONTS_LARGE + END + POPUP "Âèäèìîñòü îêíà ñïðàâêè" + BEGIN + MENUITEM "Ïî óìîë÷àíèþ", MNID_CTXT_HELP_DEFAULT + MENUITEM "Íàâåðõó", MNID_CTXT_HELP_VISIBLE + MENUITEM "Íå íàâåðõó", MNID_CTXT_HELP_NONVISIBLE + END + MENUITEM "Èñïîëüçîâàòü ñèñòåìíûå öâåòà", MNID_CTXT_SYSTEM_COLORS + END +END Modified: trunk/reactos/base/applications/winhlp32/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/lang/sv-SE.rc [iso-8859-1] Wed May 28 02:43:38 2008 @@ -23,7 +23,7 @@ /* Menu */ -MAIN_MENU MENU LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +MAIN_MENU MENU LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL { POPUP "&Arkiv" { MENUITEM "&Ãppna", MNID_FILE_OPEN @@ -53,7 +53,7 @@ } /* Strings */ -STRINGTABLE DISCARDABLE LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +STRINGTABLE DISCARDABLE LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL { STID_WINE_HELP, "WINE Hjälp" STID_WHERROR, "FEL" Modified: trunk/reactos/base/applications/winhlp32/winhelp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/winhelp.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/winhelp.c [iso-8859-1] Wed May 28 02:43:38 2008 @@ -1001,7 +1001,7 @@ } pt.x = (int)(short)LOWORD(msgf->lParam); pt.y = (int)(short)HIWORD(msgf->lParam); - ClientToScreen(hWnd, &pt); + ClientToScreen(msgf->nmhdr.hwndFrom, &pt); TrackPopupMenu(GetSubMenu(hMenu, 0), TPM_LEFTALIGN|TPM_TOPALIGN, pt.x, pt.y, 0, hWnd, NULL); DestroyMenu(hMenu); Removed: trunk/reactos/base/applications/winhlp32/winhelp.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhelp/…
============================================================================== --- trunk/reactos/base/applications/winhlp32/winhelp.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/winhelp.rbuild (removed) @@ -1,20 +1,0 @@ -<?xml version="1.0"?> -<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="winhelp" type="win32gui" installbase="system32" installname="winhelp.exe" unicode="no" allowwarnings="true"> - <include base="winhelp">.</include> - <define name="_WIN32_IE">0x0600</define> - <define name="_WIN32_WINNT">0x0501</define> - <library>wine</library> - <library>comdlg32</library> - <library>shell32</library> - <library>user32</library> - <library>gdi32</library> - <library>kernel32</library> - <file>callback.c</file> - <file>hlpfile.c</file> - <file>macro.c</file> - <file>string.c</file> - <file>winhelp.c</file> - <file>lex.yy.c</file> - <file>rsrc.rc</file> -</module> Added: trunk/reactos/base/applications/winhlp32/winhlp32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/winhlp32.rbuild (added) +++ trunk/reactos/base/applications/winhlp32/winhlp32.rbuild [iso-8859-1] Wed May 28 02:43:38 2008 @@ -1,0 +1,20 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<module name="winhlp32" type="win32gui" installbase="system32" installname="winhlp32.exe" unicode="no" allowwarnings="true"> + <include base="winhlp32">.</include> + <define name="_WIN32_IE">0x0600</define> + <define name="_WIN32_WINNT">0x0501</define> + <library>wine</library> + <library>comdlg32</library> + <library>shell32</library> + <library>user32</library> + <library>gdi32</library> + <library>kernel32</library> + <file>callback.c</file> + <file>hlpfile.c</file> + <file>macro.c</file> + <file>string.c</file> + <file>winhelp.c</file> + <file>lex.yy.c</file> + <file>rsrc.rc</file> +</module> Propchange: trunk/reactos/base/applications/winhlp32/winhlp32.rbuild ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 8 months
1
0
0
0
[jimtabor] 33735: Add Gdi entry flag.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed May 28 00:01:17 2008 New Revision: 33735 URL:
http://svn.reactos.org/svn/reactos?rev=33735&view=rev
Log: Add Gdi entry flag. Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] Wed May 28 00:01:17 2008 @@ -40,6 +40,9 @@ #define GDI_ENTRY_FLAGS_MASK 0xff000000 #define GDI_ENTRY_REUSECNT_SHIFT 8 #define GDI_ENTRY_UPPER_SHIFT 16 + +/* GDI Entry Flags */ +#define GDI_ENTRY_FLAG_NEED_UPDATE 4 /*! \defgroup GDI object types *
16 years, 8 months
1
0
0
0
[jimtabor] 33734: NtUserRegisterClassExWOW also given FNID. Added one more fnid type.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue May 27 23:04:35 2008 New Revision: 33734 URL:
http://svn.reactos.org/svn/reactos?rev=33734&view=rev
Log: NtUserRegisterClassExWOW also given FNID. Added one more fnid type. Modified: trunk/reactos/include/reactos/win32k/ntuser.h Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue May 27 23:04:35 2008 @@ -276,6 +276,7 @@ #define FNID_STATIC 0x02A8 #define FNID_IME 0x02A9 +#define FNID_DDEML 0x2000 // Registers DDEML #define FNID_DESTROY 0x4000 // This is sent when WM_NCDESTROY or in the support routine. // Seen during WM_CREATE on error exit too. @@ -1873,7 +1874,7 @@ BOOL bUnicodeClass, WNDPROC wpExtra, DWORD dwUnknown4, - DWORD dwUnknown5, + DWORD fnID, DWORD dwUnknown6, DWORD dwUnknown7);
16 years, 8 months
1
0
0
0
[jimtabor] 33733: NtUserSetWindowFNID is needed for supporting NtUserGetClassName bGetRealClass.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue May 27 21:36:25 2008 New Revision: 33733 URL:
http://svn.reactos.org/svn/reactos?rev=33733&view=rev
Log: NtUserSetWindowFNID is needed for supporting NtUserGetClassName bGetRealClass. Modified: trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/ntuser/window.c Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue May 27 21:36:25 2008 @@ -77,6 +77,7 @@ INT ClsExtra; INT WndExtra; PVOID Dce; + DWORD fnID; HINSTANCE hInstance; HANDLE hIcon; /* FIXME - Use pointer! */ HANDLE hIconSm; /* FIXME - Use pointer! */ @@ -263,6 +264,32 @@ PW32THREADINFO GetW32ThreadInfo(VOID); PW32PROCESSINFO GetW32ProcessInfo(VOID); + +// FNID's for NtUserSetWindowFNID +#define FNID_BUTTON 0x02A1 +#define FNID_COMBOBOX 0x02A2 +#define FNID_COMBOLBOX 0x02A3 +#define FNID_DIALOG 0x02A4 +#define FNID_EDIT 0x02A5 +#define FNID_LISTBOX 0x02A6 +#define FNID_MDICLIENT 0x02A7 +#define FNID_STATIC 0x02A8 +#define FNID_IME 0x02A9 + +#define FNID_DESTROY 0x4000 // This is sent when WM_NCDESTROY or in the support routine. + // Seen during WM_CREATE on error exit too. + +// ICLS's for NtUserGetClassName FNID to ICLS +#define ICLS_BUTTON 0 +#define ICLS_EDIT 1 +#define ICLS_STATIC 2 +#define ICLS_LISTBOX 3 +#define ICLS_COMBOBOX 5 +#define ICLS_MDICLIENT 6 +#define ICLS_COMBOLBOX 7 +#define ICLS_IME 15 +#define ICLS_DIALOG 17 +#define ICLS_END 31 DWORD NTAPI @@ -2186,11 +2213,11 @@ TIMERPROC lpTimerFunc ); -DWORD +BOOL NTAPI NtUserSetWindowFNID( - DWORD Unknown0, - DWORD Unknown1); + HWND hWnd, + WORD fnID); LONG NTAPI Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Tue May 27 21:36:25 2008 @@ -4159,17 +4159,41 @@ /* - * @unimplemented - */ -DWORD STDCALL -NtUserSetWindowFNID(DWORD Unknown0, - DWORD Unknown1) -{ - UNIMPLEMENTED - - return 0; -} - + * @implemented + */ +BOOL STDCALL +NtUserSetWindowFNID(HWND hWnd, + WORD fnID) +{ + PWINDOW_OBJECT Window; + PWINDOW Wnd; + DECLARE_RETURN(BOOL); + + DPRINT("Enter NtUserSetWindowFNID\n"); + UserEnterExclusive(); + + if (!(Window = UserGetWindowObject(hWnd))) + { + RETURN( FALSE); + } + Wnd = Window->Wnd; + + if (Wnd->Class) + { // From user land we only set these. + if ((fnID != FNID_DESTROY) || ((fnID < FNID_BUTTON) && (fnID > FNID_IME)) ) + { + RETURN( FALSE); + } + else + Wnd->Class->fnID |= fnID; + } + RETURN( TRUE); + +CLEANUP: + DPRINT("Leave NtUserSetWindowFNID\n"); + UserLeave(); + END_CLEANUP; +} /*
16 years, 8 months
1
0
0
0
[tkreuzer] 33732: exception.h: merge changes from wine. Revision 1.37 fixes the exception in ole32 when opening a file with FoxitReader. Also fixes some warnings and hopefully some usermode crashes. 1.28: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. 1.29: Alexandre Julliard <julliard@winehq.org> include: Exception filters should return LONG, not DWORD. Also move UnhandledExceptionFilter definitions to winbase.h since they are there in the latest SD
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue May 27 19:41:13 2008 New Revision: 33732 URL:
http://svn.reactos.org/svn/reactos?rev=33732&view=rev
Log: exception.h: merge changes from wine. Revision 1.37 fixes the exception in ole32 when opening a file with FoxitReader. Also fixes some warnings and hopefully some usermode crashes. 1.28: Jonathan Ernst <jonathan(a)ernstfamily.ch> Update the address of the Free Software Foundation. 1.29: Alexandre Julliard <julliard(a)winehq.org> include: Exception filters should return LONG, not DWORD. Also move UnhandledExceptionFilter definitions to winbase.h since they are there in the latest SDK. 1.30: Rob Shearman <rob(a)codeweavers.com> include: Move Wine-specific EH_* defines from winnt.h to include/wine/exception.h. 1.33: Rob Shearman <rob(a)codeweavers.com> Add a new convenience macro for an exception handler that handles all exceptions. When using native compiler exceptions, the previous method of doing this, __EXCEPT(NULL), would expand to __except( (NULL)(GetExceptionInformation())) which doesn't compile as NULL isn't a function. So add a new macro, __EXCEPT_ALL, which works correctly both when using native compiler exceptions and without and which makes the meaning of code in which it is used clearer. 1.35: Alexandre Julliard <julliard(a)winehq.org> ntdll: Make the exception handling functions inline. 1.36: Alexandre Julliard <julliard(a)winehq.org> exception.h: Only push the exception frame after sigsetjmp. Otherwise on Windows longjmp may want to mess with the exception frame. 1.37: Alexandre Julliard <julliard(a)winehq.org> exception.h: Preserve registers when calling RtlUnwind. See issue #812 for more details. Modified: trunk/reactos/include/reactos/wine/exception.h Modified: trunk/reactos/include/reactos/wine/exception.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/excep…
============================================================================== --- trunk/reactos/include/reactos/wine/exception.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/wine/exception.h [iso-8859-1] Tue May 27 19:41:13 2008 @@ -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 */ #ifndef __WINE_WINE_EXCEPTION_H @@ -79,6 +79,7 @@ #define __FINALLY(func) __finally { (func)(!AbnormalTermination()); } #define __ENDTRY /*nothing*/ #define __EXCEPT_PAGE_FAULT __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) +#define __EXCEPT_ALL __except(EXCEPTION_EXECUTE_HANDLER) #else /* USE_COMPILER_EXCEPTIONS */ @@ -100,7 +101,28 @@ } else { \ __f.frame.Handler = __wine_exception_handler; \ __f.u.filter = (func); \ - __wine_push_frame( &__f.frame ); \ + if (setjmp( __f.jmp )) { \ + const __WINE_FRAME * const __eptr __attribute__((unused)) = &__f; \ + do { + +/* convenience handler for page fault exceptions */ +#define __EXCEPT_PAGE_FAULT \ + } while(0); \ + __wine_pop_frame( &__f.frame ); \ + break; \ + } else { \ + __f.frame.Handler = __wine_exception_handler_page_fault; \ + if (setjmp( __f.jmp )) { \ + const __WINE_FRAME * const __eptr __attribute__((unused)) = &__f; \ + do { + +/* convenience handler for all exception */ +#define __EXCEPT_ALL \ + } while(0); \ + __wine_pop_frame( &__f.frame ); \ + break; \ + } else { \ + __f.frame.Handler = __wine_exception_handler_all; \ if (setjmp( __f.jmp )) { \ const __WINE_FRAME * const __eptr __attribute__((unused)) = &__f; \ do { @@ -109,6 +131,7 @@ } while (0); \ break; \ } \ + __wine_push_frame( &__f.frame ); \ __first = 0; \ } \ } while (0); @@ -127,13 +150,10 @@ } while (0); -typedef DWORD (CALLBACK *__WINE_FILTER)(PEXCEPTION_POINTERS); +typedef LONG (CALLBACK *__WINE_FILTER)(PEXCEPTION_POINTERS); typedef void (CALLBACK *__WINE_FINALLY)(BOOL); -/* convenience handler for page fault exceptions */ -#define __EXCEPT_PAGE_FAULT __EXCEPT( (__WINE_FILTER)1 ) - -#define WINE_EXCEPTION_FILTER(func) DWORD CALLBACK func( PEXCEPTION_POINTERS __eptr ) +#define WINE_EXCEPTION_FILTER(func) LONG WINAPI func( EXCEPTION_POINTERS *__eptr ) #define WINE_FINALLY_FUNC(func) void CALLBACK func( BOOL __normal ) #define GetExceptionInformation() (__eptr) @@ -193,6 +213,39 @@ #ifndef USE_COMPILER_EXCEPTIONS +static inline void DECLSPEC_NORETURN __wine_unwind_frame( EXCEPTION_RECORD *record, + EXCEPTION_REGISTRATION_RECORD *frame ) +{ + __WINE_FRAME *wine_frame = (__WINE_FRAME *)frame; + + /* hack to make GetExceptionCode() work in handler */ + wine_frame->ExceptionCode = record->ExceptionCode; + wine_frame->ExceptionRecord = wine_frame; + +#if defined(__GNUC__) && defined(__i386__) + { + /* RtlUnwind clobbers registers on Windows */ + int dummy1, dummy2, dummy3; + __asm__ __volatile__("pushl %%ebp\n\t" + "pushl %%ebx\n\t" + "pushl $0\n\t" + "pushl %2\n\t" + "pushl $0\n\t" + "pushl %1\n\t" + "call *%0\n\t" + "popl %%ebx\n\t" + "popl %%ebp" + : "=a" (dummy1), "=S" (dummy2), "=D" (dummy3) + : "0" (RtlUnwind), "1" (frame), "2" (record) + : "ecx", "edx", "memory" ); + } +#else + RtlUnwind( frame, 0, record, 0 ); +#endif + __wine_pop_frame( frame ); + longjmp( wine_frame->jmp, 1 ); +} + static __inline EXCEPTION_DISPOSITION __wine_exception_handler( struct _EXCEPTION_RECORD *record, void *frame, struct _CONTEXT *context, void *pdispatcher ) @@ -224,15 +277,28 @@ break; } } - /* hack to make GetExceptionCode() work in handler */ - wine_frame->ExceptionCode = record->ExceptionCode; - wine_frame->ExceptionRecord = wine_frame; - - RtlUnwind( frame, 0, record, 0 ); - __wine_pop_frame( frame ); - longjmp( wine_frame->jmp, 1 ); -} - + __wine_unwind_frame( record, frame ); +} + +static __inline EXCEPTION_DISPOSITION +__wine_exception_handler_page_fault( struct _EXCEPTION_RECORD *record, void *frame, + struct _CONTEXT *context, void *pdispatcher ) +{ + if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL)) + return ExceptionContinueSearch; + if (record->ExceptionCode != STATUS_ACCESS_VIOLATION) + return ExceptionContinueSearch; + __wine_unwind_frame( record, frame ); +} + +static __inline EXCEPTION_DISPOSITION +__wine_exception_handler_all( struct _EXCEPTION_RECORD *record, void *frame, + struct _CONTEXT *context, void *pdispatcher ) +{ + if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL)) + return ExceptionContinueSearch; + __wine_unwind_frame( record, frame ); +} static __inline EXCEPTION_DISPOSITION __wine_finally_handler( struct _EXCEPTION_RECORD *record, void *frame, @@ -248,6 +314,14 @@ #endif /* USE_COMPILER_EXCEPTIONS */ +/* Exception handling flags - from OS/2 2.0 exception handling */ + +/* Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD */ +#define EH_NONCONTINUABLE 0x01 +#define EH_UNWINDING 0x02 +#define EH_EXIT_UNWIND 0x04 +#define EH_STACK_INVALID 0x08 +#define EH_NESTED_CALL 0x10 /* Wine-specific exceptions codes */
16 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
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