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
April 2006
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
324 discussions
Start a n
N
ew thread
[greatlrd] 21486: patch from w3seek : compile with gcc4.1 again
by aleksey@studiocerebral.com
Author: greatlrd Date: Fri Apr 7 12:56:12 2006 New Revision: 21486 URL:
http://svn.reactos.ru/svn/reactos?rev=21486&view=rev
Log: patch from w3seek : compile with gcc4.1 again Modified: trunk/reactos/base/applications/wordpad/dialogs.c Modified: trunk/reactos/base/applications/wordpad/dialogs.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/d…
============================================================================== --- trunk/reactos/base/applications/wordpad/dialogs.c (original) +++ trunk/reactos/base/applications/wordpad/dialogs.c Fri Apr 7 12:56:12 2006 @@ -24,8 +24,8 @@ hInstance, i)) { - ListBox_AddString(hList, - lpDocType); + (void)ListBox_AddString(hList, + lpDocType); LocalFree((HLOCAL)lpDocType); } }
18 years, 8 months
1
0
0
0
[greatlrd] 21485: 1. Clean up Hal_DirectDraw_CreateSurface 2. Start implemenr createsurface overlay base on Steffen Schulze code.
by aleksey@studiocerebral.com
Author: greatlrd Date: Fri Apr 7 12:12:13 2006 New Revision: 21485 URL:
http://svn.reactos.ru/svn/reactos?rev=21485&view=rev
Log: 1. Clean up Hal_DirectDraw_CreateSurface 2. Start implemenr createsurface overlay base on Steffen Schulze code. Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Fri Apr 7 12:12:13 2006 @@ -13,286 +13,263 @@ HRESULT Hal_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD, LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter) { -// UINT i; - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - DDHAL_CREATESURFACEDATA mDdCreateSurface; + UINT i; + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + DDHAL_CREATESURFACEDATA mDdCreateSurface; DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface; - mDdCanCreateSurface.lpDD = &This->mDDrawGlobal; - mDdCanCreateSurface.CanCreateSurface = This->mCallbacks.HALDD.CanCreateSurface; + mDdCanCreateSurface.lpDD = &This->mDDrawGlobal; + mDdCanCreateSurface.CanCreateSurface = This->mCallbacks.HALDD.CanCreateSurface; - mDdCreateSurface.lpDD = &This->mDDrawGlobal; - mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface; - - /* create primare surface now */ - if (pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) - { - memset(&This->mddsdPrimary, 0, sizeof(DDSURFACEDESC)); - This->mddsdPrimary.dwSize = sizeof(DDSURFACEDESC); - This->mddsdPrimary.dwFlags = pDDSD->dwFlags; - This->mddsdPrimary.ddsCaps.dwCaps = pDDSD->ddsCaps.dwCaps; + mDdCreateSurface.lpDD = &This->mDDrawGlobal; + mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface; + + /* create primare surface now */ + if (pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + { + memset(&This->mddsdPrimary, 0, sizeof(DDSURFACEDESC)); + This->mddsdPrimary.dwSize = sizeof(DDSURFACEDESC); + This->mddsdPrimary.dwFlags = pDDSD->dwFlags; + This->mddsdPrimary.ddsCaps.dwCaps = pDDSD->ddsCaps.dwCaps; mDdCanCreateSurface.bIsDifferentPixelFormat = FALSE; //isDifferentPixelFormat; - mDdCanCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary; // pDDSD; + mDdCanCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary; // pDDSD; if (This->mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) - { - return DDERR_NOTINITIALIZED; - } - - if (mDdCanCreateSurface.ddRVal != DD_OK) - { - return DDERR_NOTINITIALIZED; - } - memset(&This->mPrimaryGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); - This->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE; - This->mPrimaryGlobal.lpDD = &This->mDDrawGlobal; - This->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal; - This->mPrimaryGlobal.wWidth = (WORD)This->mpModeInfos[0].dwWidth; - This->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight; - This->mPrimaryGlobal.lPitch = This->mpModeInfos[0].lPitch; - - memset(&This->mPrimaryMore, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); - This->mPrimaryMore.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); - - memset(&This->mPrimaryLocal, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); - This->mPrimaryLocal.lpGbl = &This->mPrimaryGlobal; - This->mPrimaryLocal.lpSurfMore = &This->mPrimaryMore; - This->mPrimaryLocal.dwProcessId = GetCurrentProcessId(); + { + return DDERR_NOTINITIALIZED; + } + + if (mDdCanCreateSurface.ddRVal != DD_OK) + { + return DDERR_NOTINITIALIZED; + } + + memset(&This->mPrimaryGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); + This->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE; + This->mPrimaryGlobal.lpDD = &This->mDDrawGlobal; + This->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal; + This->mPrimaryGlobal.wWidth = (WORD)This->mpModeInfos[0].dwWidth; + This->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight; + This->mPrimaryGlobal.lPitch = This->mpModeInfos[0].lPitch; + + memset(&This->mPrimaryMore, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); + This->mPrimaryMore.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); + + memset(&This->mPrimaryLocal, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); + This->mPrimaryLocal.lpGbl = &This->mPrimaryGlobal; + This->mPrimaryLocal.lpSurfMore = &This->mPrimaryMore; + This->mPrimaryLocal.dwProcessId = GetCurrentProcessId(); - // FIXME Check the flags if we shall create a primaresurface for overlay or something else - This->mPrimaryLocal.dwFlags = DDRAWISURF_PARTOFPRIMARYCHAIN|DDRAWISURF_HASOVERLAYDATA|DDRAWISURF_HASDC; - This->mPrimaryLocal.ddsCaps.dwCaps = This->mddsdPrimary.ddsCaps.dwCaps; - This->mpPrimaryLocals[0] = &This->mPrimaryLocal; - - mDdCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary;//pDDSD; - mDdCreateSurface.lplpSList = This->mpPrimaryLocals; //cSurfaces; - mDdCreateSurface.dwSCnt = This->mDDrawGlobal.dsList->dwIntRefCnt ; //ppSurfaces; - if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED) - { - return DDERR_NOTINITIALIZED; - } - - if (mDdCreateSurface.ddRVal != DD_OK) - { - return mDdCreateSurface.ddRVal; - } - } - else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) - { - DX_STUB; - } - else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_TEXTURE) - { - DX_STUB; - } - else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) - { - DX_STUB; - } - else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_OFFSCREENPLAIN) - { - DX_STUB; - } - - // return DDERR_INVALIDSURFACETYPE; - - - - /* - * - * - * - */ - - /* create overlay surface now */ - - /* - memset(&This->mddsdOverlay, 0, sizeof(DDSURFACEDESC)); - This->mddsdOverlay.dwSize = sizeof(DDSURFACEDESC); - This->mddsdOverlay.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT | DDSD_WIDTH | DDSD_HEIGHT; - - This->mddsdOverlay.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_COMPLEX | DDSCAPS_FLIP; - - This->mddsdOverlay.dwWidth = 100; //pels; - This->mddsdOverlay.dwHeight = 100; // lines; - This->mddsdOverlay.dwBackBufferCount = 1; //cBuffers; - - This->mddsdOverlay.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); - This->mddsdOverlay.ddpfPixelFormat.dwFlags = DDPF_RGB; - This->mddsdOverlay.ddpfPixelFormat.dwRGBBitCount = 32; - - - //DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface; - mDdCanCreateSurface.lpDD = &This->mDDrawGlobal; - mDdCanCreateSurface.CanCreateSurface = This->mCallbacks.HALDD.CanCreateSurface; - mDdCanCreateSurface.bIsDifferentPixelFormat = TRUE; //isDifferentPixelFormat; - mDdCanCreateSurface.lpDDSurfaceDesc = &This->mddsdOverlay; // pDDSD; + /* + FIXME Check the flags if we shall create a primaresurface for overlay or something else + Examine windows which flags are being set for we assume this is right + */ + + This->mPrimaryLocal.dwFlags = DDRAWISURF_PARTOFPRIMARYCHAIN|DDRAWISURF_HASOVERLAYDATA; + This->mPrimaryLocal.ddsCaps.dwCaps = This->mddsdPrimary.ddsCaps.dwCaps; + This->mpPrimaryLocals[0] = &This->mPrimaryLocal; + + mDdCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary; + mDdCreateSurface.lplpSList = This->mpPrimaryLocals; + mDdCreateSurface.dwSCnt = This->mDDrawGlobal.dsList->dwIntRefCnt ; + + if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED) + { + return DDERR_NOTINITIALIZED; + } + + if (mDdCreateSurface.ddRVal != DD_OK) + { + return mDdCreateSurface.ddRVal; + } + + return DD_OK; + + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_OVERLAY) + { + memset(&This->mddsdOverlay, 0, sizeof(DDSURFACEDESC)); + This->mddsdOverlay.dwSize = sizeof(DDSURFACEDESC); + This->mddsdOverlay.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT | DDSD_WIDTH | DDSD_HEIGHT; + + This->mddsdOverlay.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_COMPLEX | DDSCAPS_FLIP; + + This->mddsdOverlay.dwWidth = 100; //pels; + This->mddsdOverlay.dwHeight = 100; // lines; + This->mddsdOverlay.dwBackBufferCount = 1; //cBuffers; + + This->mddsdOverlay.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); + This->mddsdOverlay.ddpfPixelFormat.dwFlags = DDPF_RGB; + This->mddsdOverlay.ddpfPixelFormat.dwRGBBitCount = 32; + + mDdCanCreateSurface.lpDD = &This->mDDrawGlobal; + mDdCanCreateSurface.CanCreateSurface = This->mCallbacks.HALDD.CanCreateSurface; + mDdCanCreateSurface.bIsDifferentPixelFormat = TRUE; //isDifferentPixelFormat; + mDdCanCreateSurface.lpDDSurfaceDesc = &This->mddsdOverlay; // pDDSD; - if (This->mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) - { - return DDERR_NOTINITIALIZED; - } - - if (mDdCanCreateSurface.ddRVal != DD_OK) - { - return DDERR_NOTINITIALIZED; - } - + if (This->mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) + { + return DDERR_NOTINITIALIZED; + } + + if (mDdCanCreateSurface.ddRVal != DD_OK) + { + return DDERR_NOTINITIALIZED; + } + + memset(&This->mOverlayGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); + This->mOverlayGlobal.dwGlobalFlags = 0; + This->mOverlayGlobal.lpDD = &This->mDDrawGlobal; + This->mOverlayGlobal.lpDDHandle = &This->mDDrawGlobal; + This->mOverlayGlobal.wWidth = (WORD)This->mddsdOverlay.dwWidth; + This->mOverlayGlobal.wHeight = (WORD)This->mddsdOverlay.dwHeight; + This->mOverlayGlobal.lPitch = -1; + This->mOverlayGlobal.ddpfSurface = This->mddsdOverlay.ddpfPixelFormat; + + // setup front- and backbuffer surfaces + UINT cSurfaces = This->mddsdOverlay.dwBackBufferCount + 1; + for (i = 0; i < cSurfaces; i++) + { + memset(&This->mOverlayMore[i], 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); + This->mOverlayMore[i].dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); + + memset(&This->mOverlayLocal[i], 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); + This->mOverlayLocal[i].lpGbl = &This->mOverlayGlobal; + This->mOverlayLocal[i].lpSurfMore = &This->mOverlayMore[i]; + This->mOverlayLocal[i].dwProcessId = GetCurrentProcessId(); + This->mOverlayLocal[i].dwFlags = (i == 0) ? + (DDRAWISURF_IMPLICITROOT|DDRAWISURF_FRONTBUFFER): + (DDRAWISURF_IMPLICITCREATE|DDRAWISURF_BACKBUFFER); + + This->mOverlayLocal[i].dwFlags |= DDRAWISURF_ATTACHED|DDRAWISURF_ATTACHED_FROM| DDRAWISURF_HASPIXELFORMAT| DDRAWISURF_HASOVERLAYDATA; + + This->mOverlayLocal[i].ddsCaps.dwCaps = This->mddsdOverlay.ddsCaps.dwCaps; + This->mpOverlayLocals[i] = &This->mOverlayLocal[i]; + } + + for (i = 0; i < cSurfaces; i++) + { + UINT j = (i + 1) % cSurfaces; + if (!DdAttachSurface(This->mpOverlayLocals[i], This->mpOverlayLocals[j])) + { + // derr(L"DirectDrawImpl[%08x]::__setupDevice DdAttachSurface(%d, %d) failed", this, i, j); + return DD_FALSE; + } + } + + mDdCreateSurface.lpDD = &This->mDDrawGlobal; + mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface; + mDdCreateSurface.lpDDSurfaceDesc = &This->mddsdOverlay;//pDDSD; + mDdCreateSurface.lplpSList = This->mpOverlayLocals; //cSurfaces; + mDdCreateSurface.dwSCnt = 1 ; //ppSurfaces; + + if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED) + { + return DDERR_NOTINITIALIZED; + } + + if (mDdCreateSurface.ddRVal != DD_OK) + { + return mDdCreateSurface.ddRVal; + } + + DDHAL_UPDATEOVERLAYDATA mDdUpdateOverlay; + mDdUpdateOverlay.lpDD = &This->mDDrawGlobal; + mDdUpdateOverlay.UpdateOverlay = This->mCallbacks.HALDDSurface.UpdateOverlay; + mDdUpdateOverlay.lpDDDestSurface = This->mpPrimaryLocals[0]; + mDdUpdateOverlay.lpDDSrcSurface = This->mpOverlayLocals[0];//pDDSurface; + mDdUpdateOverlay.dwFlags = DDOVER_SHOW; + + mDdUpdateOverlay.rDest.top = 0; + mDdUpdateOverlay.rDest.left = 0; + mDdUpdateOverlay.rDest.right = 50; + mDdUpdateOverlay.rDest.bottom = 50; + + mDdUpdateOverlay.rSrc.top = 0; + mDdUpdateOverlay.rSrc.left = 0; + mDdUpdateOverlay.rSrc.right = 50; + mDdUpdateOverlay.rSrc.bottom = 50; + + if (mDdUpdateOverlay.UpdateOverlay(&mDdUpdateOverlay) == DDHAL_DRIVER_NOTHANDLED) + { + return DDERR_NOTINITIALIZED; + } + + if (mDdUpdateOverlay.ddRVal != DD_OK) + { + return mDdUpdateOverlay.ddRVal; + } + + return DD_OK; - memset(&This->mOverlayGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); - This->mOverlayGlobal.dwGlobalFlags = 0; - This->mOverlayGlobal.lpDD = &This->mDDrawGlobal; - This->mOverlayGlobal.lpDDHandle = &This->mDDrawGlobal; - This->mOverlayGlobal.wWidth = (WORD)This->mddsdOverlay.dwWidth; - This->mOverlayGlobal.wHeight = (WORD)This->mddsdOverlay.dwHeight; - This->mOverlayGlobal.lPitch = -1; - This->mOverlayGlobal.ddpfSurface = This->mddsdOverlay.ddpfPixelFormat; - - // setup front- and backbuffer surfaces - UINT cSurfaces = This->mddsdOverlay.dwBackBufferCount + 1; - for (i = 0; i < cSurfaces; i++) - { - memset(&This->mOverlayMore[i], 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); - This->mOverlayMore[i].dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); - - memset(&This->mOverlayLocal[i], 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); - This->mOverlayLocal[i].lpGbl = &This->mOverlayGlobal; - This->mOverlayLocal[i].lpSurfMore = &This->mOverlayMore[i]; - This->mOverlayLocal[i].dwProcessId = GetCurrentProcessId(); - This->mOverlayLocal[i].dwFlags = (i == 0) ? - (DDRAWISURF_IMPLICITROOT|DDRAWISURF_FRONTBUFFER): - (DDRAWISURF_IMPLICITCREATE|DDRAWISURF_BACKBUFFER); - - This->mOverlayLocal[i].dwFlags |= - DDRAWISURF_ATTACHED|DDRAWISURF_ATTACHED_FROM| - DDRAWISURF_HASPIXELFORMAT| - DDRAWISURF_HASOVERLAYDATA; - - This->mOverlayLocal[i].ddsCaps.dwCaps = This->mddsdOverlay.ddsCaps.dwCaps; - This->mpOverlayLocals[i] = &This->mOverlayLocal[i]; - } - - for ( i = 0; i < cSurfaces; i++) - { - UINT j = (i + 1) % cSurfaces; - - - - if (!DdAttachSurface(This->mpOverlayLocals[i], This->mpOverlayLocals[j])) - { - // derr(L"DirectDrawImpl[%08x]::__setupDevice DdAttachSurface(%d, %d) failed", this, i, j); - return DD_FALSE; - } - - } - - - // DDHAL_CREATESURFACEDATA mDdCreateSurface; - mDdCreateSurface.lpDD = &This->mDDrawGlobal; - mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface; - mDdCreateSurface.lpDDSurfaceDesc = &This->mddsdOverlay;//pDDSD; - mDdCreateSurface.lplpSList = This->mpOverlayLocals; //cSurfaces; - mDdCreateSurface.dwSCnt = 1 ; //ppSurfaces; - - if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED) - { - return DDERR_NOTINITIALIZED; - } - - - if (mDdCreateSurface.ddRVal != DD_OK) - { - return mDdCreateSurface.ddRVal; - } - - //mSrcRect.w = mddsdOverlay.dwWidth; - //mSrcRect.h = mddsdOverlay.dwHeight; - //__alignBounds(); - - - DDHAL_UPDATEOVERLAYDATA mDdUpdateOverlay; - mDdUpdateOverlay.lpDD = &This->mDDrawGlobal; - mDdUpdateOverlay.UpdateOverlay = This->mCallbacks.HALDDSurface.UpdateOverlay; - mDdUpdateOverlay.lpDDDestSurface = This->mpPrimaryLocals[0]; - mDdUpdateOverlay.lpDDSrcSurface = This->mpOverlayLocals[0];//pDDSurface; - mDdUpdateOverlay.dwFlags = DDOVER_SHOW; - - - - mDdUpdateOverlay.rDest.top = 0; - mDdUpdateOverlay.rDest.left = 0; - mDdUpdateOverlay.rDest.right = 50; - mDdUpdateOverlay.rDest.bottom = 50; - - mDdUpdateOverlay.rSrc.top = 0; - mDdUpdateOverlay.rSrc.left = 0; - mDdUpdateOverlay.rSrc.right = 50; - mDdUpdateOverlay.rSrc.bottom = 50; - - - - - if ( mDdUpdateOverlay.UpdateOverlay(&mDdUpdateOverlay) == DDHAL_DRIVER_NOTHANDLED) - { - return DDERR_NOTINITIALIZED; - } - - - if (mDdUpdateOverlay.ddRVal != DD_OK) - { - return mDdUpdateOverlay.ddRVal; - } -*/ - - DDHAL_BLTDATA mDdBlt; - mDdBlt.lpDDDestSurface = This->mpPrimaryLocals[0]; - - if (!DdResetVisrgn(This->mpPrimaryLocals[0], NULL)) - { - // derr(L"DirectDrawImpl[%08x]::_clear DdResetVisrgn failed", this); - return DDERR_NOGDI; - } - - memset(&mDdBlt, 0, sizeof(DDHAL_BLTDATA)); - memset(&mDdBlt.bltFX, 0, sizeof(DDBLTFX)); - mDdBlt.bltFX.dwSize = sizeof(DDBLTFX); - - mDdBlt.lpDD = &This->mDDrawGlobal; - mDdBlt.Blt = This->mCallbacks.HALDDSurface.Blt; - mDdBlt.lpDDDestSurface = This->mpPrimaryLocals[0]; - - This->mpPrimaryLocals[0]->hDC = (ULONG_PTR)GetDC(This->CooperativeHWND); - mDdBlt.rDest.top = 50; - mDdBlt.rDest.bottom = 100; - mDdBlt.rDest.left = 0; - mDdBlt.rDest.right = 100; - mDdBlt.lpDDSrcSurface = NULL; - mDdBlt.IsClipped = FALSE; - mDdBlt.bltFX.dwFillColor = 0xFFFF00; - mDdBlt.dwFlags = DDBLT_COLORFILL | DDBLT_WAIT; - - if (mDdBlt.Blt(&mDdBlt) != DDHAL_DRIVER_HANDLED) - { - return DDHAL_DRIVER_HANDLED; - } - - - - if (mDdBlt.ddRVal!=DD_OK) - { - return mDdBlt.ddRVal; - } - - return DD_OK; + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) + { + DX_STUB; + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_TEXTURE) + { + DX_STUB; + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) + { + DX_STUB; + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_OFFSCREENPLAIN) + { + DX_STUB; + } + + return DDERR_INVALIDSURFACETYPE; } HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rDest, LPDIRECTDRAWSURFACE7 src, LPRECT rSrc, DWORD dwFlags, LPDDBLTFX lpbltfx) { DX_STUB; + // DDHAL_BLTDATA mDdBlt; + // mDdBlt.lpDDDestSurface = This->mpPrimaryLocals[0]; + + // if (!DdResetVisrgn(This->mpPrimaryLocals[0], NULL)) + // { + // // derr(L"DirectDrawImpl[%08x]::_clear DdResetVisrgn failed", this); + // return DDERR_NOGDI; + // } + + // memset(&mDdBlt, 0, sizeof(DDHAL_BLTDATA)); + // memset(&mDdBlt.bltFX, 0, sizeof(DDBLTFX)); + // mDdBlt.bltFX.dwSize = sizeof(DDBLTFX); + + // mDdBlt.lpDD = &This->mDDrawGlobal; + // mDdBlt.Blt = This->mCallbacks.HALDDSurface.Blt; + // mDdBlt.lpDDDestSurface = This->mpPrimaryLocals[0]; + // + // This->mpPrimaryLocals[0]->hDC = (ULONG_PTR)GetDC(This->CooperativeHWND); + // mDdBlt.rDest.top = 50; + // mDdBlt.rDest.bottom = 100; + // mDdBlt.rDest.left = 0; + // mDdBlt.rDest.right = 100; + // mDdBlt.lpDDSrcSurface = NULL; + // mDdBlt.IsClipped = FALSE; + // mDdBlt.bltFX.dwFillColor = 0xFFFF00; + // mDdBlt.dwFlags = DDBLT_COLORFILL | DDBLT_WAIT; + + // if (mDdBlt.Blt(&mDdBlt) != DDHAL_DRIVER_HANDLED) + //{ + // return DDHAL_DRIVER_HANDLED; + // } + + // + + // if (mDdBlt.ddRVal!=DD_OK) + //{ + // return mDdBlt.ddRVal; + // } + + IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface; IDirectDrawSurfaceImpl* That = (IDirectDrawSurfaceImpl*)src;
18 years, 8 months
1
0
0
0
[greatlrd] 21484: setup almost all Createsurface for primar right it is very few thin left todo
by aleksey@studiocerebral.com
Author: greatlrd Date: Fri Apr 7 10:45:25 2006 New Revision: 21484 URL:
http://svn.reactos.ru/svn/reactos?rev=21484&view=rev
Log: setup almost all Createsurface for primar right it is very few thin left todo Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c trunk/reactos/dll/directx/ddraw/main/ddraw_main.c trunk/reactos/dll/directx/ddraw/rosdraw.h Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
============================================================================== --- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original) +++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Fri Apr 7 10:45:25 2006 @@ -13,97 +13,91 @@ HRESULT Hal_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD, LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter) { - UINT i; - IDirectDrawImpl* This = (IDirectDrawImpl*)iface; - - /* create primare surface now */ - - memset(&This->mddsdPrimary, 0, sizeof(DDSURFACEDESC)); - This->mddsdPrimary.dwSize = sizeof(DDSURFACEDESC); - This->mddsdPrimary.dwFlags = DDSD_CAPS; - This->mddsdPrimary.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_VIDEOMEMORY | DDSCAPS_VISIBLE; - - DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface; - mDdCanCreateSurface.lpDD = &This->mDDrawGlobal; - mDdCanCreateSurface.CanCreateSurface = This->mCallbacks.HALDD.CanCreateSurface; - mDdCanCreateSurface.bIsDifferentPixelFormat = FALSE; //isDifferentPixelFormat; - mDdCanCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary; // pDDSD; - - - if (This->mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) - { - // derr(L"DirectDrawImpl[%08x]::__createPrimary Cannot create primary [%08x]", this, rv); - return DDERR_NOTINITIALIZED; - } - - if (mDdCanCreateSurface.ddRVal != DD_OK) - { - return DDERR_NOTINITIALIZED; - } - - memset(&This->mPrimaryGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); - This->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE; - This->mPrimaryGlobal.lpDD = &This->mDDrawGlobal; - This->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal; - This->mPrimaryGlobal.wWidth = (WORD)This->mpModeInfos[0].dwWidth; - This->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight; - This->mPrimaryGlobal.lPitch = This->mpModeInfos[0].lPitch; - - memset(&This->mPrimaryMore, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); - This->mPrimaryMore.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); - - memset(&This->mPrimaryLocal, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); - This->mPrimaryLocal.lpGbl = &This->mPrimaryGlobal; - This->mPrimaryLocal.lpSurfMore = &This->mPrimaryMore; - This->mPrimaryLocal.dwProcessId = GetCurrentProcessId(); - This->mPrimaryLocal.dwFlags = DDRAWISURF_PARTOFPRIMARYCHAIN|DDRAWISURF_HASOVERLAYDATA; - This->mPrimaryLocal.ddsCaps.dwCaps = This->mddsdPrimary.ddsCaps.dwCaps; - - This->mpPrimaryLocals[0] = &This->mPrimaryLocal; - - DDHAL_CREATESURFACEDATA mDdCreateSurface; - mDdCreateSurface.lpDD = &This->mDDrawGlobal; - mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface; - mDdCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary;//pDDSD; - mDdCreateSurface.lplpSList = This->mpPrimaryLocals; //cSurfaces; - mDdCreateSurface.dwSCnt = This->mDDrawGlobal.dsList->dwIntRefCnt ; //ppSurfaces; - - if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED) - { - return DDERR_NOTINITIALIZED; - } - - - if (mDdCreateSurface.ddRVal != DD_OK) - { - return mDdCreateSurface.ddRVal; - } - - // -- Setup Clipper --------------------------------------------------------- - memset(&This->mPrimaryClipperGlobal, 0, sizeof(DDRAWI_DDRAWCLIPPER_GBL)); - This->mPrimaryClipperGlobal.dwFlags = DDRAWICLIP_ISINITIALIZED; - This->mPrimaryClipperGlobal.dwProcessId = GetCurrentProcessId(); - //mPrimaryClipperGlobal.hWnd = (ULONG_PTR)hwnd; - This->mPrimaryClipperGlobal.hWnd = (ULONG_PTR)GetDesktopWindow(); - This->mPrimaryClipperGlobal.lpDD = &This->mDDrawGlobal; - This->mPrimaryClipperGlobal.lpStaticClipList = NULL; - - memset(&This->mPrimaryClipperLocal, 0, sizeof(DDRAWI_DDRAWCLIPPER_LCL)); - This->mPrimaryClipperLocal.lpGbl = &This->mPrimaryClipperGlobal; - - //memset(&mPrimaryClipperInterface, 0, sizeof(DDRAWI_DDRAWCLIPPER_INT)); - //mPrimaryClipperInterface.lpLcl = &mPrimaryClipperLocal; - //mPrimaryClipperInterface.dwIntRefCnt = 1; - //mPrimaryClipperInterface.lpLink = null; - //mPrimaryClipperInterface.lpVtbl = null; - - This->mPrimaryLocal.lpDDClipper = &This->mPrimaryClipperLocal; - //mPrimaryMore.lpDDIClipper = &mPrimaryClipperInterface; - - //mDdBlt.lpDDDestSurface = mpPrimaryLocals[0]; - - - /* create primare surface is down now */ +// UINT i; + IDirectDrawImpl* This = (IDirectDrawImpl*)iface; + + DDHAL_CREATESURFACEDATA mDdCreateSurface; + DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface; + + + mDdCanCreateSurface.lpDD = &This->mDDrawGlobal; + mDdCanCreateSurface.CanCreateSurface = This->mCallbacks.HALDD.CanCreateSurface; + + mDdCreateSurface.lpDD = &This->mDDrawGlobal; + mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface; + + /* create primare surface now */ + if (pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + { + memset(&This->mddsdPrimary, 0, sizeof(DDSURFACEDESC)); + This->mddsdPrimary.dwSize = sizeof(DDSURFACEDESC); + This->mddsdPrimary.dwFlags = pDDSD->dwFlags; + This->mddsdPrimary.ddsCaps.dwCaps = pDDSD->ddsCaps.dwCaps; + mDdCanCreateSurface.bIsDifferentPixelFormat = FALSE; //isDifferentPixelFormat; + mDdCanCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary; // pDDSD; + + if (This->mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) + { + return DDERR_NOTINITIALIZED; + } + + if (mDdCanCreateSurface.ddRVal != DD_OK) + { + return DDERR_NOTINITIALIZED; + } + memset(&This->mPrimaryGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); + This->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE; + This->mPrimaryGlobal.lpDD = &This->mDDrawGlobal; + This->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal; + This->mPrimaryGlobal.wWidth = (WORD)This->mpModeInfos[0].dwWidth; + This->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight; + This->mPrimaryGlobal.lPitch = This->mpModeInfos[0].lPitch; + + memset(&This->mPrimaryMore, 0, sizeof(DDRAWI_DDRAWSURFACE_MORE)); + This->mPrimaryMore.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE); + + memset(&This->mPrimaryLocal, 0, sizeof(DDRAWI_DDRAWSURFACE_LCL)); + This->mPrimaryLocal.lpGbl = &This->mPrimaryGlobal; + This->mPrimaryLocal.lpSurfMore = &This->mPrimaryMore; + This->mPrimaryLocal.dwProcessId = GetCurrentProcessId(); + + // FIXME Check the flags if we shall create a primaresurface for overlay or something else + This->mPrimaryLocal.dwFlags = DDRAWISURF_PARTOFPRIMARYCHAIN|DDRAWISURF_HASOVERLAYDATA|DDRAWISURF_HASDC; + This->mPrimaryLocal.ddsCaps.dwCaps = This->mddsdPrimary.ddsCaps.dwCaps; + This->mpPrimaryLocals[0] = &This->mPrimaryLocal; + + mDdCreateSurface.lpDDSurfaceDesc = &This->mddsdPrimary;//pDDSD; + mDdCreateSurface.lplpSList = This->mpPrimaryLocals; //cSurfaces; + mDdCreateSurface.dwSCnt = This->mDDrawGlobal.dsList->dwIntRefCnt ; //ppSurfaces; + if (This->mHALInfo.lpDDCallbacks->CreateSurface(&mDdCreateSurface) == DDHAL_DRIVER_NOTHANDLED) + { + return DDERR_NOTINITIALIZED; + } + + if (mDdCreateSurface.ddRVal != DD_OK) + { + return mDdCreateSurface.ddRVal; + } + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) + { + DX_STUB; + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_TEXTURE) + { + DX_STUB; + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) + { + DX_STUB; + } + else if (pDDSD->ddsCaps.dwCaps & DDSCAPS_OFFSCREENPLAIN) + { + DX_STUB; + } + + // return DDERR_INVALIDSURFACETYPE; + /* @@ -114,6 +108,7 @@ /* create overlay surface now */ + /* memset(&This->mddsdOverlay, 0, sizeof(DDSURFACEDESC)); This->mddsdOverlay.dwSize = sizeof(DDSURFACEDESC); This->mddsdOverlay.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT | DDSD_WIDTH | DDSD_HEIGHT; @@ -185,12 +180,7 @@ UINT j = (i + 1) % cSurfaces; - /*if (!mHALInfo.lpDDSurfaceCallbacks->AddAttachedSurface(mpOverlayLocals[i], mpOverlayLocals[j])) - { - // derr(L"DirectDrawImpl[%08x]::__setupDevice DdAttachSurface(%d, %d) failed", this, i, j); - return DD_FALSE; - }*/ - + if (!DdAttachSurface(This->mpOverlayLocals[i], This->mpOverlayLocals[j])) { // derr(L"DirectDrawImpl[%08x]::__setupDevice DdAttachSurface(%d, %d) failed", this, i, j); @@ -230,11 +220,7 @@ mDdUpdateOverlay.lpDDSrcSurface = This->mpOverlayLocals[0];//pDDSurface; mDdUpdateOverlay.dwFlags = DDOVER_SHOW; - /* if (flags & DDOVER_DDFX) - mDdUpdateOverlay.overlayFX = *pFx; - copyRect(&mDdUpdateOverlay.rDest, pdst); - copyRect(&mDdUpdateOverlay.rSrc, psrc); -*/ + mDdUpdateOverlay.rDest.top = 0; mDdUpdateOverlay.rDest.left = 0; @@ -259,6 +245,46 @@ { return mDdUpdateOverlay.ddRVal; } +*/ + + DDHAL_BLTDATA mDdBlt; + mDdBlt.lpDDDestSurface = This->mpPrimaryLocals[0]; + + if (!DdResetVisrgn(This->mpPrimaryLocals[0], NULL)) + { + // derr(L"DirectDrawImpl[%08x]::_clear DdResetVisrgn failed", this); + return DDERR_NOGDI; + } + + memset(&mDdBlt, 0, sizeof(DDHAL_BLTDATA)); + memset(&mDdBlt.bltFX, 0, sizeof(DDBLTFX)); + mDdBlt.bltFX.dwSize = sizeof(DDBLTFX); + + mDdBlt.lpDD = &This->mDDrawGlobal; + mDdBlt.Blt = This->mCallbacks.HALDDSurface.Blt; + mDdBlt.lpDDDestSurface = This->mpPrimaryLocals[0]; + + This->mpPrimaryLocals[0]->hDC = (ULONG_PTR)GetDC(This->CooperativeHWND); + mDdBlt.rDest.top = 50; + mDdBlt.rDest.bottom = 100; + mDdBlt.rDest.left = 0; + mDdBlt.rDest.right = 100; + mDdBlt.lpDDSrcSurface = NULL; + mDdBlt.IsClipped = FALSE; + mDdBlt.bltFX.dwFillColor = 0xFFFF00; + mDdBlt.dwFlags = DDBLT_COLORFILL | DDBLT_WAIT; + + if (mDdBlt.Blt(&mDdBlt) != DDHAL_DRIVER_HANDLED) + { + return DDHAL_DRIVER_HANDLED; + } + + + + if (mDdBlt.ddRVal!=DD_OK) + { + return mDdBlt.ddRVal; + } return DD_OK; } Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra…
============================================================================== --- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Fri Apr 7 10:45:25 2006 @@ -136,6 +136,9 @@ // set the data This->mDDrawGlobal.lpExclusiveOwner->hWnd = (ULONG_PTR) hwnd; This->mDDrawGlobal.lpExclusiveOwner->hDC = (ULONG_PTR)GetDC(hwnd); + + This->CooperativeHWND = hwnd; + /* FIXME : fill the mDDrawGlobal.lpExclusiveOwner->dwLocalFlags right */ //mDDrawGlobal.lpExclusiveOwner->dwLocalFlags Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h…
============================================================================== --- trunk/reactos/dll/directx/ddraw/rosdraw.h (original) +++ trunk/reactos/dll/directx/ddraw/rosdraw.h Fri Apr 7 10:45:25 2006 @@ -67,6 +67,7 @@ DDRAWI_DIRECTDRAW_LCL ExclusiveOwner; DWORD cooperative_level; + HWND CooperativeHWND; BOOL InitializeDraw;
18 years, 8 months
1
0
0
0
[hpoussin] 21483: Implement UpdateDriverForPlugAndPlayDevicesW
by aleksey@studiocerebral.com
Author: hpoussin Date: Thu Apr 6 23:28:01 2006 New Revision: 21483 URL:
http://svn.reactos.ru/svn/reactos?rev=21483&view=rev
Log: Implement UpdateDriverForPlugAndPlayDevicesW Modified: trunk/reactos/dll/win32/newdev/newdev.c Modified: trunk/reactos/dll/win32/newdev/newdev.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev.c (original) +++ trunk/reactos/dll/win32/newdev/newdev.c Thu Apr 6 23:28:01 2006 @@ -1,7 +1,7 @@ /* * New device installer (newdev.dll) * - * Copyright 2005 Hervé Poussineau (hpoussin(a)reactos.org) + * Copyright 2005-2006 Hervé Poussineau (hpoussin(a)reactos.org) * 2005 Christoph von Wittich (Christoph(a)ActiveVB.de) * * This library is free software; you can redistribute it and/or @@ -27,7 +27,7 @@ static BOOL SearchDriver ( PDEVINSTDATA DevInstData, LPCTSTR Path ); static BOOL InstallDriver ( PDEVINSTDATA DevInstData ); static DWORD WINAPI FindDriverProc( LPVOID lpParam ); -static BOOL FindDriver ( PDEVINSTDATA DevInstData ); +static BOOL FindDriver ( PDEVINSTDATA DevInstData, LPCWSTR InfFile ); static DEVINSTDATA DevInstData; HINSTANCE hDllInstance; @@ -163,7 +163,7 @@ } /* -* @unimplemented +* @implemented */ BOOL WINAPI UpdateDriverForPlugAndPlayDevicesW( @@ -173,9 +173,159 @@ IN DWORD InstallFlags, OUT PBOOL bRebootRequired OPTIONAL) { - UNIMPLEMENTED; - SetLastError(ERROR_GEN_FAILURE); - return FALSE; + DEVINSTDATA DevInstData; + DWORD i; + LPWSTR Buffer = NULL; + DWORD BufferSize; + LPCWSTR CurrentHardwareId; /* Pointer into Buffer */ + BOOL FoundHardwareId, FoundAtLeastOneDevice = FALSE; + BOOL ret = FALSE; + + DevInstData.hDevInfo = INVALID_HANDLE_VALUE; + + TRACE("UpdateDriverForPlugAndPlayDevicesW(%p %S %S 0x%lx %p)\n", + hwndParent, HardwareId, FullInfPath, InstallFlags, bRebootRequired); + + /* FIXME: InstallFlags bRebootRequired ignored! */ + + /* Check flags */ + /* FIXME: if (InstallFlags & ~(INSTALLFLAG_FORCE | INSTALLFLAG_READONLY | INSTALLFLAG_NONINTERACTIVE)) + { + DPRINT("Unknown flags: 0x%08lx\n", InstallFlags & ~(INSTALLFLAG_FORCE | INSTALLFLAG_READONLY | INSTALLFLAG_NONINTERACTIVE)); + SetLastError(ERROR_INVALID_FLAGS); + goto cleanup; + }*/ + + /* Enumerate all devices of the system */ + DevInstData.hDevInfo = SetupDiGetClassDevsW(NULL, NULL, hwndParent, DIGCF_ALLCLASSES | DIGCF_PRESENT); + if (DevInstData.hDevInfo == INVALID_HANDLE_VALUE) + goto cleanup; + DevInstData.devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + for (i = 0; ; i++) + { + if (!SetupDiEnumDeviceInfo(DevInstData.hDevInfo, i, &DevInstData.devInfoData)) + { + if (GetLastError() != ERROR_NO_MORE_ITEMS) + { + TRACE("SetupDiEnumDeviceInfo() failed with error 0x%lx\n", GetLastError()); + goto cleanup; + } + /* This error was expected */ + break; + } + + /* Get Hardware ID */ + HeapFree(GetProcessHeap(), 0, Buffer); + Buffer = NULL; + BufferSize = 0; + while (!SetupDiGetDeviceRegistryPropertyW( + DevInstData.hDevInfo, + &DevInstData.devInfoData, + SPDRP_HARDWAREID, + NULL, + (PBYTE)Buffer, + BufferSize, + &BufferSize)) + { + if (GetLastError() == ERROR_FILE_NOT_FOUND) + { + Buffer = NULL; + break; + } + else if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) + { + TRACE("SetupDiGetDeviceRegistryPropertyW() failed with error 0x%lx\n", GetLastError()); + goto cleanup; + } + /* This error was expected */ + HeapFree(GetProcessHeap(), 0, Buffer); + Buffer = HeapAlloc(GetProcessHeap(), 0, BufferSize); + if (!Buffer) + { + TRACE("HeapAlloc() failed\n", GetLastError()); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto cleanup; + } + } + if (Buffer == NULL) + continue; + + /* Check if we match the given hardware ID */ + FoundHardwareId = FALSE; + for (CurrentHardwareId = Buffer; *CurrentHardwareId != UNICODE_NULL; CurrentHardwareId += wcslen(CurrentHardwareId) + 1) + { + if (wcscmp(CurrentHardwareId, HardwareId) == 0) + { + FoundHardwareId = TRUE; + break; + } + } + if (!FoundHardwareId) + continue; + + /* We need to try to update the driver of this device */ + + /* Get Instance ID */ + HeapFree(GetProcessHeap(), 0, Buffer); + Buffer = NULL; + if (SetupDiGetDeviceInstanceIdW(DevInstData.hDevInfo, &DevInstData.devInfoData, NULL, 0, &BufferSize)) + { + /* Error, as the output buffer should be too small */ + SetLastError(ERROR_GEN_FAILURE); + goto cleanup; + } + else if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) + { + TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%lx\n", GetLastError()); + goto cleanup; + } + else if ((Buffer = HeapAlloc(GetProcessHeap(), 0, BufferSize)) == NULL) + { + TRACE("HeapAlloc() failed\n", GetLastError()); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + goto cleanup; + } + else if (!SetupDiGetDeviceInstanceIdW(DevInstData.hDevInfo, &DevInstData.devInfoData, Buffer, BufferSize, NULL)) + { + TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%lx\n", GetLastError()); + goto cleanup; + } + TRACE("Trying to update the driver of %S\n", Buffer); + + /* Search driver in the specified .inf file */ + if (!FindDriver(&DevInstData, FullInfPath)) + { + TRACE("FindDriver() failed with error 0x%lx\n", GetLastError()); + continue; + } + + /* FIXME: HACK! We shouldn't check of ERROR_PRIVILEGE_NOT_HELD */ + //if (!InstallDriver(&DevInstData)) + if (!InstallDriver(&DevInstData) && GetLastError() != ERROR_PRIVILEGE_NOT_HELD) + { + TRACE("InstallDriver() failed with error 0x%lx\n", GetLastError()); + continue; + } + + FoundAtLeastOneDevice = TRUE; + } + + if (FoundAtLeastOneDevice) + { + SetLastError(NO_ERROR); + ret = TRUE; + } + else + { + TRACE("No device found with HardwareID %S\n", HardwareId); + SetLastError(ERROR_NO_SUCH_DEVINST); + } + +cleanup: + if (DevInstData.hDevInfo != INVALID_HANDLE_VALUE) + SetupDiDestroyDeviceInfoList(DevInstData.hDevInfo); + HeapFree(GetProcessHeap(), 0, Buffer); + return ret; } /* @@ -549,7 +699,7 @@ if (SearchDriver ( DevInstData, drive )) { /* if we found a valid driver inf... */ - if (FindDriver ( DevInstData )) + if (FindDriver ( DevInstData, NULL )) { InstallDriver ( DevInstData ); PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0); @@ -769,7 +919,8 @@ static BOOL FindDriver( - IN PDEVINSTDATA DevInstData) + IN PDEVINSTDATA DevInstData, + IN LPCWSTR InfFile OPTIONAL) { SP_DEVINSTALL_PARAMS DevInstallParams = {0,}; BOOL ret; @@ -781,6 +932,13 @@ return FALSE; } DevInstallParams.FlagsEx |= DI_FLAGSEX_ALLOWEXCLUDEDDRVS; + + if (InfFile) + { + DevInstallParams.Flags |= DI_ENUMSINGLEINF; + wcscpy(DevInstallParams.DriverPath, InfFile); + } + if (!SetupDiSetDeviceInstallParams(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) { TRACE("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); @@ -902,7 +1060,7 @@ &DevInstData->devInfoData, &DevInstallParams); - if ( FindDriver ( DevInstData ) ) + if ( FindDriver ( DevInstData, NULL ) ) { if (hFindFile != INVALID_HANDLE_VALUE) FindClose(hFindFile); @@ -1153,7 +1311,7 @@ TRACE("Installing %S (%S)\n", DevInstData.buffer, InstanceId); - if ((!FindDriver(&DevInstData)) && (Show != SW_HIDE)) + if ((!FindDriver(&DevInstData, NULL)) && (Show != SW_HIDE)) { /* Create the Welcome page */
18 years, 8 months
1
0
0
0
[gedmurphy] 21482: fix resource leak
by aleksey@studiocerebral.com
Author: gedmurphy Date: Thu Apr 6 21:37:46 2006 New Revision: 21482 URL:
http://svn.reactos.ru/svn/reactos?rev=21482&view=rev
Log: fix resource leak Modified: trunk/reactos/base/applications/wordpad/dialogs.c Modified: trunk/reactos/base/applications/wordpad/dialogs.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/d…
============================================================================== --- trunk/reactos/base/applications/wordpad/dialogs.c (original) +++ trunk/reactos/base/applications/wordpad/dialogs.c Thu Apr 6 21:37:46 2006 @@ -83,7 +83,7 @@ LPARAM lParam) { HWND hLicenseEditWnd; - HICON hIcon = NULL; + static HICON hIcon = NULL; static LPTSTR lpLicense = NULL; switch (message)
18 years, 8 months
1
0
0
0
[gedmurphy] 21481: store license on heap and add some error checking
by aleksey@studiocerebral.com
Author: gedmurphy Date: Thu Apr 6 20:23:35 2006 New Revision: 21481 URL:
http://svn.reactos.ru/svn/reactos?rev=21481&view=rev
Log: store license on heap and add some error checking Modified: trunk/reactos/base/applications/wordpad/dialogs.c Modified: trunk/reactos/base/applications/wordpad/dialogs.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/d…
============================================================================== --- trunk/reactos/base/applications/wordpad/dialogs.c (original) +++ trunk/reactos/base/applications/wordpad/dialogs.c Thu Apr 6 20:23:35 2006 @@ -84,7 +84,7 @@ { HWND hLicenseEditWnd; HICON hIcon = NULL; - TCHAR strLicense[700]; + static LPTSTR lpLicense = NULL; switch (message) { @@ -96,27 +96,30 @@ 16, 16, 0); - - SendMessage(hDlg, - WM_SETICON, - ICON_SMALL, - (LPARAM)hIcon); + if (hIcon != NULL) + { + SendMessage(hDlg, + WM_SETICON, + ICON_SMALL, + (LPARAM)hIcon); + } hLicenseEditWnd = GetDlgItem(hDlg, IDC_LICENSE_EDIT); - LoadString(hInstance, - IDS_LICENSE, - strLicense, - sizeof(strLicense) / sizeof(TCHAR)); - - SetWindowText(hLicenseEditWnd, - strLicense); + if (AllocAndLoadString(&lpLicense, + hInstance, + IDS_LICENSE)) + { + SetWindowText(hLicenseEditWnd, + lpLicense); + } return TRUE; case WM_COMMAND: if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) { + LocalFree((HLOCAL)lpLicense); DestroyIcon(hIcon); EndDialog(hDlg, LOWORD(wParam));
18 years, 8 months
1
0
0
0
[gedmurphy] 21480: get the names the right way round this time.
by aleksey@studiocerebral.com
Author: gedmurphy Date: Thu Apr 6 20:07:07 2006 New Revision: 21480 URL:
http://svn.reactos.ru/svn/reactos?rev=21480&view=rev
Log: get the names the right way round this time. Added: trunk/reactos/base/applications/notepad/res/notepad.ico - copied unchanged from r21478, trunk/reactos/base/applications/notepad/res/wordpad.ico trunk/reactos/base/applications/wordpad/res/wordpad.ico - copied unchanged from r21478, trunk/reactos/base/applications/wordpad/res/notepad.ico Removed: trunk/reactos/base/applications/notepad/res/wordpad.ico trunk/reactos/base/applications/wordpad/res/notepad.ico Removed: trunk/reactos/base/applications/notepad/res/wordpad.ico URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/notepad/r…
============================================================================== Binary file - no diff available. Removed: trunk/reactos/base/applications/wordpad/res/notepad.ico URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/r…
============================================================================== Binary file - no diff available.
18 years, 8 months
1
0
0
0
[gedmurphy] 21479: revert this. It got caught up in the action ; )
by aleksey@studiocerebral.com
Author: gedmurphy Date: Thu Apr 6 20:04:03 2006 New Revision: 21479 URL:
http://svn.reactos.ru/svn/reactos?rev=21479&view=rev
Log: revert this. It got caught up in the action ;) Modified: trunk/reactos/base/applications/imagesoft/precomp.h Modified: trunk/reactos/base/applications/imagesoft/precomp.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/imagesoft…
============================================================================== --- trunk/reactos/base/applications/imagesoft/precomp.h (original) +++ trunk/reactos/base/applications/imagesoft/precomp.h Thu Apr 6 20:04:03 2006 @@ -251,9 +251,6 @@ const DOCKBAR *Dockbar, PVOID Context, const DOCKBAR_ITEM_CALLBACKS *DockbarCallbacks); -BOOL TbdDockBarIdFromClientWindow(PTOOLBAR_DOCKS TbDocks, - HWND hWndClient, - UINT *Id); BOOL TbdHandleNotifications(PTOOLBAR_DOCKS TbDocks, LPNMHDR pnmh, LRESULT *Result); @@ -337,21 +334,6 @@ VOID MessageBoxInt(INT num); -BOOL ToolbarDeleteControlSpace(HWND hWndToolbar, - const TBBUTTON *ptbButton); - -typedef VOID (*ToolbarChangeControlCallback)(HWND hWndToolbar, - HWND hWndControl, - BOOL Vert); -VOID ToolbarUpdateControlSpaces(HWND hWndToolbar, - ToolbarChangeControlCallback ChangeCallback); - -BOOL ToolbarInsertSpaceForControl(HWND hWndToolbar, - HWND hWndControl, - INT Index, - INT iCmd, - BOOL HideVertical); - /* opensave.c */ VOID FileInitialize(HWND hwnd); BOOL DoOpenFile(HWND hwnd, LPTSTR lpFileName, LPTSTR lpName);
18 years, 8 months
1
0
0
0
[gedmurphy] 21478: Swap these 2 icons around. They are more fitting to the app this way.
by aleksey@studiocerebral.com
Author: gedmurphy Date: Thu Apr 6 20:01:28 2006 New Revision: 21478 URL:
http://svn.reactos.ru/svn/reactos?rev=21478&view=rev
Log: Swap these 2 icons around. They are more fitting to the app this way. Added: trunk/reactos/base/applications/notepad/res/wordpad.ico - copied unchanged from r21477, trunk/reactos/base/applications/wordpad/res/wordpad.ico trunk/reactos/base/applications/wordpad/res/notepad.ico - copied unchanged from r21475, trunk/reactos/base/applications/notepad/res/notepad.ico Removed: trunk/reactos/base/applications/notepad/res/notepad.ico trunk/reactos/base/applications/wordpad/res/wordpad.ico Modified: trunk/reactos/base/applications/imagesoft/precomp.h Modified: trunk/reactos/base/applications/imagesoft/precomp.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/imagesoft…
============================================================================== --- trunk/reactos/base/applications/imagesoft/precomp.h (original) +++ trunk/reactos/base/applications/imagesoft/precomp.h Thu Apr 6 20:01:28 2006 @@ -251,6 +251,9 @@ const DOCKBAR *Dockbar, PVOID Context, const DOCKBAR_ITEM_CALLBACKS *DockbarCallbacks); +BOOL TbdDockBarIdFromClientWindow(PTOOLBAR_DOCKS TbDocks, + HWND hWndClient, + UINT *Id); BOOL TbdHandleNotifications(PTOOLBAR_DOCKS TbDocks, LPNMHDR pnmh, LRESULT *Result); @@ -334,6 +337,21 @@ VOID MessageBoxInt(INT num); +BOOL ToolbarDeleteControlSpace(HWND hWndToolbar, + const TBBUTTON *ptbButton); + +typedef VOID (*ToolbarChangeControlCallback)(HWND hWndToolbar, + HWND hWndControl, + BOOL Vert); +VOID ToolbarUpdateControlSpaces(HWND hWndToolbar, + ToolbarChangeControlCallback ChangeCallback); + +BOOL ToolbarInsertSpaceForControl(HWND hWndToolbar, + HWND hWndControl, + INT Index, + INT iCmd, + BOOL HideVertical); + /* opensave.c */ VOID FileInitialize(HWND hwnd); BOOL DoOpenFile(HWND hwnd, LPTSTR lpFileName, LPTSTR lpName); Removed: trunk/reactos/base/applications/notepad/res/notepad.ico URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/notepad/r…
============================================================================== Binary file - no diff available. Removed: trunk/reactos/base/applications/wordpad/res/wordpad.ico URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/r…
============================================================================== Binary file - no diff available.
18 years, 8 months
1
0
0
0
[gedmurphy] 21477: Start a rewrite of an MDI WordPad.
by aleksey@studiocerebral.com
Author: gedmurphy Date: Thu Apr 6 19:54:59 2006 New Revision: 21477 URL:
http://svn.reactos.ru/svn/reactos?rev=21477&view=rev
Log: Start a rewrite of an MDI WordPad. Added: trunk/reactos/base/applications/wordpad/ trunk/reactos/base/applications/wordpad/En.rc trunk/reactos/base/applications/wordpad/about.c trunk/reactos/base/applications/wordpad/dialogs.c trunk/reactos/base/applications/wordpad/editwnd.c trunk/reactos/base/applications/wordpad/mainwnd.c trunk/reactos/base/applications/wordpad/manifest.xml trunk/reactos/base/applications/wordpad/misc.c trunk/reactos/base/applications/wordpad/opensave.c trunk/reactos/base/applications/wordpad/precomp.h trunk/reactos/base/applications/wordpad/res/ trunk/reactos/base/applications/wordpad/res/toolbar.bmp (with props) trunk/reactos/base/applications/wordpad/res/wordpad.ico (with props) trunk/reactos/base/applications/wordpad/resource.h trunk/reactos/base/applications/wordpad/wordpad.c trunk/reactos/base/applications/wordpad/wordpad.rbuild trunk/reactos/base/applications/wordpad/wordpad.rc Added: trunk/reactos/base/applications/wordpad/En.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/E…
============================================================================== --- trunk/reactos/base/applications/wordpad/En.rc (added) +++ trunk/reactos/base/applications/wordpad/En.rc Thu Apr 6 19:54:59 2006 @@ -1,0 +1,167 @@ +IDR_MAINMENU MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&New...", ID_NEW + MENUITEM "&Open...", ID_OPEN + MENUITEM SEPARATOR + MENUITEM "&Close\tCtrl+F4", ID_CLOSE, GRAYED + MENUITEM "C&lose all", ID_CLOSEALL, GRAYED + MENUITEM SEPARATOR + MENUITEM "&Save", ID_SAVE, GRAYED + MENUITEM "Save &As...", ID_SAVEAS, GRAYED + MENUITEM SEPARATOR + MENUITEM "Print Pre&view", ID_PRINTPRE, GRAYED + MENUITEM "&Print...", ID_PRINT, GRAYED + MENUITEM SEPARATOR + MENUITEM "Page Set&up...", ID_PAGESETUP, GRAYED + MENUITEM SEPARATOR + MENUITEM "E&xit\tAlt+F4", ID_EXIT + END + POPUP "&Edit" + BEGIN + MENUITEM "&Undo", ID_UNDO, GRAYED + MENUITEM "&Redo", ID_REDO, GRAYED + MENUITEM SEPARATOR + MENUITEM "Cu&t", ID_CUT, GRAYED + MENUITEM "&Copy", ID_COPY, GRAYED + MENUITEM "&Paste", ID_PASTE, GRAYED + MENUITEM SEPARATOR + MENUITEM "Clear", -1, GRAYED + MENUITEM "Select &All", ID_SELALL, GRAYED + MENUITEM SEPARATOR + MENUITEM "&Find...\tCtrl+F",-1, GRAYED + MENUITEM "Find Next", -1, GRAYED + MENUITEM "Replace\tCtrl+H", -1, GRAYED + MENUITEM SEPARATOR + MENUITEM "Object Properties",-1, GRAYED + MENUITEM "Object", -1, GRAYED + END + POPUP "&View" + BEGIN + MENUITEM "&Toolbar", -1, CHECKED + MENUITEM "&Format Bar", -1, CHECKED + MENUITEM "&Ruler", -1, CHECKED + MENUITEM "&Status Bar", ID_STATUSBAR, CHECKED + END + POPUP "&Insert" + BEGIN + MENUITEM "&Date and Time...",-1, GRAYED + MENUITEM "&Object...", -1, GRAYED + END + POPUP "&Format" + BEGIN + MENUITEM "&Font...", -1 GRAYED + MENUITEM "Bulletstyle", -1, GRAYED + MENUITEM "Paragraph...", -1, GRAYED + MENUITEM "tabs...", -1, GRAYED + END + POPUP "&Window" + BEGIN + MENUITEM "&Cascade", ID_WINDOW_CASCADE + MENUITEM "Tile &Horizontally", ID_WINDOW_TILE_HORZ + MENUITEM "Tile &Vertiacally", ID_WINDOW_TILE_VERT + MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE + MENUITEM SEPARATOR + MENUITEM "Nex&t\tCtrl+F6", ID_WINDOW_NEXT + END + POPUP "&Help" + BEGIN + MENUITEM "&About...", ID_ABOUT + END +END + +IDR_POPUP MENU +BEGIN + POPUP "popup" + BEGIN + + MENUITEM SEPARATOR + + END +END + + +IDD_NEWDOCSEL DIALOGEX 6,6,159,67 +CAPTION "New" +FONT 8,"Tahoma",0,0 +STYLE WS_BORDER | WS_DLGFRAME | DS_MODALFRAME +BEGIN + LTEXT "New document Type:", IDC_STATIC, 4, 3, 72, 9 + LISTBOX IDC_LIST, 4, 16, 104, 46, WS_TABSTOP + PUSHBUTTON "&OK", IDOK, 112, 16, 44, 13 + PUSHBUTTON "&Cancel", IDCANCEL, 112, 33, 44, 13 +END + + +IDD_ABOUTBOX DIALOGEX 22,16,190,182 +CAPTION "About WordPad" +FONT 8,"Tahoma",0,0 +STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + LTEXT "WordPad II v0.1\nCopyright (C) 2006\nGed Murphy (gedmurphy(a)gmail.com)", IDC_STATIC, 48, 7, 150, 36 + PUSHBUTTON "Close", IDOK, 65, 162, 44, 15 + ICON IDI_ICON, IDC_STATIC, 10, 10, 7, 30 + EDITTEXT IDC_LICENSE_EDIT, 8, 40, 174, 110, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE +END + + +STRINGTABLE DISCARDABLE +BEGIN + IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." + IDS_DEFAULT_NAME "Document %1!u!" + IDS_READY " Ready." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DOC_TYPE_RICH_TEXT "Rich Text Document" + IDS_DOC_TYPE_UNICODE_TEXT "Text Document" + IDS_DOC_TYPE_TEXT "Unicode Text Document" +END + + + +/* Tooltips */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP_NEW "New" + IDS_TOOLTIP_OPEN "Open" + IDS_TOOLTIP_SAVE "Save" + IDS_TOOLTIP_PRINTPRE "Print preview" + IDS_TOOLTIP_PRINT "Print" + IDS_TOOLTIP_CUT "Cut" + IDS_TOOLTIP_COPY "Copy" + IDS_TOOLTIP_PASTE "Paste" + IDS_TOOLTIP_UNDO "Undo" + IDS_TOOLTIP_REDO "Redo" +END + +/* Hints */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HINT_BLANK " " + IDS_HINT_NEW " Creates a new document." + IDS_HINT_OPEN " Opens an existing document." + IDS_HINT_CLOSE " Closes this window." + IDS_HINT_CLOSEALL " Closes all windows." + IDS_HINT_SAVE " Saves the active document." + IDS_HINT_SAVEAS " Saves the active document with a new name." + IDS_HINT_PRINT " Prints the active document." + IDS_HINT_PRINTPRE " Previews the printed document." + IDS_HINT_PAGESETUP " Changes page layout settings." + IDS_HINT_EXIT " Exits this application." + + IDS_HINT_CASCADE " Arrange windows so they overlap." + IDS_HINT_TILE_HORZ " Arrange windows as non-overlapping tiles." + IDS_HINT_TILE_VERT " Arrange windows as non-overlapping tiles." + IDS_HINT_ARRANGE " Arrange icons at the bottom of the window." + IDS_HINT_NEXT " Activates the next window." + + IDS_HINT_SYS_RESTORE " Restores this window to normal size." + IDS_HINT_SYS_MOVE " Moves this window." + IDS_HINT_SYS_SIZE " Resizes this window." + IDS_HINT_SYS_MINIMIZE " Collapses this window to an icon." + IDS_HINT_SYS_MAXIMIZE " Expands this window to fill this screen." +END + Added: trunk/reactos/base/applications/wordpad/about.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/a…
============================================================================== --- trunk/reactos/base/applications/wordpad/about.c (added) +++ trunk/reactos/base/applications/wordpad/about.c Thu Apr 6 19:54:59 2006 @@ -1,0 +1,54 @@ +#include "precomp.h" + +INT_PTR CALLBACK +AboutDialogProc(HWND hDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) +{ + HWND hLicenseEditWnd; + HICON hIcon = NULL; + TCHAR strLicense[700]; + + switch (message) + { + case WM_INITDIALOG: + + hIcon = LoadImage(hInstance, + MAKEINTRESOURCE(IDI_ICON), + IMAGE_ICON, + 16, + 16, + 0); + + SendMessage(hDlg, + WM_SETICON, + ICON_SMALL, + (LPARAM)hIcon); + + hLicenseEditWnd = GetDlgItem(hDlg, + IDC_LICENSE_EDIT); + + LoadString(hInstance, + IDS_LICENSE, + strLicense, + sizeof(strLicense) / sizeof(TCHAR)); + + SetWindowText(hLicenseEditWnd, + strLicense); + return TRUE; + + case WM_COMMAND: + if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) + { + DestroyIcon(hIcon); + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; + } + + break; + } + + return FALSE; +} Added: trunk/reactos/base/applications/wordpad/dialogs.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/d…
============================================================================== --- trunk/reactos/base/applications/wordpad/dialogs.c (added) +++ trunk/reactos/base/applications/wordpad/dialogs.c Thu Apr 6 19:54:59 2006 @@ -1,0 +1,131 @@ +#include "precomp.h" + +INT_PTR CALLBACK +NewDocSelDlgProc(HWND hDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) +{ + switch (message) + { + static HWND hList; + + case WM_INITDIALOG: + { + LPTSTR lpDocType; + INT i; + + hList = GetDlgItem(hDlg, + IDC_LIST); + + for (i = IDS_DOC_TYPE_RICH_TEXT; i <= IDS_DOC_TYPE_TEXT; i++) + { + if (AllocAndLoadString(&lpDocType, + hInstance, + i)) + { + ListBox_AddString(hList, + lpDocType); + LocalFree((HLOCAL)lpDocType); + } + } + + SendMessage(hList, + LB_SETCURSEL, + 0, + 0); + + return TRUE; + } + + case WM_COMMAND: + { + INT LbSel; + + if (HIWORD(wParam) == LBN_DBLCLK) + { + LbSel = (INT)SendMessage(hList, + LB_GETCURSEL, + 0, + 0); + EndDialog(hDlg, + LbSel); + return TRUE; + } + + switch (LOWORD(wParam)) + { + case IDOK: + LbSel = (INT)SendMessage(hList, + LB_GETCURSEL, + 0, + 0); + EndDialog(hDlg, + LbSel); + return TRUE; + + case IDCANCEL: + EndDialog(hDlg, -1); + return TRUE; + } + } + } + + return FALSE; +} + + + +INT_PTR CALLBACK +AboutDialogProc(HWND hDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) +{ + HWND hLicenseEditWnd; + HICON hIcon = NULL; + TCHAR strLicense[700]; + + switch (message) + { + case WM_INITDIALOG: + + hIcon = LoadImage(hInstance, + MAKEINTRESOURCE(IDI_ICON), + IMAGE_ICON, + 16, + 16, + 0); + + SendMessage(hDlg, + WM_SETICON, + ICON_SMALL, + (LPARAM)hIcon); + + hLicenseEditWnd = GetDlgItem(hDlg, + IDC_LICENSE_EDIT); + + LoadString(hInstance, + IDS_LICENSE, + strLicense, + sizeof(strLicense) / sizeof(TCHAR)); + + SetWindowText(hLicenseEditWnd, + strLicense); + return TRUE; + + case WM_COMMAND: + if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) + { + DestroyIcon(hIcon); + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; + } + + break; + } + + return FALSE; +} + Added: trunk/reactos/base/applications/wordpad/editwnd.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/e…
============================================================================== --- trunk/reactos/base/applications/wordpad/editwnd.c (added) +++ trunk/reactos/base/applications/wordpad/editwnd.c Thu Apr 6 19:54:59 2006 @@ -1,0 +1,202 @@ +#include "precomp.h" + +static const TCHAR szEditWndClass[] = TEXT("WordPadEditWndClass"); + + +static BOOL +InitEditWnd(PEDIT_WND_INFO Info) +{ + HANDLE hDLL; + HFONT hfDefault; + + hDLL = LoadLibrary(_T("RICHED20.DLL")); + if (hDLL == NULL) + { + GetError(0); + return FALSE; + } + + Info->hEdit = CreateWindowEx(0, //WS_EX_CLIENTEDGE, + RICHEDIT_CLASS, + NULL, + WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | + ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL, + 0, + 0, + 100, + 100, + Info->hSelf, + NULL, + hInstance, + NULL); + if(Info->hEdit == NULL) + { + GetError(0); + + return FALSE; + } + + hfDefault = GetStockObject(DEFAULT_GUI_FONT); + SendMessage(Info->hEdit, + WM_SETFONT, + (WPARAM)hfDefault, + MAKELPARAM(FALSE, 0)); + + return TRUE; +} + + +static LRESULT CALLBACK +EditWndProc(HWND hwnd, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PEDIT_WND_INFO Info; + LRESULT Ret = 0; + + /* Get the window context */ + Info = (PEDIT_WND_INFO)GetWindowLongPtr(hwnd, + GWLP_USERDATA); + if (Info == NULL && uMsg != WM_CREATE) + { + goto HandleDefaultMessage; + } + + switch (uMsg) + { + case WM_CREATE: + { + Info = (PEDIT_WND_INFO)(((LPMDICREATESTRUCT)((LPCREATESTRUCT)lParam)->lpCreateParams)->lParam); + Info->hSelf = hwnd; + + SetWindowLongPtr(hwnd, + GWLP_USERDATA, + (LONG_PTR)Info); + + if (!InitEditWnd(Info)) + { + Ret = (LRESULT)-1; + break; + } + break; + } + + case WM_SIZE: + { + RECT rcClient; + + if (GetClientRect(Info->hSelf, + &rcClient)) + { + SetWindowPos(Info->hEdit, + NULL, + 0, + 0, + rcClient.right, + rcClient.bottom, + SWP_NOZORDER); + } + } + + default: +HandleDefaultMessage: + Ret = DefMDIChildProc(hwnd, + uMsg, + wParam, + lParam); + break; + } + + return Ret; + +} + + +VOID +SetEditorEnvironment(PEDIT_WND_INFO Info, + BOOL Setup) +{ + if (Setup) + { + /* FIXME - setup editor environment (e.g. show toolbars, enable menus etc) */ + } + else + { + /* FIXME - cleanup editor environment (e.g. hide toolbars, disable menus etc) */ + } +} + + +BOOL +CreateEditWindow(struct _MAIN_WND_INFO *MainWnd, + POPEN_EDIT_INFO OpenInfo) +{ + PEDIT_WND_INFO Info; + HWND hWndEditor; + + Info = HeapAlloc(ProcessHeap, + 0, + sizeof(EDIT_WND_INFO)); + if (Info != NULL) + { + ZeroMemory(Info, + sizeof(EDIT_WND_INFO)); + Info->MainWnd = MainWnd; + Info->MdiEditorType = metImageEditor; + Info->OpenInfo = OpenInfo; + + hWndEditor = CreateMDIWindow(szEditWndClass, + OpenInfo->lpImageName, + WS_MAXIMIZE, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + MainWnd->hMdiClient, + hInstance, + (LPARAM)Info); + + if (hWndEditor != NULL) + return TRUE; + + + HeapFree(ProcessHeap, + 0, + Info); + } + + return FALSE; +} + +BOOL +InitEditWindowImpl(VOID) +{ + WNDCLASSEX wc = {0}; + + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpfnWndProc = EditWndProc; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, + MAKEINTRESOURCE(IDI_ICON)); + wc.hCursor = LoadCursor(NULL, + IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + wc.lpszMenuName = NULL; + wc.lpszClassName = szEditWndClass; + wc.hIconSm = (HICON)LoadImage(hInstance, + MAKEINTRESOURCE(IDI_ICON), + IMAGE_ICON, + 16, + 16, + LR_SHARED); + + return RegisterClassEx(&wc) != (ATOM)0; +} + +VOID +UninitEditWindowImpl(VOID) +{ + UnregisterClass(szEditWndClass, + hInstance); +} Added: trunk/reactos/base/applications/wordpad/mainwnd.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/m…
============================================================================== --- trunk/reactos/base/applications/wordpad/mainwnd.c (added) +++ trunk/reactos/base/applications/wordpad/mainwnd.c Thu Apr 6 19:54:59 2006 @@ -1,0 +1,663 @@ +#include "precomp.h" + +static const TCHAR szMainWndClass[] = TEXT("WordPadMainWndClass"); + +#define ID_MDI_FIRSTCHILD 50000 +#define ID_MDI_WINDOWMENU 5 + +/* menu hints */ +static const MENU_HINT MainMenuHintTable[] = { + /* File Menu */ + {ID_BLANK, IDS_HINT_BLANK}, + {ID_NEW, IDS_HINT_NEW}, + {ID_OPEN, IDS_HINT_OPEN}, + {ID_CLOSE, IDS_HINT_CLOSE}, + {ID_CLOSEALL, IDS_HINT_CLOSEALL}, + {ID_SAVE, IDS_HINT_SAVE}, + {ID_SAVEAS, IDS_HINT_SAVEAS}, + {ID_PRINT, IDS_HINT_PRINT}, + {ID_PRINTPRE, IDS_HINT_PRINTPRE}, + {ID_PAGESETUP, IDS_HINT_PAGESETUP}, + {ID_EXIT, IDS_HINT_EXIT}, + + /* Window Menu */ + {ID_WINDOW_NEXT, IDS_HINT_NEXT}, + {ID_WINDOW_CASCADE, IDS_HINT_CASCADE}, + {ID_WINDOW_TILE_HORZ, IDS_HINT_TILE_HORZ}, + {ID_WINDOW_TILE_VERT, IDS_HINT_TILE_VERT}, + {ID_WINDOW_ARRANGE, IDS_HINT_ARRANGE} +}; + +static const MENU_HINT SystemMenuHintTable[] = { + {SC_RESTORE, IDS_HINT_SYS_RESTORE}, + {SC_MOVE, IDS_HINT_SYS_MOVE}, + {SC_SIZE, IDS_HINT_SYS_SIZE}, + {SC_MINIMIZE, IDS_HINT_SYS_MINIMIZE}, + {SC_MAXIMIZE, IDS_HINT_SYS_MAXIMIZE}, + {SC_CLOSE, IDS_HINT_CLOSE}, + {SC_NEXTWINDOW, IDS_HINT_NEXT}, +}; + + +static VOID +CreateToolbars(PMAIN_WND_INFO Info) +{ + +} + +static VOID CALLBACK +MainWndResize(PVOID Context, + WORD cx, + WORD cy) +{ + RECT rcClient = {0}; + RECT rcStatus = {0}; + HDWP dwp; + PMAIN_WND_INFO Info = (PMAIN_WND_INFO)Context; + + /* Calculate the MDI client rectangle */ + rcClient.right = cx; + rcClient.bottom = cy; + + if (Info->hStatus != NULL) + { + GetWindowRect(Info->hStatus, + &rcStatus); + rcClient.bottom -= (rcStatus.bottom - rcStatus.top); + } + + + dwp = BeginDeferWindowPos(2); + if (dwp != NULL) + { + /* Update the MDI client */ + if (Info->hMdiClient != NULL) + { + dwp = DeferWindowPos(dwp, + Info->hMdiClient, + NULL, + rcClient.left, + rcClient.top, + rcClient.right - rcClient.left, + rcClient.bottom - rcClient.top, + SWP_NOZORDER); + if (dwp == NULL) + return; + } + + /* Update the status bar */ + if (Info->hStatus != NULL) + { + dwp = DeferWindowPos(dwp, + Info->hStatus, + NULL, + 0, + cy - (rcStatus.bottom - rcStatus.top), + cx, + rcStatus.bottom - rcStatus.top, + SWP_NOZORDER); + if (dwp == NULL) + return; + } + + EndDeferWindowPos(dwp); + } +} + +static VOID +InitMainWnd(PMAIN_WND_INFO Info) +{ + CLIENTCREATESTRUCT ccs; + INT statwidths[] = {110, -1}; + + /* FIXME - create controls and initialize the application */ + + /* create the status bar */ + Info->hStatus = CreateWindowEx(0, + STATUSCLASSNAME, + NULL, + WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | CCS_NOPARENTALIGN | SBARS_SIZEGRIP, + 0, + 0, + 0, + 0, + Info->hSelf, + (HMENU)IDC_STATUSBAR, + hInstance, + NULL); + + if (Info->hStatus != NULL) + SendMessage(Info->hStatus, + SB_SETPARTS, + sizeof(statwidths)/sizeof(int), + (LPARAM)statwidths); + + /* create the MDI client window */ + ccs.hWindowMenu = GetSubMenu(GetMenu(Info->hSelf), + ID_MDI_WINDOWMENU); + ccs.idFirstChild = ID_MDI_FIRSTCHILD; + Info->hMdiClient = CreateWindowEx(WS_EX_ACCEPTFILES | WS_EX_CLIENTEDGE, + TEXT("MDICLIENT"), + NULL, + WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VSCROLL | WS_HSCROLL, + 0, + 0, + 0, + 0, + Info->hSelf, + NULL, + hInstance, + &ccs); + + CreateToolbars(Info); + + /* initialize file open/save structure */ + FileInitialize(Info->hSelf); +} + +static VOID +MainWndCommand(PMAIN_WND_INFO Info, + WORD CmdId, + HWND hControl) +{ + //static TCHAR szFileName[MAX_PATH]; + //static TCHAR szImageName[MAX_PATH]; + + UNREFERENCED_PARAMETER(hControl); + + switch (CmdId) + { + case ID_NEW: + { + OPEN_EDIT_INFO OpenInfo; + INT Ret; + + OpenInfo.CreateNew = TRUE; + + LoadAndFormatString(hInstance, + IDS_DEFAULT_NAME, + &OpenInfo.lpImageName, + ++Info->ImagesCreated); + + Ret = DialogBox(hInstance, + MAKEINTRESOURCE(IDD_NEWDOCSEL), + Info->hSelf, + NewDocSelDlgProc); + if (Ret != -1) + { + OpenInfo.DocType = Ret; + + CreateEditWindow(Info, + &OpenInfo); + } + + } + break; + + case ID_BOLD: + MessageBox(NULL, _T("Bingo"), NULL, 0); + break; + + case ID_OPEN: + { +/* OPEN_EDIT_INFO OpenInfo; + + if (DoOpenFile(Info->hSelf, + szFileName, / * full file path * / + szImageName)) / * file name * / + { + OpenInfo.CreateNew = FALSE; + + OpenInfo.Open.lpImagePath = szFileName; + OpenInfo.lpImageName = szImageName; + + CreateEditWindow(Info, + &OpenInfo); + } +*/ + } + break; + + case ID_EXIT: + SendMessage(Info->hSelf, + WM_CLOSE, + 0, + 0); + break; + + /* Window Menu */ + case ID_WINDOW_TILE_HORZ: + SendMessage(Info->hMdiClient, + WM_MDITILE, + MDITILE_HORIZONTAL, + 0); + break; + + case ID_WINDOW_TILE_VERT: + SendMessage(Info->hMdiClient, + WM_MDITILE, + MDITILE_VERTICAL, + 0); + break; + + case ID_WINDOW_CASCADE: + SendMessage(Info->hMdiClient, + WM_MDICASCADE, + 0, + 0); + break; + + case ID_WINDOW_ARRANGE: + SendMessage(Info->hMdiClient, + WM_MDIICONARRANGE, + 0, + 0); + break; + + case ID_WINDOW_NEXT: + SendMessage(Info->hMdiClient, + WM_MDINEXT, + 0, + 0); + break; + + /* Help Menu */ + case ID_ABOUT: + DialogBox(hInstance, + MAKEINTRESOURCE(IDD_ABOUTBOX), + Info->hSelf, + AboutDialogProc); + break; + } +} + +static VOID +DestroyMainWnd(PMAIN_WND_INFO Info) +{ + /* FIXME - cleanup allocated resources */ +} + + +static VOID +UpdateMainStatusBar(PMAIN_WND_INFO Info) +{ + if (Info->hStatus != NULL) + { + SendMessage(Info->hStatus, + SB_SIMPLE, + (WPARAM)Info->InMenuLoop, + 0); + } +} + +static BOOL +MainWndMenuHint(PMAIN_WND_INFO Info, + WORD CmdId, + const MENU_HINT *HintArray, + DWORD HintsCount, + UINT DefHintId) +{ + BOOL Found = FALSE; + const MENU_HINT *LastHint; + UINT HintId = DefHintId; + + LastHint = HintArray + HintsCount; + while (HintArray != LastHint) + { + if (HintArray->CmdId == CmdId) + { + HintId = HintArray->HintId; + Found = TRUE; + break; + } + HintArray++; + } + + StatusBarLoadString(Info->hStatus, + SB_SIMPLEID, + hInstance, + HintId); + + return Found; +} + +static LRESULT CALLBACK +MainWndProc(HWND hwnd, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PMAIN_WND_INFO Info; + LRESULT Ret = 0; + static RECT wndOldPos; + + /* Get the window context */ + Info = (PMAIN_WND_INFO)GetWindowLongPtr(hwnd, + GWLP_USERDATA); + if (Info == NULL && uMsg != WM_CREATE) + { + goto HandleDefaultMessage; + } + + switch (uMsg) + { + case WM_CREATE: + { + Info = (PMAIN_WND_INFO)(((LPCREATESTRUCT)lParam)->lpCreateParams); + + /* Initialize the main window context */ + Info->hSelf = hwnd; + + SetWindowLongPtr(hwnd, + GWLP_USERDATA, + (LONG_PTR)Info); + + InitMainWnd(Info); + + /* Show the window */ + ShowWindow(hwnd, + Info->nCmdShow); + /* get the windows position */ + GetWindowRect(hwnd, + &wndOldPos); + + break; + } + + case WM_SIZE: + { + MainWndResize(Info, + LOWORD(lParam), + HIWORD(lParam)); + /* NOTE - do *not* forward this message to DefFrameProc! Otherwise the MDI client + will attempt to resize itself */ + + break; + } + + case WM_MOVE: + { + + } + break; + + case WM_NOTIFY: + { + + /* FIXME - handle other notifications */ + break; + } + + case WM_COMMAND: + { + MainWndCommand(Info, + LOWORD(wParam), + (HWND)lParam); + goto HandleDefaultMessage; + } + + case WM_MENUSELECT: + { + if (Info->hStatus != NULL) + { + if (!MainWndMenuHint(Info, + LOWORD(wParam), + MainMenuHintTable, + sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]), + IDS_HINT_BLANK)) + { + MainWndMenuHint(Info, + LOWORD(wParam), + SystemMenuHintTable, + sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]), + IDS_HINT_BLANK); + } + } + break; + } + + case WM_ENTERMENULOOP: + { + Info->InMenuLoop = TRUE; + UpdateMainStatusBar(Info); + break; + } + + case WM_EXITMENULOOP: + { + Info->InMenuLoop = FALSE; + UpdateMainStatusBar(Info); + break; + } + + case WM_CLOSE: + { + DestroyWindow(hwnd); + break; + } + + case WM_ENABLE: + { + + goto HandleDefaultMessage; + } + + case WM_NCACTIVATE: + { + + goto HandleDefaultMessage; + } + + case WM_ACTIVATEAPP: + { + + goto HandleDefaultMessage; + } + + case WM_DESTROY: + { + DestroyMainWnd(Info); + + /* FIXME: set the windows position in registry*/ + //wndOldPos + + HeapFree(ProcessHeap, + 0, + Info); + SetWindowLongPtr(hwnd, + GWLP_USERDATA, + 0); + + /* Break the message queue loop */ + PostQuitMessage(0); + break; + } + + default: + { +HandleDefaultMessage: + if (Info != NULL && Info->hMdiClient != NULL) + { + Ret = DefFrameProc(hwnd, + Info->hMdiClient, + uMsg, + wParam, + lParam); + } + else + { + Ret = DefWindowProc(hwnd, + uMsg, + wParam, + lParam); + } + break; + } + } + + return Ret; +} + +MDI_EDITOR_TYPE +MainWndGetCurrentEditor(PMAIN_WND_INFO MainWnd, + PVOID *Info) +{ + MDI_EDITOR_TYPE EditorType; + + if (MainWnd->ActiveEditor != NULL) + { + EditorType = *((PMDI_EDITOR_TYPE)MainWnd->ActiveEditor); + *Info = MainWnd->ActiveEditor; + } + else + { + EditorType = metUnknown; + *Info = NULL; + } + + return EditorType; +} + +VOID +MainWndSwitchEditorContext(PMAIN_WND_INFO Info, + HWND hDeactivate, + HWND hActivate) +{ + PMDI_EDITOR_TYPE EditorType; + + /* FIXME - optimize light weight switching + when switching from and to an editor of same type */ + + if (hDeactivate != NULL) + { + EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hDeactivate, + GWLP_USERDATA); + if (EditorType != NULL) + { + switch (*EditorType) + { + case metImageEditor: + SetEditorEnvironment((PEDIT_WND_INFO)EditorType, + FALSE); + break; + + default: + break; + } + + Info->ActiveEditor = NULL; + } + } + + if (hActivate != NULL) + { + EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hActivate, + GWLP_USERDATA); + if (EditorType != NULL) + { + Info->ActiveEditor = EditorType; + + switch (*EditorType) + { + case metImageEditor: + SetEditorEnvironment((PEDIT_WND_INFO)EditorType, + TRUE); + break; + + default: + break; + } + } + } +} + +HWND +CreateMainWindow(LPCTSTR lpCaption, + int nCmdShow) +{ + PMAIN_WND_INFO Info; + HWND hMainWnd = NULL; + + Info = HeapAlloc(ProcessHeap, + 0, + sizeof(MAIN_WND_INFO)); + if (Info != NULL) + { + ZeroMemory(Info, + sizeof(MAIN_WND_INFO)); + Info->nCmdShow = nCmdShow; + + /* FIXME - load the window position from the registry */ + + hMainWnd = CreateWindowEx(WS_EX_WINDOWEDGE, + szMainWndClass, + lpCaption, + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + NULL, + NULL, + hInstance, + Info); + if (hMainWnd == NULL) + { + HeapFree(ProcessHeap, + 0, + Info); + } + } + + return hMainWnd; +} + +BOOL +MainWndTranslateMDISysAccel(HWND hwnd, + LPMSG lpMsg) +{ + PMAIN_WND_INFO Info; + + /* Get the window context */ + Info = (PMAIN_WND_INFO)GetWindowLongPtr(hwnd, + GWLP_USERDATA); + if (Info != NULL && Info->hMdiClient != NULL) + { + return TranslateMDISysAccel(Info->hMdiClient, + lpMsg); + } + + return FALSE; +} + +BOOL +InitMainWindowImpl(VOID) +{ + WNDCLASSEX wc = {0}; + + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpfnWndProc = MainWndProc; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, + MAKEINTRESOURCE(IDI_ICON)); + wc.hCursor = LoadCursor(NULL, + IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAINMENU); + wc.lpszClassName = szMainWndClass; + wc.hIconSm = (HICON)LoadImage(hInstance, + MAKEINTRESOURCE(IDI_ICON), + IMAGE_ICON, + 16, + 16, + LR_SHARED); + + return RegisterClassEx(&wc) != (ATOM)0; +} + +VOID +UninitMainWindowImpl(VOID) +{ + UnregisterClass(szMainWndClass, + hInstance); +} Added: trunk/reactos/base/applications/wordpad/manifest.xml URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/m…
============================================================================== --- trunk/reactos/base/applications/wordpad/manifest.xml (added) +++ trunk/reactos/base/applications/wordpad/manifest.xml Thu Apr 6 19:54:59 2006 @@ -1,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity + version="1.0.0.0" + processorArchitecture="X86" + name="ReactOS.VMware.SVGA.Installer" + type="win32" + /> + <description>ReactOS VMware(r) SVGA driver Installer</description> + <dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="X86" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> + </dependency> +</assembly> + +<!-- EOF --> Added: trunk/reactos/base/applications/wordpad/misc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/m…
============================================================================== --- trunk/reactos/base/applications/wordpad/misc.c (added) +++ trunk/reactos/base/applications/wordpad/misc.c Thu Apr 6 19:54:59 2006 @@ -1,0 +1,204 @@ +#include "precomp.h" + +static INT +LengthOfStrResource(IN HINSTANCE hInst, + IN UINT uID) +{ + HRSRC hrSrc; + HGLOBAL hRes; + LPWSTR lpName, lpStr; + + if (hInst == NULL) + { + return -1; + } + + /* There are always blocks of 16 strings */ + lpName = (LPWSTR)MAKEINTRESOURCE((uID >> 4) + 1); + + /* Find the string table block */ + if ((hrSrc = FindResourceW(hInst, lpName, (LPWSTR)RT_STRING)) && + (hRes = LoadResource(hInst, hrSrc)) && + (lpStr = LockResource(hRes))) + { + UINT x; + + /* Find the string we're looking for */ + uID &= 0xF; /* position in the block, same as % 16 */ + for (x = 0; x < uID; x++) + { + lpStr += (*lpStr) + 1; + } + + /* Found the string */ + return (int)(*lpStr); + } + return -1; +} + +INT +AllocAndLoadString(OUT LPTSTR *lpTarget, + IN HINSTANCE hInst, + IN UINT uID) +{ + INT ln; + + ln = LengthOfStrResource(hInst, + uID); + if (ln++ > 0) + { + (*lpTarget) = (LPWSTR)LocalAlloc(LMEM_FIXED, + ln * sizeof(TCHAR)); + if ((*lpTarget) != NULL) + { + INT Ret; + if (!(Ret = LoadString(hInst, uID, *lpTarget, ln))) + { + LocalFree((HLOCAL)(*lpTarget)); + } + return Ret; + } + } + return 0; +} + +DWORD +LoadAndFormatString(IN HINSTANCE hInstance, + IN UINT uID, + OUT LPTSTR *lpTarget, + ...) +{ + DWORD Ret = 0; + LPTSTR lpFormat; + va_list lArgs; + + if (AllocAndLoadString(&lpFormat, + hInstance, + uID) > 0) + { + va_start(lArgs, lpTarget); + /* let's use FormatMessage to format it because it has the ability to allocate + memory automatically */ + Ret = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, + lpFormat, + 0, + 0, + (LPTSTR)lpTarget, + 0, + &lArgs); + va_end(lArgs); + + LocalFree((HLOCAL)lpFormat); + } + + return Ret; +} + +BOOL +StatusBarLoadAndFormatString(IN HWND hStatusBar, + IN INT PartId, + IN HINSTANCE hInstance, + IN UINT uID, + ...) +{ + BOOL Ret = FALSE; + LPTSTR lpFormat, lpStr; + va_list lArgs; + + if (AllocAndLoadString(&lpFormat, + hInstance, + uID) > 0) + { + va_start(lArgs, uID); + /* let's use FormatMessage to format it because it has the ability to allocate + memory automatically */ + Ret = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, + lpFormat, + 0, + 0, + (LPTSTR)&lpStr, + 0, + &lArgs); + va_end(lArgs); + + if (lpStr != NULL) + { + Ret = (BOOL)SendMessage(hStatusBar, + SB_SETTEXT, + (WPARAM)PartId, + (LPARAM)lpStr); + LocalFree((HLOCAL)lpStr); + } + + LocalFree((HLOCAL)lpFormat); + } + + return Ret; +} + +BOOL +StatusBarLoadString(IN HWND hStatusBar, + IN INT PartId, + IN HINSTANCE hInstance, + IN UINT uID) +{ + BOOL Ret = FALSE; + LPTSTR lpStr; + + if (AllocAndLoadString(&lpStr, + hInstance, + uID) > 0) + { + Ret = (BOOL)SendMessage(hStatusBar, + SB_SETTEXT, + (WPARAM)PartId, + (LPARAM)lpStr); + LocalFree((HLOCAL)lpStr); + } + + return Ret; +} + + +INT +GetTextFromEdit(OUT LPTSTR lpString, + IN HWND hDlg, + IN UINT Res) +{ + INT len = GetWindowTextLength(GetDlgItem(hDlg, Res)); + if(len > 0) + { + GetDlgItemText(hDlg, + Res, + lpString, + len + 1); + } + else + lpString = NULL; + + return len; +} + + +VOID GetError(DWORD err) +{ + LPVOID lpMsgBuf; + + if (err == 0) + err = GetLastError(); + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + err, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL ); + + MessageBox(NULL, lpMsgBuf, _T("Error!"), MB_OK | MB_ICONERROR); + + LocalFree(lpMsgBuf); +} + Added: trunk/reactos/base/applications/wordpad/opensave.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/o…
============================================================================== --- trunk/reactos/base/applications/wordpad/opensave.c (added) +++ trunk/reactos/base/applications/wordpad/opensave.c Thu Apr 6 19:54:59 2006 @@ -1,0 +1,87 @@ +#include "precomp.h" + +static OPENFILENAME ofn; + +/* + * Initialize file open / save structure + */ +VOID FileInitialize(HWND hwnd) +{ + ZeroMemory(&ofn, sizeof(ofn)); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hwnd; + ofn.nMaxFile = MAX_PATH; + ofn.nMaxFileTitle = MAX_PATH; + ofn.lpstrDefExt = _T("bmp"); +} + + +static BOOL +DoWriteFile(LPCTSTR pszFileName) +{ + return TRUE; +} + + +BOOL +DoOpenFile(HWND hwnd, + LPTSTR szFileName, + LPTSTR szTitleName) +{ + DWORD err; + /*static TCHAR Filter[] = _T("All image files (*.gif,*.bmp,*.jpg,*.jpeg,*.tif,*.png)\0*.gif,*.bmp,*.jpg,*.jpeg,*.tif,*.png\0") \ + _T("All files (*.*)\0*.*\0") \ + _T("Graphics Interchange format (*gif)\0*.gif\0") \ + _T("Windows Bitmap (*bmp)\0*.bmp\0") \ + _T("JPEG File Interchange Format (*jpg,*.jpeg)\0*.jpg,*.jpeg\0") \ + _T("TAG Image File Format (*tif)\0*.tif\0") \ + _T("Portable Network Graphics (*png)\0*.png\0\0");*/ + + static TCHAR Filter[] = _T("Windows Bitmap (*.bmp)\0*.bmp\0"); + + ofn.lpstrFilter = Filter; + ofn.lpstrFile = szFileName; + ofn.lpstrFileTitle = szTitleName; + ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + + if (GetOpenFileName(&ofn)) + { + return TRUE; + } + + err = CommDlgExtendedError(); + + if (err != CDERR_GENERALCODES) + MessageBox(NULL, _T("Open file failed"), NULL, 0); + + return FALSE; +} + + + +BOOL +DoSaveFile(HWND hwnd) +{ + TCHAR szFileName[MAX_PATH] = _T(""); + static TCHAR Filter[] = _T("Graphics Interchange format (*gif)\0*.gif\0") \ + _T("Windows Bitmap (*bmp)\0*.bmp\0") \ + _T("JPEG File Interchange Format (*jpg,*.jpeg)\0*.jpg,*.jpeg\0") \ + _T("TAG Image File Format (*tif)\0*.tif\0") \ + _T("Portable Network Graphics (*png)\0*.png\0\0"); + + ofn.lpstrFilter = Filter; + ofn.lpstrFile = szFileName; + ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; + + if (GetSaveFileName(&ofn)) + { + if (DoWriteFile(szFileName)) + return TRUE; + } + + if (CommDlgExtendedError() != CDERR_GENERALCODES) + MessageBox(NULL, _T("Save to file failed"), NULL, 0); + + return FALSE; +} + Added: trunk/reactos/base/applications/wordpad/precomp.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/p…
============================================================================== --- trunk/reactos/base/applications/wordpad/precomp.h (added) +++ trunk/reactos/base/applications/wordpad/precomp.h Thu Apr 6 19:54:59 2006 @@ -1,0 +1,160 @@ +#ifndef __WORDPAD_PRECOMP_H +#define __WORDPAD_PRECOMP_H + +//#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <windowsx.h> /* GET_X/Y_LPARAM */ +#include <stdio.h> +#include <tchar.h> +#include <richedit.h> +#include <commctrl.h> +#include "resource.h" + +/* FIXME - add to headers !!! */ +#ifndef SB_SIMPLEID +#define SB_SIMPLEID 0xFF +#endif + +#define MAX_KEY_LENGTH 256 + +#define DOC_TYPE_RICH_TEXT 0 +#define DOC_TYPE_UNICODE_TEXT 1 +#define DOC_TYPE_TEXT 2 + +#ifdef _MSC_VER +#pragma warning(disable : 4100) +#endif + +/* generic definitions and forward declarations */ +struct _MAIN_WND_INFO; +struct _EDIT_WND_INFO; + +typedef enum _MDI_EDITOR_TYPE { + metUnknown = 0, + metImageEditor, +} MDI_EDITOR_TYPE, *PMDI_EDITOR_TYPE; + + +/* wordpad.c */ +extern HINSTANCE hInstance; +extern HANDLE ProcessHeap; + + +/* editwnd.c */ +typedef struct _OPEN_EDIT_INFO +{ + BOOL CreateNew; + union + { + UINT DocType; /* new */ + LPTSTR lpImagePath; /* open */ + }; + LPTSTR lpImageName; + +} OPEN_EDIT_INFO, *POPEN_EDIT_INFO; + +typedef struct _EDIT_WND_INFO +{ + MDI_EDITOR_TYPE MdiEditorType; /* Must be first member! */ + + HWND hSelf; + HWND hEdit; + struct _MAIN_WND_INFO *MainWnd; + struct _EDIT_WND_INFO *Next; + POINT ScrollPos; + USHORT Zoom; + + POPEN_EDIT_INFO OpenInfo; /* Only valid during initialization */ + + LONG Width; + LONG Height; + +} EDIT_WND_INFO, *PEDIT_WND_INFO; + +BOOL InitEditWindowImpl(VOID); +VOID UninitEditWindowImpl(VOID); +BOOL CreateEditWindow(struct _MAIN_WND_INFO *MainWnd, + POPEN_EDIT_INFO OpenInfo); +VOID SetEditorEnvironment(PEDIT_WND_INFO Info, + BOOL Setup); + + +/* mainwnd.c */ +typedef struct _MENU_HINT +{ + WORD CmdId; + UINT HintId; +} MENU_HINT, *PMENU_HINT; + +typedef struct _MAIN_WND_INFO +{ + HWND hSelf; + HWND hMdiClient; + HWND hStatus; + int nCmdShow; + + /* Editors */ + PEDIT_WND_INFO ImageEditors; + UINT ImagesCreated; + PVOID ActiveEditor; + + /* status flags */ + BOOL InMenuLoop : 1; +} MAIN_WND_INFO, *PMAIN_WND_INFO; + +BOOL InitMainWindowImpl(VOID); +VOID UninitMainWindowImpl(VOID); +HWND CreateMainWindow(LPCTSTR lpCaption, + int nCmdShow); +BOOL MainWndTranslateMDISysAccel(HWND hwnd, + LPMSG lpMsg); +VOID MainWndSwitchEditorContext(PMAIN_WND_INFO Info, + HWND hDeactivate, + HWND hActivate); +MDI_EDITOR_TYPE MainWndGetCurrentEditor(PMAIN_WND_INFO MainWnd, + PVOID *Info); + + + +/* misc.c */ +INT AllocAndLoadString(OUT LPTSTR *lpTarget, + IN HINSTANCE hInst, + IN UINT uID); + +DWORD LoadAndFormatString(IN HINSTANCE hInstance, + IN UINT uID, + OUT LPTSTR *lpTarget, + ...); + +BOOL StatusBarLoadAndFormatString(IN HWND hStatusBar, + IN INT PartId, + IN HINSTANCE hInstance, + IN UINT uID, + ...); + +BOOL StatusBarLoadString(IN HWND hStatusBar, + IN INT PartId, + IN HINSTANCE hInstance, + IN UINT uID); + +INT GetTextFromEdit(OUT LPTSTR lpString, + IN HWND hDlg, + IN UINT Res); + +VOID GetError(DWORD err); + + +/* opensave.c */ +VOID FileInitialize(HWND hwnd); +BOOL DoOpenFile(HWND hwnd, LPTSTR lpFileName, LPTSTR lpName); +BOOL DoSaveFile(HWND hwnd); + +/* about.c */ +INT_PTR CALLBACK +AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + +INT_PTR CALLBACK +NewDocSelDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + + +#endif /* __WORDPAD_PRECOMP_H */ Added: trunk/reactos/base/applications/wordpad/res/toolbar.bmp URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/r…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/wordpad/res/toolbar.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/wordpad/res/wordpad.ico URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/r…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/wordpad/res/wordpad.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: trunk/reactos/base/applications/wordpad/resource.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/r…
============================================================================== --- trunk/reactos/base/applications/wordpad/resource.h (added) +++ trunk/reactos/base/applications/wordpad/resource.h Thu Apr 6 19:54:59 2006 @@ -1,0 +1,102 @@ +#define IDC_STATIC -1 + +#define IDI_ICON 50 + +#define IDS_APPNAME 101 +#define IDS_VERSION 102 +#define IDS_LICENSE 103 +#define IDS_DEFAULT_NAME 104 +#define IDS_READY 105 + +#define IDC_STATUSBAR 500 + +#define ID_NEW 2000 +#define ID_OPEN 2001 +#define ID_CLOSE 2002 +#define ID_CLOSEALL 2003 +#define ID_SAVE 2004 +#define ID_SAVEAS 2005 +#define ID_PRINTPRE 2006 +#define ID_PRINT 2007 +#define ID_PAGESETUP 2008 +#define ID_CUT 2009 +#define ID_COPY 2010 +#define ID_PASTE 2011 +#define ID_UNDO 2013 +#define ID_REDO 2014 +#define ID_SELALL 2015 +#define ID_EXIT 2016 +#define ID_STATUSBAR 2019 +#define ID_BOLD 2030 +#define ID_ITALIC 2031 +#define ID_ULINE 2032 +#define ID_TXTLEFT 2033 +#define ID_TXTCENTER 2034 +#define ID_TXTRIGHT 2035 +#define ID_BLANK 2036 + +#define ID_REFRESH 3000 +#define ID_HELP 3001 +#define ID_WINDOW_TILE_HORZ 3002 +#define ID_WINDOW_TILE_VERT 3003 +#define ID_WINDOW_CASCADE 3004 +#define ID_WINDOW_NEXT 3005 +#define ID_WINDOW_ARRANGE 3006 + + +/* menu hints */ +#define IDS_HINT_BLANK 20000 +#define IDS_HINT_NEW 20001 +#define IDS_HINT_OPEN 20002 +#define IDS_HINT_CLOSE 21006 +#define IDS_HINT_CLOSEALL 21007 +#define IDS_HINT_SAVE 20003 +#define IDS_HINT_SAVEAS 20004 +#define IDS_HINT_PRINT 20005 +#define IDS_HINT_PRINTPRE 20006 +#define IDS_HINT_PAGESETUP 20007 +#define IDS_HINT_EXIT 20008 + +#define IDS_HINT_CASCADE 21009 +#define IDS_HINT_TILE_HORZ 21010 +#define IDS_HINT_TILE_VERT 21011 +#define IDS_HINT_ARRANGE 21012 +#define IDS_HINT_NEXT 21013 + +/* system menu hints */ +#define IDS_HINT_SYS_RESTORE 21001 +#define IDS_HINT_SYS_MOVE 21002 +#define IDS_HINT_SYS_SIZE 21003 +#define IDS_HINT_SYS_MINIMIZE 21004 +#define IDS_HINT_SYS_MAXIMIZE 21005 +#define IDS_HINT_SYS_CLOSE 21006 + +/* tooltips */ +#define IDS_TOOLTIP_NEW 6000 +#define IDS_TOOLTIP_OPEN 6001 +#define IDS_TOOLTIP_SAVE 6002 +#define IDS_TOOLTIP_PRINTPRE 6003 +#define IDS_TOOLTIP_PRINT 6004 +#define IDS_TOOLTIP_CUT 6005 +#define IDS_TOOLTIP_COPY 6006 +#define IDS_TOOLTIP_PASTE 6007 +#define IDS_TOOLTIP_UNDO 6008 +#define IDS_TOOLTIP_REDO 6009 + + +/* about box info */ +#define IDD_ABOUTBOX 200 +#define IDC_LICENSE_EDIT 201 + +/* new doc type */ +#define IDD_NEWDOCSEL 220 +#define IDC_LIST 221 +#define IDS_DOC_TYPE_RICH_TEXT 230 +#define IDS_DOC_TYPE_UNICODE_TEXT 231 +#define IDS_DOC_TYPE_TEXT 232 + + +/* Menu */ +#define IDR_MAINMENU 102 +#define IDR_POPUP 103 +#define ID_ABOUT 4031 Added: trunk/reactos/base/applications/wordpad/wordpad.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/w…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.c (added) +++ trunk/reactos/base/applications/wordpad/wordpad.c Thu Apr 6 19:54:59 2006 @@ -1,0 +1,84 @@ +#include "precomp.h" + +HINSTANCE hInstance; +HANDLE ProcessHeap; + +int WINAPI +WinMain(HINSTANCE hThisInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + LPTSTR lpAppName, lpVersion, lpTitle; + HWND hMainWnd; + MSG Msg; + BOOL bRet; + int Ret = 1; + size_t len; + INITCOMMONCONTROLSEX icex; + + hInstance = hThisInstance; + ProcessHeap = GetProcessHeap(); + + icex.dwSize = sizeof(INITCOMMONCONTROLSEX); + icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES; + InitCommonControlsEx(&icex); + + if (!AllocAndLoadString(&lpAppName, hInstance, IDS_APPNAME) || + !AllocAndLoadString(&lpVersion, hInstance, IDS_VERSION) ) + { + MessageBox(NULL, + _T("Error loading resource "), + NULL, + 0); + return 1; + } + + len = _tcslen(lpAppName) + _tcslen(lpVersion); + lpTitle = HeapAlloc(ProcessHeap, + 0, + (len + 2) * sizeof(TCHAR)); + + wsprintf(lpTitle, + _T("%s %s"), + lpAppName, + lpVersion); + + if (InitMainWindowImpl()) + { + if (InitEditWindowImpl()) + { + hMainWnd = CreateMainWindow(lpTitle, + nCmdShow); + if (hMainWnd != NULL) + { + /* pump the message queue */ + while((bRet = GetMessage(&Msg, + NULL, + 0, + 0) != 0)) + { + if (bRet != (BOOL)-1) + { + if (!MainWndTranslateMDISysAccel(hMainWnd, + &Msg)) + { + TranslateMessage(&Msg); + DispatchMessage(&Msg); + } + } + } + + Ret = 0; + } + + UninitEditWindowImpl(); + } + + UninitMainWindowImpl(); + } + + LocalFree((HLOCAL)lpAppName); + + return Ret; +} Added: trunk/reactos/base/applications/wordpad/wordpad.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/w…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.rbuild (added) +++ trunk/reactos/base/applications/wordpad/wordpad.rbuild Thu Apr 6 19:54:59 2006 @@ -1,0 +1,28 @@ +<?xml version="1.0"?> +<rbuild xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <module name="wordpad" type="win32gui" installbase="system32" installname="wordpad.exe"> + <include base="wordpad">.</include> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x0600</define> + <define name="_WIN32_WINNT">0x0501</define> + <library>kernel32</library> + <library>user32</library> + <library>gdi32</library> + <library>comdlg32</library> + <library>advapi32</library> + <library>shell32</library> + <library>comctl32</library> + <compilationunit name="unit.c"> + <file>dialogs.c</file> + <file>editwnd.c</file> + <file>mainwnd.c</file> + <file>misc.c</file> + <file>opensave.c</file> + <file>wordpad.c</file> + </compilationunit> + <file>wordpad.rc</file> + <pch>precomp.h</pch> + </module> +</rbuild> Added: trunk/reactos/base/applications/wordpad/wordpad.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/wordpad/w…
============================================================================== --- trunk/reactos/base/applications/wordpad/wordpad.rc (added) +++ trunk/reactos/base/applications/wordpad/wordpad.rc Thu Apr 6 19:54:59 2006 @@ -1,0 +1,26 @@ +#include <windows.h> +#include <commctrl.h> +#include "resource.h" + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Document Editor\0" +#define REACTOS_STR_INTERNAL_NAME "wordpad\0" +#define REACTOS_STR_ORIGINAL_FILENAME "wordpad.exe\0" +//#include <reactos/version.rc> + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +1 24 DISCARDABLE "manifest.xml" + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPNAME "WordPad" + IDS_VERSION "v0.1" +END + +IDI_ICON ICON "res/wordpad.ico" + +/* main toolbar icons */ +IDB_TEXTTOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp" + +#include "En.rc" +/* please do not add any other languages whilst this is being developed */
18 years, 8 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
32
33
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Results per page:
10
25
50
100
200