ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
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
June 2023
----- 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
20 participants
155 discussions
Start a n
N
ew thread
[reactos] 02/03: [FRAMEBUF_NEW] Remove the driver
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cdb130420ef0629ffca7a…
commit cdb130420ef0629ffca7abe116681e0c5004068b Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Mon Jun 19 13:56:50 2023 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Mon Jun 19 13:58:46 2023 +0300 [FRAMEBUF_NEW] Remove the driver It doesn't seem to be better than the current "framebuf", and has an unfriendly license (NT4 DDK Sample). --- .../drivers/displays/framebuf_new/CMakeLists.txt | 19 - win32ss/drivers/displays/framebuf_new/debug.c | 59 -- win32ss/drivers/displays/framebuf_new/debug.h | 26 - win32ss/drivers/displays/framebuf_new/driver.h | 79 --- win32ss/drivers/displays/framebuf_new/enable.c | 476 ---------------- win32ss/drivers/displays/framebuf_new/framebuf.rc | 5 - win32ss/drivers/displays/framebuf_new/palette.c | 332 ----------- win32ss/drivers/displays/framebuf_new/pointer.c | 455 ---------------- win32ss/drivers/displays/framebuf_new/screen.c | 605 --------------------- 9 files changed, 2056 deletions(-) diff --git a/win32ss/drivers/displays/framebuf_new/CMakeLists.txt b/win32ss/drivers/displays/framebuf_new/CMakeLists.txt deleted file mode 100644 index a41e8df5692..00000000000 --- a/win32ss/drivers/displays/framebuf_new/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -list(APPEND SOURCE - debug.c - enable.c - palette.c - pointer.c - screen.c - driver.h) - -add_library(framebuf MODULE - ${SOURCE} - framebuf.rc) - -set_module_type(framebuf kerneldll ENTRYPOINT DrvEnableDriver 12) -target_link_libraries(framebuf libcntpr) -add_importlibs(framebuf win32k) -add_pch(framebuf driver.h SOURCE) -add_dependencies(framebuf psdk) -add_cd_file(TARGET framebuf DESTINATION reactos/system32 FOR all) diff --git a/win32ss/drivers/displays/framebuf_new/debug.c b/win32ss/drivers/displays/framebuf_new/debug.c deleted file mode 100644 index e5d1186f5c3..00000000000 --- a/win32ss/drivers/displays/framebuf_new/debug.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * PROJECT: ReactOS Framebuffer Display Driver - * LICENSE: Microsoft NT4 DDK Sample Code License - * FILE: win32ss/drivers/displays/framebuf_new/debug.c - * PURPOSE: Debug Support - * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation - */ - -#include "driver.h" - -#if DBG - -ULONG DebugLevel = 0; - -/***************************************************************************** - * - * Routine Description: - * - * This function is variable-argument, level-sensitive debug print - * routine. - * If the specified debug level for the print statement is lower or equal - * to the current debug level, the message will be printed. - * - * Arguments: - * - * DebugPrintLevel - Specifies at which debugging level the string should - * be printed - * - * DebugMessage - Variable argument ascii c string - * - * Return Value: - * - * None. - * - ***************************************************************************/ - -VOID -DebugPrint( - ULONG DebugPrintLevel, - PCHAR DebugMessage, - ... - ) - -{ - - va_list ap; - - va_start(ap, DebugMessage); - - if (DebugPrintLevel <= DebugLevel) - { - EngDebugPrint(STANDARD_DEBUG_PREFIX, DebugMessage, ap); - } - - va_end(ap); - -} - -#endif diff --git a/win32ss/drivers/displays/framebuf_new/debug.h b/win32ss/drivers/displays/framebuf_new/debug.h deleted file mode 100644 index d672f73b489..00000000000 --- a/win32ss/drivers/displays/framebuf_new/debug.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * PROJECT: ReactOS Framebuffer Display Driver - * LICENSE: Microsoft NT4 DDK Sample Code License - * FILE: win32ss/drivers/displays/framebuf_new/debug.h - * PURPOSE: Debug Support Header - * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation - */ - -#if DBG - -VOID -DebugPrint( - ULONG DebugPrintLevel, - PCHAR DebugMessage, - ... - ); - -#define DISPDBG(arg) DebugPrint arg -#define RIP(x) { DebugPrint(0, x); EngDebugBreak();} - -#else - -#define DISPDBG(arg) -#define RIP(x) - -#endif diff --git a/win32ss/drivers/displays/framebuf_new/driver.h b/win32ss/drivers/displays/framebuf_new/driver.h deleted file mode 100644 index 3074346449f..00000000000 --- a/win32ss/drivers/displays/framebuf_new/driver.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * PROJECT: ReactOS Framebuffer Display Driver - * LICENSE: Microsoft NT4 DDK Sample Code License - * FILE: win32ss/drivers/displays/framebuf_new/driver.h - * PURPOSE: Main Driver Header File - * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation - * ReactOS Portable Systems Group - */ - -#ifndef _FRAMEBUF_NEW_PCH_ -#define _FRAMEBUF_NEW_PCH_ - -//#define DBG 1 -#include <stdarg.h> -#include <windef.h> -#include <wingdi.h> -#include <winddi.h> -#include <devioctl.h> -#include <ntddvdeo.h> -#include "debug.h" - -typedef struct _PDEV -{ - HANDLE hDriver; // Handle to \Device\Screen - HDEV hdevEng; // Engine's handle to PDEV - HSURF hsurfEng; // Engine's handle to surface - HPALETTE hpalDefault; // Handle to the default palette for device. - PBYTE pjScreen; // This is pointer to base screen address - ULONG cxScreen; // Visible screen width - ULONG cyScreen; // Visible screen height - ULONG ulMode; // Mode the mini-port driver is in. - LONG lDeltaScreen; // Distance from one scan to the next. - ULONG cScreenSize; // size of video memory, including - // offscreen memory. - PVOID pOffscreenList; // linked list of DCI offscreen surfaces. - FLONG flRed; // For bitfields device, Red Mask - FLONG flGreen; // For bitfields device, Green Mask - FLONG flBlue; // For bitfields device, Blue Mask - ULONG cPaletteShift; // number of bits the 8-8-8 palette must - // be shifted by to fit in the hardware - // palette. - ULONG ulBitCount; // # of bits per pel 8,16,24,32 are only supported. - POINTL ptlHotSpot; // adjustment for pointer hot spot - VIDEO_POINTER_CAPABILITIES PointerCapabilities; // HW pointer abilities - PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // hardware pointer attributes - DWORD cjPointerAttributes; // Size of buffer allocated - BOOL fHwCursorActive; // Are we currently using the hw cursor - PALETTEENTRY *pPal; // If this is pal managed, this is the pal - BOOL bSupportDCI; // Does the miniport support DCI? -// eVb: 3.1 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping - LONG flHooks; -// eVb: 3.1 [END] -} PDEV, *PPDEV; - -DWORD NTAPI getAvailableModes(HANDLE, PVIDEO_MODE_INFORMATION *, DWORD *); -BOOL NTAPI bInitPDEV(PPDEV, PDEVMODEW, GDIINFO *, DEVINFO *); -BOOL NTAPI bInitSURF(PPDEV, BOOL); -BOOL NTAPI bInitPaletteInfo(PPDEV, DEVINFO *); -BOOL NTAPI bInitPointer(PPDEV, DEVINFO *); -BOOL NTAPI bInit256ColorPalette(PPDEV); -VOID NTAPI vDisablePalette(PPDEV); -VOID NTAPI vDisableSURF(PPDEV); - -#define MAX_CLUT_SIZE (sizeof(VIDEO_CLUT) + (sizeof(ULONG) * 256)) - -// -// Determines the size of the DriverExtra information in the DEVMODE -// structure passed to and from the display driver. -// - -#define DRIVER_EXTRA_SIZE 0 - -#define DLL_NAME L"framebuf" // Name of the DLL in UNICODE -#define STANDARD_DEBUG_PREFIX "FRAMEBUF: " // All debug output is prefixed -#define ALLOC_TAG 'bfDD' // Four byte tag (characters in - // reverse order) used for memory - // allocations - -#endif /* _FRAMEBUF_NEW_PCH_ */ diff --git a/win32ss/drivers/displays/framebuf_new/enable.c b/win32ss/drivers/displays/framebuf_new/enable.c deleted file mode 100644 index 5b668f67288..00000000000 --- a/win32ss/drivers/displays/framebuf_new/enable.c +++ /dev/null @@ -1,476 +0,0 @@ -/* - * PROJECT: ReactOS Framebuffer Display Driver - * LICENSE: Microsoft NT4 DDK Sample Code License - * FILE: win32ss/drivers/displays/framebuf_new/enable.c - * PURPOSE: Main Driver Initialization and PDEV Enabling - * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation - * ReactOS Portable Systems Group - */ - -#include "driver.h" - -// The driver function table with all function index/address pairs - -static DRVFN gadrvfn[] = -{ - { INDEX_DrvEnablePDEV, (PFN) DrvEnablePDEV }, - { INDEX_DrvCompletePDEV, (PFN) DrvCompletePDEV }, - { INDEX_DrvDisablePDEV, (PFN) DrvDisablePDEV }, - { INDEX_DrvEnableSurface, (PFN) DrvEnableSurface }, - { INDEX_DrvDisableSurface, (PFN) DrvDisableSurface }, - { INDEX_DrvAssertMode, (PFN) DrvAssertMode }, - { INDEX_DrvSetPalette, (PFN) DrvSetPalette }, - { INDEX_DrvMovePointer, (PFN) DrvMovePointer }, - { INDEX_DrvSetPointerShape, (PFN) DrvSetPointerShape }, - { INDEX_DrvGetModes, (PFN) DrvGetModes } -}; - -// Define the functions you want to hook for 8/16/24/32 pel formats - -#define HOOKS_BMF8BPP 0 - -#define HOOKS_BMF16BPP 0 - -#define HOOKS_BMF24BPP 0 - -#define HOOKS_BMF32BPP 0 - -/******************************Public*Routine******************************\ -* DrvEnableDriver -* -* Enables the driver by retrieving the drivers function table and version. -* -\**************************************************************************/ - -BOOL NTAPI DrvEnableDriver( -ULONG iEngineVersion, -ULONG cj, -PDRVENABLEDATA pded) -{ -// Engine Version is passed down so future drivers can support previous -// engine versions. A next generation driver can support both the old -// and new engine conventions if told what version of engine it is -// working with. For the first version the driver does nothing with it. -// eVb: 1.1 [DDK Change] - Remove bogus statement - //iEngineVersion; -// eVb: 1.1 [END] -// Fill in as much as we can. - - if (cj >= sizeof(DRVENABLEDATA)) - pded->pdrvfn = gadrvfn; - - if (cj >= (sizeof(ULONG) * 2)) - pded->c = sizeof(gadrvfn) / sizeof(DRVFN); - -// DDI version this driver was targeted for is passed back to engine. -// Future graphic's engine may break calls down to old driver format. - - if (cj >= sizeof(ULONG)) -// eVb: 1.2 [DDK Change] - Use DDI_DRIVER_VERSION_NT4 instead of DDI_DRIVER_VERSION - pded->iDriverVersion = DDI_DRIVER_VERSION_NT4; -// eVb: 1.2 [END] - - return TRUE; -} - -/******************************Public*Routine******************************\ -* DrvEnablePDEV -* -* DDI function, Enables the Physical Device. -* -* Return Value: device handle to pdev. -* -\**************************************************************************/ - -DHPDEV NTAPI DrvEnablePDEV( -DEVMODEW *pDevmode, // Pointer to DEVMODE -PWSTR pwszLogAddress, // Logical address -ULONG cPatterns, // number of patterns -HSURF *ahsurfPatterns, // return standard patterns -ULONG cjGdiInfo, // Length of memory pointed to by pGdiInfo -ULONG *pGdiInfo, // Pointer to GdiInfo structure -ULONG cjDevInfo, // Length of following PDEVINFO structure -DEVINFO *pDevInfo, // physical device information structure -HDEV hdev, // HDEV, used for callbacks -PWSTR pwszDeviceName, // DeviceName - not used -HANDLE hDriver) // Handle to base driver -{ - GDIINFO GdiInfo; - DEVINFO DevInfo; - PPDEV ppdev = NULL; - - UNREFERENCED_PARAMETER(pwszLogAddress); - UNREFERENCED_PARAMETER(pwszDeviceName); - - // Allocate a physical device structure. - - ppdev = (PPDEV) EngAllocMem(0, sizeof(PDEV), ALLOC_TAG); - - if (ppdev == NULL) - { - RIP("DISP DrvEnablePDEV failed EngAllocMem\n"); - return NULL; - } - - memset(ppdev, 0, sizeof(PDEV)); - - // Save the screen handle in the PDEV. - - ppdev->hDriver = hDriver; - - // Get the current screen mode information. Set up device caps and devinfo. - - if (!bInitPDEV(ppdev, pDevmode, &GdiInfo, &DevInfo)) - { - DISPDBG((0,"DISP DrvEnablePDEV failed\n")); - goto error_free; - } - - // Initialize the cursor information. - - if (!bInitPointer(ppdev, &DevInfo)) - { - // Not a fatal error... - DISPDBG((0, "DrvEnablePDEV failed bInitPointer\n")); - } - - // Initialize palette information. - - if (!bInitPaletteInfo(ppdev, &DevInfo)) - { - RIP("DrvEnablePDEV failed bInitPalette\n"); - goto error_free; - } - - // Copy the devinfo into the engine buffer. - - memcpy(pDevInfo, &DevInfo, min(sizeof(DEVINFO), cjDevInfo)); - - // Set the pdevCaps with GdiInfo we have prepared to the list of caps for this - // pdev. - - memcpy(pGdiInfo, &GdiInfo, min(cjGdiInfo, sizeof(GDIINFO))); - - return (DHPDEV)ppdev; - - // Error case for failure. -error_free: - EngFreeMem(ppdev); - return NULL; -} - -/******************************Public*Routine******************************\ -* DrvCompletePDEV -* -* Store the HPDEV, the engines handle for this PDEV, in the DHPDEV. -* -\**************************************************************************/ - -VOID NTAPI DrvCompletePDEV( -DHPDEV dhpdev, -HDEV hdev) -{ - ((PPDEV) dhpdev)->hdevEng = hdev; -} - -/******************************Public*Routine******************************\ -* DrvDisablePDEV -* -* Release the resources allocated in DrvEnablePDEV. If a surface has been -* enabled DrvDisableSurface will have already been called. -* -\**************************************************************************/ - -VOID NTAPI DrvDisablePDEV( -DHPDEV dhpdev) -{ - vDisablePalette((PPDEV) dhpdev); - EngFreeMem(dhpdev); -} - -/******************************Public*Routine******************************\ -* DrvEnableSurface -* -* Enable the surface for the device. Hook the calls this driver supports. -* -* Return: Handle to the surface if successful, 0 for failure. -* -\**************************************************************************/ - -HSURF NTAPI DrvEnableSurface( -DHPDEV dhpdev) -{ - PPDEV ppdev; - HSURF hsurf; - SIZEL sizl; - ULONG ulBitmapType; - FLONG flHooks; - - // Create engine bitmap around frame buffer. - - ppdev = (PPDEV) dhpdev; - - if (!bInitSURF(ppdev, TRUE)) - { - RIP("DISP DrvEnableSurface failed bInitSURF\n"); - return NULL; - } - - sizl.cx = ppdev->cxScreen; - sizl.cy = ppdev->cyScreen; - - if (ppdev->ulBitCount == 8) - { - if (!bInit256ColorPalette(ppdev)) { - RIP("DISP DrvEnableSurface failed to init the 8bpp palette\n"); - return NULL; - } - ulBitmapType = BMF_8BPP; - flHooks = HOOKS_BMF8BPP; - } - else if (ppdev->ulBitCount == 16) - { - ulBitmapType = BMF_16BPP; - flHooks = HOOKS_BMF16BPP; - } - else if (ppdev->ulBitCount == 24) - { - ulBitmapType = BMF_24BPP; - flHooks = HOOKS_BMF24BPP; - } - else - { - ulBitmapType = BMF_32BPP; - flHooks = HOOKS_BMF32BPP; - } -// eVb: 1.3 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping - ppdev->flHooks = flHooks; -// eVb: 1.3 [END] -// eVb: 1.4 [DDK Change] - Use EngCreateDeviceSurface instead of EngCreateBitmap - hsurf = (HSURF)EngCreateDeviceSurface((DHSURF)ppdev, - sizl, - ulBitmapType); - - if (hsurf == NULL) - { - RIP("DISP DrvEnableSurface failed EngCreateDeviceSurface\n"); - return NULL; - } -// eVb: 1.4 [END] - -// eVb: 1.5 [DDK Change] - Use EngModifySurface instead of EngAssociateSurface - if ( !EngModifySurface(hsurf, - ppdev->hdevEng, - ppdev->flHooks | HOOK_SYNCHRONIZE, - MS_NOTSYSTEMMEMORY, - (DHSURF)ppdev, - ppdev->pjScreen, - ppdev->lDeltaScreen, - NULL)) - { - RIP("DISP DrvEnableSurface failed EngModifySurface\n"); - return NULL; - } -// eVb: 1.5 [END] - ppdev->hsurfEng = hsurf; - - return hsurf; -} - -/******************************Public*Routine******************************\ -* DrvDisableSurface -* -* Free resources allocated by DrvEnableSurface. Release the surface. -* -\**************************************************************************/ - -VOID NTAPI DrvDisableSurface( -DHPDEV dhpdev) -{ - EngDeleteSurface(((PPDEV) dhpdev)->hsurfEng); - vDisableSURF((PPDEV) dhpdev); - ((PPDEV) dhpdev)->hsurfEng = NULL; -} - -/******************************Public*Routine******************************\ -* DrvAssertMode -* -* This asks the device to reset itself to the mode of the pdev passed in. -* -\**************************************************************************/ - -BOOL NTAPI DrvAssertMode( -DHPDEV dhpdev, -BOOL bEnable) -{ - PPDEV ppdev = (PPDEV) dhpdev; - ULONG ulReturn; - PBYTE pjScreen; - - if (bEnable) - { - // - // The screen must be reenabled, reinitialize the device to clean state. - // -// eVb: 1.6 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping - pjScreen = ppdev->pjScreen; - - if (!bInitSURF(ppdev, FALSE)) - { - DISPDBG((0, "DISP DrvAssertMode failed bInitSURF\n")); - return FALSE; - } - - if (pjScreen != ppdev->pjScreen) { - - if ( !EngModifySurface(ppdev->hsurfEng, - ppdev->hdevEng, - ppdev->flHooks | HOOK_SYNCHRONIZE, - MS_NOTSYSTEMMEMORY, - (DHSURF)ppdev, - ppdev->pjScreen, - ppdev->lDeltaScreen, - NULL)) - { - DISPDBG((0, "DISP DrvAssertMode failed EngModifySurface\n")); - return FALSE; - } - } -// eVb: 1.6 [END] - return TRUE; - } - else - { - // - // We must give up the display. - // Call the kernel driver to reset the device to a known state. - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_RESET_DEVICE, - NULL, - 0, - NULL, - 0, - &ulReturn)) - { - RIP("DISP DrvAssertMode failed IOCTL"); - return FALSE; - } - else - { - return TRUE; - } - } -} - -/******************************Public*Routine******************************\ -* DrvGetModes -* -* Returns the list of available modes for the device. -* -\**************************************************************************/ - -ULONG NTAPI DrvGetModes( -HANDLE hDriver, -ULONG cjSize, -DEVMODEW *pdm) - -{ - - DWORD cModes; - DWORD cbOutputSize; - PVIDEO_MODE_INFORMATION pVideoModeInformation, pVideoTemp; - DWORD cOutputModes = cjSize / (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE); - DWORD cbModeSize; - - DISPDBG((3, "DrvGetModes\n")); - - cModes = getAvailableModes(hDriver, - (PVIDEO_MODE_INFORMATION *) &pVideoModeInformation, - &cbModeSize); - - if (cModes == 0) - { - DISPDBG((0, "DrvGetModes failed to get mode information")); - return 0; - } - - if (pdm == NULL) - { - cbOutputSize = cModes * (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE); - } - else - { - // - // Now copy the information for the supported modes back into the output - // buffer - // - - cbOutputSize = 0; - - pVideoTemp = pVideoModeInformation; - - do - { - if (pVideoTemp->Length != 0) - { - if (cOutputModes == 0) - { - break; - } - - // - // Zero the entire structure to start off with. - // - - memset(pdm, 0, sizeof(DEVMODEW)); - - // - // Set the name of the device to the name of the DLL. - // - - memcpy(pdm->dmDeviceName, DLL_NAME, sizeof(DLL_NAME)); - - pdm->dmSpecVersion = DM_SPECVERSION; - pdm->dmDriverVersion = DM_SPECVERSION; - pdm->dmSize = sizeof(DEVMODEW); - pdm->dmDriverExtra = DRIVER_EXTRA_SIZE; - - pdm->dmBitsPerPel = pVideoTemp->NumberOfPlanes * - pVideoTemp->BitsPerPlane; - pdm->dmPelsWidth = pVideoTemp->VisScreenWidth; - pdm->dmPelsHeight = pVideoTemp->VisScreenHeight; - pdm->dmDisplayFrequency = pVideoTemp->Frequency; - pdm->dmDisplayFlags = 0; - - pdm->dmFields = DM_BITSPERPEL | - DM_PELSWIDTH | - DM_PELSHEIGHT | - DM_DISPLAYFREQUENCY | - DM_DISPLAYFLAGS ; - - // - // Go to the next DEVMODE entry in the buffer. - // - - cOutputModes--; - - pdm = (LPDEVMODEW) ( ((ULONG_PTR)pdm) + sizeof(DEVMODEW) + - DRIVER_EXTRA_SIZE); - - cbOutputSize += (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE); - - } - - pVideoTemp = (PVIDEO_MODE_INFORMATION) - (((PUCHAR)pVideoTemp) + cbModeSize); - - } while (--cModes); - } - - EngFreeMem(pVideoModeInformation); - - return cbOutputSize; - -} diff --git a/win32ss/drivers/displays/framebuf_new/framebuf.rc b/win32ss/drivers/displays/framebuf_new/framebuf.rc deleted file mode 100644 index c8860569766..00000000000 --- a/win32ss/drivers/displays/framebuf_new/framebuf.rc +++ /dev/null @@ -1,5 +0,0 @@ -#define REACTOS_VERSION_DLL -#define REACTOS_STR_FILE_DESCRIPTION "Framebuffer Display Driver" -#define REACTOS_STR_INTERNAL_NAME "framebuf" -#define REACTOS_STR_ORIGINAL_FILENAME "framebuf.dll" -#include <reactos/version.rc> diff --git a/win32ss/drivers/displays/framebuf_new/palette.c b/win32ss/drivers/displays/framebuf_new/palette.c deleted file mode 100644 index dc16a1576eb..00000000000 --- a/win32ss/drivers/displays/framebuf_new/palette.c +++ /dev/null @@ -1,332 +0,0 @@ -/* - * PROJECT: ReactOS Framebuffer Display Driver - * LICENSE: Microsoft NT4 DDK Sample Code License - * FILE: win32ss/drivers/displays/framebuf_new/palette.c - * PURPOSE: Palette Support - * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation - */ - -#include "driver.h" - -// Global Table defining the 20 Window Default Colors. For 256 color -// palettes the first 10 must be put at the beginning of the palette -// and the last 10 at the end of the palette. - -const PALETTEENTRY BASEPALETTE[20] = -{ - { 0, 0, 0, 0 }, // 0 - { 0x80,0, 0, 0 }, // 1 - { 0, 0x80,0, 0 }, // 2 - { 0x80,0x80,0, 0 }, // 3 - { 0, 0, 0x80,0 }, // 4 - { 0x80,0, 0x80,0 }, // 5 - { 0, 0x80,0x80,0 }, // 6 - { 0xC0,0xC0,0xC0,0 }, // 7 - { 192, 220, 192, 0 }, // 8 - { 166, 202, 240, 0 }, // 9 - { 255, 251, 240, 0 }, // 10 - { 160, 160, 164, 0 }, // 11 - { 0x80,0x80,0x80,0 }, // 12 - { 0xFF,0, 0 ,0 }, // 13 - { 0, 0xFF,0 ,0 }, // 14 - { 0xFF,0xFF,0 ,0 }, // 15 - { 0 ,0, 0xFF,0 }, // 16 - { 0xFF,0, 0xFF,0 }, // 17 - { 0, 0xFF,0xFF,0 }, // 18 - { 0xFF,0xFF,0xFF,0 }, // 19 -}; - -BOOL NTAPI bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo); - -/******************************Public*Routine******************************\ -* bInitPaletteInfo -* -* Initializes the palette information for this PDEV. -* -* Called by DrvEnablePDEV. -* -\**************************************************************************/ - -BOOL NTAPI bInitPaletteInfo(PPDEV ppdev, DEVINFO *pDevInfo) -{ - if (!bInitDefaultPalette(ppdev, pDevInfo)) - return(FALSE); - - return(TRUE); -} - -/******************************Public*Routine******************************\ -* vDisablePalette -* -* Frees resources allocated by bInitPaletteInfo. -* -\**************************************************************************/ - -VOID NTAPI vDisablePalette(PPDEV ppdev) -{ -// Delete the default palette if we created one. - - if (ppdev->hpalDefault) - { - EngDeletePalette(ppdev->hpalDefault); - ppdev->hpalDefault = NULL; - } - - if (ppdev->pPal != NULL) - EngFreeMem((PVOID)ppdev->pPal); -} - -/******************************Public*Routine******************************\ -* bInitDefaultPalette -* -* Initializes default palette for PDEV. -* -\**************************************************************************/ - -BOOL NTAPI bInitDefaultPalette(PPDEV ppdev, DEVINFO *pDevInfo) -{ - if (ppdev->ulBitCount == 8) - { - ULONG ulLoop; - BYTE jRed,jGre,jBlu; - - // - // Allocate our palette - // - - ppdev->pPal = (PPALETTEENTRY)EngAllocMem(0, sizeof(PALETTEENTRY) * 256, - ALLOC_TAG); - - if ((ppdev->pPal) == NULL) { - RIP("DISP bInitDefaultPalette() failed EngAllocMem\n"); - return(FALSE); - } - - // - // Generate 256 (8*4*4) RGB combinations to fill the palette - // - - jRed = jGre = jBlu = 0; - - for (ulLoop = 0; ulLoop < 256; ulLoop++) - { - ppdev->pPal[ulLoop].peRed = jRed; - ppdev->pPal[ulLoop].peGreen = jGre; - ppdev->pPal[ulLoop].peBlue = jBlu; - ppdev->pPal[ulLoop].peFlags = (BYTE)0; - - if (!(jRed += 32)) - if (!(jGre += 32)) - jBlu += 64; - } - - // - // Fill in Windows Reserved Colors from the WIN 3.0 DDK - // The Window Manager reserved the first and last 10 colors for - // painting windows borders and for non-palette managed applications. - // - - for (ulLoop = 0; ulLoop < 10; ulLoop++) - { - // - // First 10 - // - - ppdev->pPal[ulLoop] = BASEPALETTE[ulLoop]; - - // - // Last 10 - // - - ppdev->pPal[246 + ulLoop] = BASEPALETTE[ulLoop+10]; - } - - // - // Create handle for palette. - // - - ppdev->hpalDefault = - pDevInfo->hpalDefault = EngCreatePalette(PAL_INDEXED, - 256, - (PULONG) ppdev->pPal, - 0,0,0); - - if (ppdev->hpalDefault == NULL) - { - RIP("DISP bInitDefaultPalette failed EngCreatePalette\n"); - EngFreeMem(ppdev->pPal); - return(FALSE); - } - - // - // Initialize the hardware with the initial palette. - // - - return(TRUE); - - } else { - - ppdev->hpalDefault = - pDevInfo->hpalDefault = EngCreatePalette(PAL_BITFIELDS, - 0, NULL, - ppdev->flRed, - ppdev->flGreen, - ppdev->flBlue); - - if (ppdev->hpalDefault == NULL) - { - RIP("DISP bInitDefaultPalette failed EngCreatePalette\n"); - return(FALSE); - } - } - - return(TRUE); -} - -/******************************Public*Routine******************************\ -* bInit256ColorPalette -* -* Initialize the hardware's palette registers. -* -\**************************************************************************/ - -BOOL NTAPI bInit256ColorPalette(PPDEV ppdev) -{ - BYTE ajClutSpace[MAX_CLUT_SIZE]; - PVIDEO_CLUT pScreenClut; - ULONG ulReturnedDataLength; - ULONG cColors; - PVIDEO_CLUTDATA pScreenClutData; - - if (ppdev->ulBitCount == 8) - { - // - // Fill in pScreenClut header info: - // - - pScreenClut = (PVIDEO_CLUT) ajClutSpace; - pScreenClut->NumEntries = 256; - pScreenClut->FirstEntry = 0; - - // - // Copy colours in: - // - - cColors = 256; - pScreenClutData = (PVIDEO_CLUTDATA) (&(pScreenClut->LookupTable[0])); - - while(cColors--) - { - pScreenClutData[cColors].Red = ppdev->pPal[cColors].peRed >> - ppdev->cPaletteShift; - pScreenClutData[cColors].Green = ppdev->pPal[cColors].peGreen >> - ppdev->cPaletteShift; - pScreenClutData[cColors].Blue = ppdev->pPal[cColors].peBlue >> - ppdev->cPaletteShift; - pScreenClutData[cColors].Unused = 0; - } - - // - // Set palette registers: - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_SET_COLOR_REGISTERS, - pScreenClut, - MAX_CLUT_SIZE, - NULL, - 0, - &ulReturnedDataLength)) - { - DISPDBG((0, "Failed bEnablePalette")); - return(FALSE); - } - } - - DISPDBG((5, "Passed bEnablePalette")); - - return(TRUE); -} - -/******************************Public*Routine******************************\ -* DrvSetPalette -* -* DDI entry point for manipulating the palette. -* -\**************************************************************************/ - -BOOL NTAPI DrvSetPalette( -DHPDEV dhpdev, -PALOBJ* ppalo, -FLONG fl, -ULONG iStart, -ULONG cColors) -{ - BYTE ajClutSpace[MAX_CLUT_SIZE]; - PVIDEO_CLUT pScreenClut; - PVIDEO_CLUTDATA pScreenClutData; - PDEV* ppdev; - - UNREFERENCED_PARAMETER(fl); - - ppdev = (PDEV*) dhpdev; - - // - // Fill in pScreenClut header info: - // - - pScreenClut = (PVIDEO_CLUT) ajClutSpace; - pScreenClut->NumEntries = (USHORT) cColors; - pScreenClut->FirstEntry = (USHORT) iStart; - - pScreenClutData = (PVIDEO_CLUTDATA) (&(pScreenClut->LookupTable[0])); - - if (cColors != PALOBJ_cGetColors(ppalo, iStart, cColors, - (ULONG*) pScreenClutData)) - { - DISPDBG((0, "DrvSetPalette failed PALOBJ_cGetColors\n")); - return (FALSE); - } - - // - // Set the high reserved byte in each palette entry to 0. - // Do the appropriate palette shifting to fit in the DAC. - // - - if (ppdev->cPaletteShift) - { - while(cColors--) - { - pScreenClutData[cColors].Red >>= ppdev->cPaletteShift; - pScreenClutData[cColors].Green >>= ppdev->cPaletteShift; - pScreenClutData[cColors].Blue >>= ppdev->cPaletteShift; - pScreenClutData[cColors].Unused = 0; - } - } - else - { - while(cColors--) - { - pScreenClutData[cColors].Unused = 0; - } - } - - // - // Set palette registers - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_SET_COLOR_REGISTERS, - pScreenClut, - MAX_CLUT_SIZE, - NULL, - 0, - &cColors)) - { - DISPDBG((0, "DrvSetPalette failed EngDeviceIoControl\n")); - return (FALSE); - } - - return(TRUE); - -} diff --git a/win32ss/drivers/displays/framebuf_new/pointer.c b/win32ss/drivers/displays/framebuf_new/pointer.c deleted file mode 100644 index 862fc8e6ed2..00000000000 --- a/win32ss/drivers/displays/framebuf_new/pointer.c +++ /dev/null @@ -1,455 +0,0 @@ -/* - * PROJECT: ReactOS Framebuffer Display Driver - * LICENSE: Microsoft NT4 DDK Sample Code License - * FILE: win32ss/drivers/displays/framebuf_new/pointer.c - * PURPOSE: Hardware Pointer Support - * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation - */ - -#include "driver.h" - -BOOL NTAPI bCopyColorPointer( -PPDEV ppdev, -SURFOBJ *psoMask, -SURFOBJ *psoColor, -XLATEOBJ *pxlo); - -BOOL NTAPI bCopyMonoPointer( -PPDEV ppdev, -SURFOBJ *psoMask); - -BOOL NTAPI bSetHardwarePointerShape( -SURFOBJ *pso, -SURFOBJ *psoMask, -SURFOBJ *psoColor, -XLATEOBJ *pxlo, -LONG x, -LONG y, -FLONG fl); - -/******************************Public*Routine******************************\ -* DrvMovePointer -* -* Moves the hardware pointer to a new position. -* -\**************************************************************************/ - -VOID NTAPI DrvMovePointer -( - SURFOBJ *pso, - LONG x, - LONG y, - RECTL *prcl -) -{ - PPDEV ppdev = (PPDEV) pso->dhpdev; - DWORD returnedDataLength; - VIDEO_POINTER_POSITION NewPointerPosition; - - // We don't use the exclusion rectangle because we only support - // hardware Pointers. If we were doing our own Pointer simulations - // we would want to update prcl so that the engine would call us - // to exclude out pointer before drawing to the pixels in prcl. - - UNREFERENCED_PARAMETER(prcl); - - if (x == -1) - { - // - // A new position of (-1,-1) means hide the pointer. - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_DISABLE_POINTER, - NULL, - 0, - NULL, - 0, - &returnedDataLength)) - { - // - // Not the end of the world, print warning in checked build. - // - - DISPDBG((1, "DISP vMoveHardwarePointer failed IOCTL_VIDEO_DISABLE_POINTER\n")); - } - } - else - { - NewPointerPosition.Column = (SHORT) x - (SHORT) (ppdev->ptlHotSpot.x); - NewPointerPosition.Row = (SHORT) y - (SHORT) (ppdev->ptlHotSpot.y); - - // - // Call miniport driver to move Pointer. - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_SET_POINTER_POSITION, - &NewPointerPosition, - sizeof(VIDEO_POINTER_POSITION), - NULL, - 0, - &returnedDataLength)) - { - // - // Not the end of the world, print warning in checked build. - // - - DISPDBG((1, "DISP vMoveHardwarePointer failed IOCTL_VIDEO_SET_POINTER_POSITION\n")); - } - } -} - -/******************************Public*Routine******************************\ -* DrvSetPointerShape -* -* Sets the new pointer shape. -* -\**************************************************************************/ - -ULONG NTAPI DrvSetPointerShape -( - SURFOBJ *pso, - SURFOBJ *psoMask, - SURFOBJ *psoColor, - XLATEOBJ *pxlo, - LONG xHot, - LONG yHot, - LONG x, - LONG y, - RECTL *prcl, - FLONG fl -) -{ - PPDEV ppdev = (PPDEV) pso->dhpdev; - DWORD returnedDataLength; - - // We don't use the exclusion rectangle because we only support - // hardware Pointers. If we were doing our own Pointer simulations - // we would want to update prcl so that the engine would call us - // to exclude out pointer before drawing to the pixels in prcl. - UNREFERENCED_PARAMETER(prcl); - - if (ppdev->pPointerAttributes == NULL) - { - // Mini-port has no hardware Pointer support. - return(SPS_ERROR); - } - - // See if we are being asked to hide the pointer - - if (psoMask == NULL) - { - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_DISABLE_POINTER, - NULL, - 0, - NULL, - 0, - &returnedDataLength)) - { - // - // It should never be possible to fail. - // Message supplied for debugging. - // - - DISPDBG((1, "DISP bSetHardwarePointerShape failed IOCTL_VIDEO_DISABLE_POINTER\n")); - } - - return(TRUE); - } - - ppdev->ptlHotSpot.x = xHot; - ppdev->ptlHotSpot.y = yHot; - - if (!bSetHardwarePointerShape(pso,psoMask,psoColor,pxlo,x,y,fl)) - { - if (ppdev->fHwCursorActive) { - ppdev->fHwCursorActive = FALSE; - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_DISABLE_POINTER, - NULL, - 0, - NULL, - 0, - &returnedDataLength)) { - - DISPDBG((1, "DISP bSetHardwarePointerShape failed IOCTL_VIDEO_DISABLE_POINTER\n")); - } - } - - // - // Mini-port declines to realize this Pointer - // - - return(SPS_DECLINE); - } - else - { - ppdev->fHwCursorActive = TRUE; - } - - return(SPS_ACCEPT_NOEXCLUDE); -} - -/******************************Public*Routine******************************\ -* bSetHardwarePointerShape -* -* Changes the shape of the Hardware Pointer. -* -* Returns: True if successful, False if Pointer shape can't be hardware. -* -\**************************************************************************/ - -BOOL NTAPI bSetHardwarePointerShape( -SURFOBJ *pso, -SURFOBJ *psoMask, -SURFOBJ *psoColor, -XLATEOBJ *pxlo, -LONG x, -LONG y, -FLONG fl) -{ - PPDEV ppdev = (PPDEV) pso->dhpdev; - PVIDEO_POINTER_ATTRIBUTES pPointerAttributes = ppdev->pPointerAttributes; - DWORD returnedDataLength; - - if (psoColor != NULL) - { - if ((ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER) && - bCopyColorPointer(ppdev, psoMask, psoColor, pxlo)) - { - pPointerAttributes->Flags |= VIDEO_MODE_COLOR_POINTER; - } else { - return(FALSE); - } - - } else { - - if ((ppdev->PointerCapabilities.Flags & VIDEO_MODE_MONO_POINTER) && - bCopyMonoPointer(ppdev, psoMask)) - { - pPointerAttributes->Flags |= VIDEO_MODE_MONO_POINTER; - } else { - return(FALSE); - } - } - - // - // Initialize Pointer attributes and position - // - - pPointerAttributes->Enable = 1; - - // - // if x,y = -1,-1 then pass them directly to the miniport so that - // the cursor will be disabled - - pPointerAttributes->Column = (SHORT)(x); - pPointerAttributes->Row = (SHORT)(y); - - if ((x != -1) || (y != -1)) { - pPointerAttributes->Column -= (SHORT)(ppdev->ptlHotSpot.x); - pPointerAttributes->Row -= (SHORT)(ppdev->ptlHotSpot.y); - } - - // - // set animate flags - // - - if (fl & SPS_ANIMATESTART) { - pPointerAttributes->Flags |= VIDEO_MODE_ANIMATE_START; - } else if (fl & SPS_ANIMATEUPDATE) { - pPointerAttributes->Flags |= VIDEO_MODE_ANIMATE_UPDATE; - } - - // - // Set the new Pointer shape. - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_SET_POINTER_ATTR, - pPointerAttributes, - ppdev->cjPointerAttributes, - NULL, - 0, - &returnedDataLength)) { - - DISPDBG((1, "DISP:Failed IOCTL_VIDEO_SET_POINTER_ATTR call\n")); - return(FALSE); - } - - return(TRUE); -} - -/******************************Public*Routine******************************\ -* bCopyMonoPointer -* -* Copies two monochrome masks into a buffer of the maximum size handled by the -* miniport, with any extra bits set to 0. The masks are converted to topdown -* form if they aren't already. Returns TRUE if we can handle this pointer in -* hardware, FALSE if not. -* -\**************************************************************************/ - -BOOL NTAPI bCopyMonoPointer( - PPDEV ppdev, - SURFOBJ *pso) -{ - ULONG cy; - PBYTE pjSrcAnd, pjSrcXor; - LONG lDeltaSrc, lDeltaDst; - LONG lSrcWidthInBytes; - ULONG cxSrc = pso->sizlBitmap.cx; - ULONG cySrc = pso->sizlBitmap.cy; - ULONG cxSrcBytes; - PVIDEO_POINTER_ATTRIBUTES pPointerAttributes = ppdev->pPointerAttributes; - PBYTE pjDstAnd = pPointerAttributes->Pixels; - PBYTE pjDstXor = pPointerAttributes->Pixels; - - // Make sure the new pointer isn't too big to handle - // (*2 because both masks are in there) - if ((cxSrc > ppdev->PointerCapabilities.MaxWidth) || - (cySrc > (ppdev->PointerCapabilities.MaxHeight * 2))) - { - return(FALSE); - } - - pjDstXor += ((ppdev->PointerCapabilities.MaxWidth + 7) / 8) * - ppdev->pPointerAttributes->Height; - - // set the desk and mask to 0xff - RtlFillMemory(pjDstAnd, ppdev->pPointerAttributes->WidthInBytes * - ppdev->pPointerAttributes->Height, 0xFF); - - // Zero the dest XOR mask - RtlZeroMemory(pjDstXor, ppdev->pPointerAttributes->WidthInBytes * - ppdev->pPointerAttributes->Height); - - cxSrcBytes = (cxSrc + 7) / 8; - - if ((lDeltaSrc = pso->lDelta) < 0) - { - lSrcWidthInBytes = -lDeltaSrc; - } else { - lSrcWidthInBytes = lDeltaSrc; - } - - pjSrcAnd = (PBYTE) pso->pvBits; - - // If the incoming pointer bitmap is bottomup, we'll flip it to topdown to - // save the miniport some work - if (!(pso->fjBitmap & BMF_TOPDOWN)) - { - // Copy from the bottom - pjSrcAnd += lSrcWidthInBytes * (cySrc - 1); - } - - // Height of just AND mask - cySrc = cySrc / 2; - - // Point to XOR mask - pjSrcXor = pjSrcAnd + (cySrc * lDeltaSrc); - - // Offset from end of one dest scan to start of next - lDeltaDst = ppdev->pPointerAttributes->WidthInBytes; - - for (cy = 0; cy < cySrc; ++cy) - { - RtlCopyMemory(pjDstAnd, pjSrcAnd, cxSrcBytes); - RtlCopyMemory(pjDstXor, pjSrcXor, cxSrcBytes); - - // Point to next source and dest scans - pjSrcAnd += lDeltaSrc; - pjSrcXor += lDeltaSrc; - pjDstAnd += lDeltaDst; - pjDstXor += lDeltaDst; - } - - return(TRUE); -} - -/******************************Public*Routine******************************\ -* bCopyColorPointer -* -* Copies the mono and color masks into the buffer of maximum size -* handled by the miniport with any extra bits set to 0. Color translation -* is handled at this time. The masks are converted to topdown form if they -* aren't already. Returns TRUE if we can handle this pointer in hardware, -* FALSE if not. -* -\**************************************************************************/ -BOOL NTAPI bCopyColorPointer( -PPDEV ppdev, -SURFOBJ *psoMask, -SURFOBJ *psoColor, -XLATEOBJ *pxlo) -{ - return(FALSE); -} - - -/******************************Public*Routine******************************\ -* bInitPointer -* -* Initialize the Pointer attributes. -* -\**************************************************************************/ - -BOOL NTAPI bInitPointer(PPDEV ppdev, DEVINFO *pdevinfo) -{ - DWORD returnedDataLength; - - ppdev->pPointerAttributes = NULL; - ppdev->cjPointerAttributes = 0; // initialized in screen.c - - // - // Ask the miniport whether it provides pointer support. - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES, - NULL, - 0, - &ppdev->PointerCapabilities, - sizeof(ppdev->PointerCapabilities), - &returnedDataLength)) - { - return(FALSE); - } - - // - // If neither mono nor color hardware pointer is supported, there's no - // hardware pointer support and we're done. - // - - if ((!(ppdev->PointerCapabilities.Flags & VIDEO_MODE_MONO_POINTER)) && - (!(ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER))) - { - return(TRUE); - } - - // - // Note: The buffer itself is allocated after we set the - // mode. At that time we know the pixel depth and we can - // allocate the correct size for the color pointer if supported. - // - - // - // Set the asynchronous support status (async means miniport is capable of - // drawing the Pointer at any time, with no interference with any ongoing - // drawing operation) - // - - if (ppdev->PointerCapabilities.Flags & VIDEO_MODE_ASYNC_POINTER) - { - pdevinfo->flGraphicsCaps |= GCAPS_ASYNCMOVE; - } - else - { - pdevinfo->flGraphicsCaps &= ~GCAPS_ASYNCMOVE; - } - - return(TRUE); -} diff --git a/win32ss/drivers/displays/framebuf_new/screen.c b/win32ss/drivers/displays/framebuf_new/screen.c deleted file mode 100644 index 66f25faf649..00000000000 --- a/win32ss/drivers/displays/framebuf_new/screen.c +++ /dev/null @@ -1,605 +0,0 @@ -/* - * PROJECT: ReactOS Framebuffer Display Driver - * LICENSE: Microsoft NT4 DDK Sample Code License - * FILE: win32ss/drivers/displays/framebuf_new/screen.c - * PURPOSE: Surface, Screen and PDEV support/initialization - * PROGRAMMERS: Copyright (c) 1992-1995 Microsoft Corporation - * ReactOS Portable Systems Group - */ - -#include "driver.h" - -#define SYSTM_LOGFONT {16,7,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,VARIABLE_PITCH | FF_DONTCARE,L"System"} -#define HELVE_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,VARIABLE_PITCH | FF_DONTCARE,L"MS Sans Serif"} -#define COURI_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,FIXED_PITCH | FF_DONTCARE, L"Courier"} - -// This is the basic devinfo for a default driver. This is used as a base and customized based -// on information passed back from the miniport driver. - -const DEVINFO gDevInfoFrameBuffer = { - ( GCAPS_OPAQUERECT -// eVb: 2.8 [DDK CHANGE] - No dithering support -// eVb: 2.8 [END] - ), /* Graphics capabilities */ - SYSTM_LOGFONT, /* Default font description */ - HELVE_LOGFONT, /* ANSI variable font description */ - COURI_LOGFONT, /* ANSI fixed font description */ - 0, /* Count of device fonts */ - 0, /* Preferred DIB format */ -// eVb: 2.9 [DDK CHANGE] - No dithering support - 0, /* Width of color dither */ - 0, /* Height of color dither */ -// eVb: 2.9 [END] - 0 /* Default palette to use for this device */ -}; - -/******************************Public*Routine******************************\ -* bInitSURF -* -* Enables the surface. Maps the frame buffer into memory. -* -\**************************************************************************/ - -BOOL NTAPI bInitSURF(PPDEV ppdev, BOOL bFirst) -{ - DWORD returnedDataLength; - DWORD MaxWidth, MaxHeight; - VIDEO_MEMORY videoMemory; - VIDEO_MEMORY_INFORMATION videoMemoryInformation; -// eVb: 2.1 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping - ULONG RemappingNeeded = 0; -// eVb: 2.1 [END] - // - // Set the current mode into the hardware. - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_SET_CURRENT_MODE, - &(ppdev->ulMode), - sizeof(ULONG), -// eVb: 2.2 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping - &RemappingNeeded, - sizeof(ULONG), -// eVb: 2.2 [END] - &returnedDataLength)) - { - RIP("DISP bInitSURF failed IOCTL_SET_MODE\n"); - return(FALSE); - } - - // - // If this is the first time we enable the surface we need to map in the - // memory also. - // -// eVb: 2.3 [DDK Change] - Support new VGA Miniport behavior w.r.t updated framebuffer remapping - if (bFirst || RemappingNeeded) - { -// eVb: 2.3 [END] - videoMemory.RequestedVirtualAddress = NULL; - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_MAP_VIDEO_MEMORY, - &videoMemory, - sizeof(VIDEO_MEMORY), - &videoMemoryInformation, - sizeof(VIDEO_MEMORY_INFORMATION), - &returnedDataLength)) - { - RIP("DISP bInitSURF failed IOCTL_VIDEO_MAP\n"); - return(FALSE); - } - - ppdev->pjScreen = (PBYTE)(videoMemoryInformation.FrameBufferBase); - - if (videoMemoryInformation.FrameBufferBase != - videoMemoryInformation.VideoRamBase) - { - RIP("VideoRamBase does not correspond to FrameBufferBase\n"); - } -// eVb: 2.4 [DDK Change] - Make sure frame buffer mapping worked - // - // Make sure we can access this video memory - // - - *(PULONG)(ppdev->pjScreen) = 0xaa55aa55; - - if (*(PULONG)(ppdev->pjScreen) != 0xaa55aa55) { - - DISPDBG((1, "Frame buffer memory is not accessible.\n")); - return(FALSE); - } -// eVb: 2.4 [END] - ppdev->cScreenSize = videoMemoryInformation.VideoRamLength; - - // - // Initialize the head of the offscreen list to NULL. - // - - ppdev->pOffscreenList = NULL; - - // It's a hardware pointer; set up pointer attributes. - - MaxHeight = ppdev->PointerCapabilities.MaxHeight; - - // Allocate space for two DIBs (data/mask) for the pointer. If this - // device supports a color Pointer, we will allocate a larger bitmap. - // If this is a color bitmap we allocate for the largest possible - // bitmap because we have no idea of what the pixel depth might be. - - // Width rounded up to nearest byte multiple - - if (!(ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER)) - { - MaxWidth = (ppdev->PointerCapabilities.MaxWidth + 7) / 8; - } - else - { - MaxWidth = ppdev->PointerCapabilities.MaxWidth * sizeof(DWORD); - } - - ppdev->cjPointerAttributes = - sizeof(VIDEO_POINTER_ATTRIBUTES) + - ((sizeof(UCHAR) * MaxWidth * MaxHeight) * 2); - - ppdev->pPointerAttributes = (PVIDEO_POINTER_ATTRIBUTES) - EngAllocMem(0, ppdev->cjPointerAttributes, ALLOC_TAG); - - if (ppdev->pPointerAttributes == NULL) { - - DISPDBG((0, "bInitPointer EngAllocMem failed\n")); - return(FALSE); - } - - ppdev->pPointerAttributes->Flags = ppdev->PointerCapabilities.Flags; - ppdev->pPointerAttributes->WidthInBytes = MaxWidth; - ppdev->pPointerAttributes->Width = ppdev->PointerCapabilities.MaxWidth; - ppdev->pPointerAttributes->Height = MaxHeight; - ppdev->pPointerAttributes->Column = 0; - ppdev->pPointerAttributes->Row = 0; - ppdev->pPointerAttributes->Enable = 0; - } - - return(TRUE); -} - -/******************************Public*Routine******************************\ -* vDisableSURF -* -* Disable the surface. Un-Maps the frame in memory. -* -\**************************************************************************/ - -VOID NTAPI vDisableSURF(PPDEV ppdev) -{ - DWORD returnedDataLength; - VIDEO_MEMORY videoMemory; - - videoMemory.RequestedVirtualAddress = (PVOID) ppdev->pjScreen; - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_UNMAP_VIDEO_MEMORY, - &videoMemory, - sizeof(VIDEO_MEMORY), - NULL, - 0, - &returnedDataLength)) - { - RIP("DISP vDisableSURF failed IOCTL_VIDEO_UNMAP\n"); - } -} - - -/******************************Public*Routine******************************\ -* bInitPDEV -* -* Determine the mode we should be in based on the DEVMODE passed in. -* Query mini-port to get information needed to fill in the DevInfo and the -* GdiInfo . -* -\**************************************************************************/ - -BOOL NTAPI bInitPDEV( -PPDEV ppdev, -DEVMODEW *pDevMode, -GDIINFO *pGdiInfo, -DEVINFO *pDevInfo) -{ - ULONG cModes; - PVIDEO_MODE_INFORMATION pVideoBuffer, pVideoModeSelected, pVideoTemp; - VIDEO_COLOR_CAPABILITIES colorCapabilities; - ULONG ulTemp; - BOOL bSelectDefault; - ULONG cbModeSize; - - // - // calls the miniport to get mode information. - // - - cModes = getAvailableModes(ppdev->hDriver, &pVideoBuffer, &cbModeSize); - - if (cModes == 0) - { - return(FALSE); - } - - // - // Now see if the requested mode has a match in that table. - // - - pVideoModeSelected = NULL; - pVideoTemp = pVideoBuffer; - - if ((pDevMode->dmPelsWidth == 0) && - (pDevMode->dmPelsHeight == 0) && - (pDevMode->dmBitsPerPel == 0) && - (pDevMode->dmDisplayFrequency == 0)) - { - DISPDBG((2, "Default mode requested")); - bSelectDefault = TRUE; - } - else - { -// eVb: 2.5 [DDK Change] - Add missing newlines to debug output - DISPDBG((2, "Requested mode...\n")); - DISPDBG((2, " Screen width -- %li\n", pDevMode->dmPelsWidth)); - DISPDBG((2, " Screen height -- %li\n", pDevMode->dmPelsHeight)); - DISPDBG((2, " Bits per pel -- %li\n", pDevMode->dmBitsPerPel)); - DISPDBG((2, " Frequency -- %li\n", pDevMode->dmDisplayFrequency)); -// eVb: 2.5 [END] - bSelectDefault = FALSE; - } - - while (cModes--) - { - if (pVideoTemp->Length != 0) - { - if (bSelectDefault || - ((pVideoTemp->VisScreenWidth == pDevMode->dmPelsWidth) && - (pVideoTemp->VisScreenHeight == pDevMode->dmPelsHeight) && - (pVideoTemp->BitsPerPlane * - pVideoTemp->NumberOfPlanes == pDevMode->dmBitsPerPel) && - (pVideoTemp->Frequency == pDevMode->dmDisplayFrequency))) - { - pVideoModeSelected = pVideoTemp; - DISPDBG((3, "Found a match\n")) ; - break; - } - } - - pVideoTemp = (PVIDEO_MODE_INFORMATION) - (((PUCHAR)pVideoTemp) + cbModeSize); - } - - // - // If no mode has been found, return an error - // - - if (pVideoModeSelected == NULL) - { - EngFreeMem(pVideoBuffer); - DISPDBG((0,"DISP bInitPDEV failed - no valid modes\n")); - return(FALSE); - } - - // - // Fill in the GDIINFO data structure with the information returned from - // the kernel driver. - // - - ppdev->ulMode = pVideoModeSelected->ModeIndex; - ppdev->cxScreen = pVideoModeSelected->VisScreenWidth; - ppdev->cyScreen = pVideoModeSelected->VisScreenHeight; - ppdev->ulBitCount = pVideoModeSelected->BitsPerPlane * - pVideoModeSelected->NumberOfPlanes; - ppdev->lDeltaScreen = pVideoModeSelected->ScreenStride; - - ppdev->flRed = pVideoModeSelected->RedMask; - ppdev->flGreen = pVideoModeSelected->GreenMask; - ppdev->flBlue = pVideoModeSelected->BlueMask; - - - pGdiInfo->ulVersion = GDI_DRIVER_VERSION; - pGdiInfo->ulTechnology = DT_RASDISPLAY; - pGdiInfo->ulHorzSize = pVideoModeSelected->XMillimeter; - pGdiInfo->ulVertSize = pVideoModeSelected->YMillimeter; - - pGdiInfo->ulHorzRes = ppdev->cxScreen; - pGdiInfo->ulVertRes = ppdev->cyScreen; - pGdiInfo->ulPanningHorzRes = ppdev->cxScreen; - pGdiInfo->ulPanningVertRes = ppdev->cyScreen; - pGdiInfo->cBitsPixel = pVideoModeSelected->BitsPerPlane; - pGdiInfo->cPlanes = pVideoModeSelected->NumberOfPlanes; - pGdiInfo->ulVRefresh = pVideoModeSelected->Frequency; - pGdiInfo->ulBltAlignment = 1; // We don't have accelerated screen- - // to-screen blts, and any - // window alignment is okay - - pGdiInfo->ulLogPixelsX = pDevMode->dmLogPixels; - pGdiInfo->ulLogPixelsY = pDevMode->dmLogPixels; - -#ifdef MIPS - if (ppdev->ulBitCount == 8) - pGdiInfo->flTextCaps = (TC_RA_ABLE | TC_SCROLLBLT); - else -#endif - pGdiInfo->flTextCaps = TC_RA_ABLE; - - pGdiInfo->flRaster = 0; // flRaster is reserved by DDI - - pGdiInfo->ulDACRed = pVideoModeSelected->NumberRedBits; - pGdiInfo->ulDACGreen = pVideoModeSelected->NumberGreenBits; - pGdiInfo->ulDACBlue = pVideoModeSelected->NumberBlueBits; - - pGdiInfo->ulAspectX = 0x24; // One-to-one aspect ratio - pGdiInfo->ulAspectY = 0x24; - pGdiInfo->ulAspectXY = 0x33; - - pGdiInfo->xStyleStep = 1; // A style unit is 3 pels - pGdiInfo->yStyleStep = 1; - pGdiInfo->denStyleStep = 3; - - pGdiInfo->ptlPhysOffset.x = 0; - pGdiInfo->ptlPhysOffset.y = 0; - pGdiInfo->szlPhysSize.cx = 0; - pGdiInfo->szlPhysSize.cy = 0; - - // RGB and CMY color info. - - // - // try to get it from the miniport. - // if the miniport doesn ot support this feature, use defaults. - // - - if (EngDeviceIoControl(ppdev->hDriver, - IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES, - NULL, - 0, - &colorCapabilities, - sizeof(VIDEO_COLOR_CAPABILITIES), - &ulTemp)) - { - - DISPDBG((2, "getcolorCapabilities failed \n")); - - pGdiInfo->ciDevice.Red.x = 6700; - pGdiInfo->ciDevice.Red.y = 3300; - pGdiInfo->ciDevice.Red.Y = 0; - pGdiInfo->ciDevice.Green.x = 2100; - pGdiInfo->ciDevice.Green.y = 7100; - pGdiInfo->ciDevice.Green.Y = 0; - pGdiInfo->ciDevice.Blue.x = 1400; - pGdiInfo->ciDevice.Blue.y = 800; - pGdiInfo->ciDevice.Blue.Y = 0; - pGdiInfo->ciDevice.AlignmentWhite.x = 3127; - pGdiInfo->ciDevice.AlignmentWhite.y = 3290; - pGdiInfo->ciDevice.AlignmentWhite.Y = 0; - - pGdiInfo->ciDevice.RedGamma = 20000; - pGdiInfo->ciDevice.GreenGamma = 20000; - pGdiInfo->ciDevice.BlueGamma = 20000; - - } - else - { - pGdiInfo->ciDevice.Red.x = colorCapabilities.RedChromaticity_x; - pGdiInfo->ciDevice.Red.y = colorCapabilities.RedChromaticity_y; - pGdiInfo->ciDevice.Red.Y = 0; - pGdiInfo->ciDevice.Green.x = colorCapabilities.GreenChromaticity_x; - pGdiInfo->ciDevice.Green.y = colorCapabilities.GreenChromaticity_y; - pGdiInfo->ciDevice.Green.Y = 0; - pGdiInfo->ciDevice.Blue.x = colorCapabilities.BlueChromaticity_x; - pGdiInfo->ciDevice.Blue.y = colorCapabilities.BlueChromaticity_y; - pGdiInfo->ciDevice.Blue.Y = 0; - pGdiInfo->ciDevice.AlignmentWhite.x = colorCapabilities.WhiteChromaticity_x; - pGdiInfo->ciDevice.AlignmentWhite.y = colorCapabilities.WhiteChromaticity_y; - pGdiInfo->ciDevice.AlignmentWhite.Y = colorCapabilities.WhiteChromaticity_Y; - - // if we have a color device store the three color gamma values, - // otherwise store the unique gamma value in all three. - - if (colorCapabilities.AttributeFlags & VIDEO_DEVICE_COLOR) - { - pGdiInfo->ciDevice.RedGamma = colorCapabilities.RedGamma; - pGdiInfo->ciDevice.GreenGamma = colorCapabilities.GreenGamma; - pGdiInfo->ciDevice.BlueGamma = colorCapabilities.BlueGamma; - } - else - { - pGdiInfo->ciDevice.RedGamma = colorCapabilities.WhiteGamma; - pGdiInfo->ciDevice.GreenGamma = colorCapabilities.WhiteGamma; - pGdiInfo->ciDevice.BlueGamma = colorCapabilities.WhiteGamma; - } - - }; - - pGdiInfo->ciDevice.Cyan.x = 0; - pGdiInfo->ciDevice.Cyan.y = 0; - pGdiInfo->ciDevice.Cyan.Y = 0; - pGdiInfo->ciDevice.Magenta.x = 0; - pGdiInfo->ciDevice.Magenta.y = 0; - pGdiInfo->ciDevice.Magenta.Y = 0; - pGdiInfo->ciDevice.Yellow.x = 0; - pGdiInfo->ciDevice.Yellow.y = 0; - pGdiInfo->ciDevice.Yellow.Y = 0; - - // No dye correction for raster displays. - - pGdiInfo->ciDevice.MagentaInCyanDye = 0; - pGdiInfo->ciDevice.YellowInCyanDye = 0; - pGdiInfo->ciDevice.CyanInMagentaDye = 0; - pGdiInfo->ciDevice.YellowInMagentaDye = 0; - pGdiInfo->ciDevice.CyanInYellowDye = 0; - pGdiInfo->ciDevice.MagentaInYellowDye = 0; - - pGdiInfo->ulDevicePelsDPI = 0; // For printers only - pGdiInfo->ulPrimaryOrder = PRIMARY_ORDER_CBA; - - // BUGBUG this should be modified to take into account the size - // of the display and the resolution. - - pGdiInfo->ulHTPatternSize = HT_PATSIZE_4x4_M; - - pGdiInfo->flHTFlags = HT_FLAG_ADDITIVE_PRIMS; - - // Fill in the basic devinfo structure - - *pDevInfo = gDevInfoFrameBuffer; - - // Fill in the rest of the devinfo and GdiInfo structures. - - if (ppdev->ulBitCount == 8) - { - // It is Palette Managed. - - pGdiInfo->ulNumColors = 20; - pGdiInfo->ulNumPalReg = 1 << ppdev->ulBitCount; -// eVb: 2.7 [DDK CHANGE] - No dithering support - pDevInfo->flGraphicsCaps |= GCAPS_PALMANAGED; -// eVb: 2.7 [END] - pGdiInfo->ulHTOutputFormat = HT_FORMAT_8BPP; - pDevInfo->iDitherFormat = BMF_8BPP; - - // Assuming palette is orthogonal - all colors are same size. - - ppdev->cPaletteShift = 8 - pGdiInfo->ulDACRed; - } - else - { - pGdiInfo->ulNumColors = (ULONG) (-1); - pGdiInfo->ulNumPalReg = 0; - - if (ppdev->ulBitCount == 16) - { - pGdiInfo->ulHTOutputFormat = HT_FORMAT_16BPP; - pDevInfo->iDitherFormat = BMF_16BPP; - } - else if (ppdev->ulBitCount == 24) - { - pGdiInfo->ulHTOutputFormat = HT_FORMAT_24BPP; - pDevInfo->iDitherFormat = BMF_24BPP; - } - else - { - pGdiInfo->ulHTOutputFormat = HT_FORMAT_32BPP; - pDevInfo->iDitherFormat = BMF_32BPP; - } - } - - EngFreeMem(pVideoBuffer); - - return(TRUE); -} - - -/******************************Public*Routine******************************\ -* getAvailableModes -* -* Calls the miniport to get the list of modes supported by the kernel driver, -* and returns the list of modes supported by the diplay driver among those -* -* returns the number of entries in the videomode buffer. -* 0 means no modes are supported by the miniport or that an error occured. -* -* NOTE: the buffer must be freed up by the caller. -* -\**************************************************************************/ - -DWORD NTAPI getAvailableModes( -HANDLE hDriver, -PVIDEO_MODE_INFORMATION *modeInformation, -DWORD *cbModeSize) -{ - ULONG ulTemp; - VIDEO_NUM_MODES modes; - PVIDEO_MODE_INFORMATION pVideoTemp; - - // - // Get the number of modes supported by the mini-port - // - - if (EngDeviceIoControl(hDriver, - IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES, - NULL, - 0, - &modes, - sizeof(VIDEO_NUM_MODES), - &ulTemp)) - { - DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_NUM_AVAIL_MODES\n")); - return 0; - } - - *cbModeSize = modes.ModeInformationLength; - - // - // Allocate the buffer for the mini-port to write the modes in. - // - - *modeInformation = (PVIDEO_MODE_INFORMATION) - EngAllocMem(0, modes.NumModes * - modes.ModeInformationLength, ALLOC_TAG); - - if (*modeInformation == NULL) - { - DISPDBG((0, "getAvailableModes failed EngAllocMem\n")); - - return 0; - } - - // - // Ask the mini-port to fill in the available modes. - // - - if (EngDeviceIoControl(hDriver, - IOCTL_VIDEO_QUERY_AVAIL_MODES, - NULL, - 0, - *modeInformation, - modes.NumModes * modes.ModeInformationLength, - &ulTemp)) - { - - DISPDBG((0, "getAvailableModes failed VIDEO_QUERY_AVAIL_MODES\n")); - - EngFreeMem(*modeInformation); - *modeInformation = NULL; - - return 0; - } - - // - // Now see which of these modes are supported by the display driver. - // As an internal mechanism, set the length to 0 for the modes we - // DO NOT support. - // - - ulTemp = modes.NumModes; - pVideoTemp = *modeInformation; - - // - // Mode is rejected if it is not one plane, or not graphics, or is not - // one of 8, 16 or 32 bits per pel. - // - - while (ulTemp--) - { - if ((pVideoTemp->NumberOfPlanes != 1 ) || - !(pVideoTemp->AttributeFlags & VIDEO_MODE_GRAPHICS) || -// eVb: 2.6 [DDK CHANGE] - Do not process banked video modes - (pVideoTemp->AttributeFlags & VIDEO_MODE_BANKED) || -// eVb: 2.6 [END] - ((pVideoTemp->BitsPerPlane != 8) && - (pVideoTemp->BitsPerPlane != 16) && - (pVideoTemp->BitsPerPlane != 24) && - (pVideoTemp->BitsPerPlane != 32))) - { - pVideoTemp->Length = 0; - } - - pVideoTemp = (PVIDEO_MODE_INFORMATION) - (((PUCHAR)pVideoTemp) + modes.ModeInformationLength); - } - - return modes.NumModes; - -}
1 year, 4 months
1
0
0
0
[reactos] 01/03: [FRAMEBUF] Return the "old" driver back
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b9b2608bfbc0bdd99e7d7…
commit b9b2608bfbc0bdd99e7d7cf785c83838af639506 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Wed May 31 00:28:44 2023 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Mon Jun 19 13:58:43 2023 +0300 [FRAMEBUF] Return the "old" driver back It has a better license (GPL) and does not have visible drawbacks compared to framebuf_new. --- win32ss/drivers/displays/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win32ss/drivers/displays/CMakeLists.txt b/win32ss/drivers/displays/CMakeLists.txt index e390c7492e4..27f4cff7dd8 100644 --- a/win32ss/drivers/displays/CMakeLists.txt +++ b/win32ss/drivers/displays/CMakeLists.txt @@ -1,4 +1,3 @@ -#add_subdirectory(framebuf) -add_subdirectory(framebuf_new) +add_subdirectory(framebuf) add_subdirectory(vga)
1 year, 4 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Add CMainWindow::CanPaste
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bc19bbe4083cd66a7745e…
commit bc19bbe4083cd66a7745ea0671b74edb9353d238 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 19 18:59:00 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Jun 19 18:59:00 2023 +0900 [MSPAINT] Add CMainWindow::CanPaste CORE-18867 --- base/applications/mspaint/winproc.cpp | 16 +++++++++++----- base/applications/mspaint/winproc.h | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index e80f8572dc2..41829b84b8f 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -436,6 +436,16 @@ BOOL CMainWindow::CanRedo() const return imageModel.CanRedo(); } +BOOL CMainWindow::CanPaste() const +{ + if (toolsModel.GetActiveTool() == TOOL_TEXT && ::IsWindowVisible(textEditWindow)) + return ::IsClipboardFormatAvailable(CF_UNICODETEXT); + + return (::IsClipboardFormatAvailable(CF_ENHMETAFILE) || + ::IsClipboardFormatAvailable(CF_DIB) || + ::IsClipboardFormatAvailable(CF_BITMAP)); +} + LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { HMENU menu = (HMENU)wParam; @@ -465,11 +475,7 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO ENABLED_IF(textShown ? hasTextSel : trueSelection)); EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection)); EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection)); - EnableMenuItem(menu, IDM_EDITPASTE, - ENABLED_IF(textShown ? ::IsClipboardFormatAvailable(CF_UNICODETEXT) : - (::IsClipboardFormatAvailable(CF_ENHMETAFILE) || - ::IsClipboardFormatAvailable(CF_DIB) || - ::IsClipboardFormatAvailable(CF_BITMAP)))); + EnableMenuItem(menu, IDM_EDITPASTE, ENABLED_IF(CanPaste())); // // View menu diff --git a/base/applications/mspaint/winproc.h b/base/applications/mspaint/winproc.h index 7984057184d..075c0735ba7 100644 --- a/base/applications/mspaint/winproc.h +++ b/base/applications/mspaint/winproc.h @@ -37,6 +37,7 @@ public: VOID TrackPopupMenu(POINT ptScreen, INT iSubMenu); BOOL CanUndo() const; BOOL CanRedo() const; + BOOL CanPaste() const; private: HMENU m_hMenu;
1 year, 4 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Fix CMainWindow::GetSaveFileName (#5356)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=19d88628515506f939238…
commit 19d88628515506f9392384ae45bc7d38d1e9708a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 19 14:15:18 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Jun 19 14:15:18 2023 +0900 [MSPAINT] Fix CMainWindow::GetSaveFileName (#5356) Fix filename extension cases and "File Type" field. If no filename extension on save, then append ".png" to the filename. CORE-18867 --- base/applications/mspaint/main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/base/applications/mspaint/main.cpp b/base/applications/mspaint/main.cpp index b3b6728fd94..cbe3574698d 100644 --- a/base/applications/mspaint/main.cpp +++ b/base/applications/mspaint/main.cpp @@ -123,13 +123,18 @@ BOOL CMainWindow::GetSaveFileName(IN OUT LPTSTR pszFile, INT cchMaxFile) sfn.lpfnHook = OFNHookProc; sfn.lpstrDefExt = L"png"; - // Choose PNG - for (INT i = 0; i < aguidFileTypesE.GetSize(); ++i) + LPWSTR pchDotExt = PathFindExtensionW(pszFile); + if (*pchDotExt == UNICODE_NULL) { - if (aguidFileTypesE[i] == Gdiplus::ImageFormatPNG) + // Choose PNG + wcscat(pszFile, L".png"); + for (INT i = 0; i < aguidFileTypesE.GetSize(); ++i) { - sfn.nFilterIndex = i + 1; - break; + if (aguidFileTypesE[i] == Gdiplus::ImageFormatPNG) + { + sfn.nFilterIndex = i + 1; + break; + } } } }
1 year, 4 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Add CMainWindow::CanUndo/CanRedo (#5355)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=64ef3ced9c35b801d092f…
commit 64ef3ced9c35b801d092fd1f049cefa5ed96fe5e Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 19 14:13:43 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Jun 19 14:13:43 2023 +0900 [MSPAINT] Add CMainWindow::CanUndo/CanRedo (#5355) - Add CMainWindow::CanUndo and CMainWindow::CanRedo and use them. - Fix wrongly-disabled Undo/Redo in some cases. CORE-18867 --- base/applications/mspaint/winproc.cpp | 33 ++++++++++++++++++++++++++------- base/applications/mspaint/winproc.h | 2 ++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index 3ac4b5b60d8..e80f8572dc2 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -416,6 +416,26 @@ void CMainWindow::ProcessFileMenu(HMENU hPopupMenu) } } +BOOL CMainWindow::CanUndo() const +{ + if (toolsModel.GetActiveTool() == TOOL_TEXT && ::IsWindowVisible(textEditWindow)) + return (BOOL)textEditWindow.SendMessage(EM_CANUNDO); + if (selectionModel.m_bShow && toolsModel.IsSelection()) + return TRUE; + if (ToolBase::pointSP != 0) + return TRUE; + return imageModel.CanUndo(); +} + +BOOL CMainWindow::CanRedo() const +{ + if (toolsModel.GetActiveTool() == TOOL_TEXT && ::IsWindowVisible(textEditWindow)) + return FALSE; // There is no "WM_REDO" in EDIT control + if (ToolBase::pointSP != 0) + return TRUE; + return imageModel.CanRedo(); +} + LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { HMENU menu = (HMENU)wParam; @@ -437,9 +457,8 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO // // Edit menu // - EnableMenuItem(menu, IDM_EDITUNDO, - ENABLED_IF(textShown ? textEditWindow.SendMessage(EM_CANUNDO) : imageModel.CanUndo())); - EnableMenuItem(menu, IDM_EDITREDO, ENABLED_IF(textShown ? FALSE : imageModel.CanRedo())); + EnableMenuItem(menu, IDM_EDITUNDO, ENABLED_IF(CanUndo())); + EnableMenuItem(menu, IDM_EDITREDO, ENABLED_IF(CanRedo())); EnableMenuItem(menu, IDM_EDITCUT, ENABLED_IF(textShown ? hasTextSel : trueSelection)); EnableMenuItem(menu, IDM_EDITCOPY, ENABLED_IF(textShown ? hasTextSel : trueSelection)); EnableMenuItem(menu, IDM_EDITDELETESELECTION, @@ -448,9 +467,9 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection)); EnableMenuItem(menu, IDM_EDITPASTE, ENABLED_IF(textShown ? ::IsClipboardFormatAvailable(CF_UNICODETEXT) : - ::IsClipboardFormatAvailable(CF_ENHMETAFILE) || - ::IsClipboardFormatAvailable(CF_DIB) || - ::IsClipboardFormatAvailable(CF_BITMAP))); + (::IsClipboardFormatAvailable(CF_ENHMETAFILE) || + ::IsClipboardFormatAvailable(CF_DIB) || + ::IsClipboardFormatAvailable(CF_BITMAP)))); // // View menu @@ -681,7 +700,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH case IDM_EDITREDO: if (textShown) { - // There is no "WM_REDO". Do nothing + // There is no "WM_REDO" in EDIT control break; } if (ToolBase::pointSP != 0) // drawing something? diff --git a/base/applications/mspaint/winproc.h b/base/applications/mspaint/winproc.h index 71fe89282d2..7984057184d 100644 --- a/base/applications/mspaint/winproc.h +++ b/base/applications/mspaint/winproc.h @@ -35,6 +35,8 @@ public: BOOL GetSaveFileName(IN OUT LPTSTR pszFile, INT cchMaxFile); BOOL ChooseColor(IN OUT COLORREF *prgbColor); VOID TrackPopupMenu(POINT ptScreen, INT iSubMenu); + BOOL CanUndo() const; + BOOL CanRedo() const; private: HMENU m_hMenu;
1 year, 4 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Simplify SelectionModel::StretchSkew
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b5335fb90b9ca59aa015c…
commit b5335fb90b9ca59aa015c5de71df7d305ea1d441 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 19 14:11:16 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Jun 19 14:11:16 2023 +0900 [MSPAINT] Simplify SelectionModel::StretchSkew ...and omit cloning HBITMAP in SelectionModel::InsertFromHBITMAP. CORE-18867 --- base/applications/mspaint/selectionmodel.cpp | 54 ++++++++++++++-------------- base/applications/mspaint/winproc.cpp | 1 - 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/base/applications/mspaint/selectionmodel.cpp b/base/applications/mspaint/selectionmodel.cpp index e14adddc0c2..13546bc790c 100644 --- a/base/applications/mspaint/selectionmodel.cpp +++ b/base/applications/mspaint/selectionmodel.cpp @@ -212,7 +212,7 @@ void SelectionModel::Landing() void SelectionModel::InsertFromHBITMAP(HBITMAP hbmColor, INT x, INT y, HBITMAP hbmMask) { ::DeleteObject(m_hbmColor); - m_hbmColor = CopyDIBImage(hbmColor); + m_hbmColor = hbmColor; m_rc.left = x; m_rc.top = y; @@ -222,7 +222,7 @@ void SelectionModel::InsertFromHBITMAP(HBITMAP hbmColor, INT x, INT y, HBITMAP h if (hbmMask) { ::DeleteObject(m_hbmMask); - m_hbmMask = CopyMonoImage(hbmMask); + m_hbmMask = hbmMask; } else { @@ -332,6 +332,14 @@ void SelectionModel::RotateNTimes90Degrees(int iN) NotifyContentChanged(); } +static void AttachHBITMAP(HBITMAP *phbm, HBITMAP hbmNew) +{ + if (hbmNew == NULL) + return; + ::DeleteObject(*phbm); + *phbm = hbmNew; +} + void SelectionModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX, int nSkewDegY) { if (nStretchPercentX == 100 && nStretchPercentY == 100 && nSkewDegX == 0 && nSkewDegY == 0) @@ -339,54 +347,46 @@ void SelectionModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int TakeOff(); - INT oldWidth = m_rc.Width(); - INT oldHeight = m_rc.Height(); + INT oldWidth = m_rc.Width(), oldHeight = m_rc.Height(); INT newWidth = oldWidth * nStretchPercentX / 100; INT newHeight = oldHeight * nStretchPercentY / 100; - HBITMAP hbmColor, hbmMask; - HGDIOBJ hbmOld; + HBITMAP hbmColor = m_hbmColor, hbmMask = m_hbmMask; - if (m_hbmMask == NULL) - m_hbmMask = CreateMonoBitmap(newWidth, newHeight, TRUE); + if (hbmMask == NULL) + hbmMask = CreateMonoBitmap(oldWidth, oldHeight, TRUE); if (oldWidth != newWidth || oldHeight != newHeight) { - hbmColor = CopyDIBImage(m_hbmColor, newWidth, newHeight); - hbmMask = CopyMonoImage(m_hbmMask, newWidth, newHeight); - InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); - ::DeleteObject(hbmColor); - ::DeleteObject(hbmMask); + AttachHBITMAP(&hbmColor, CopyDIBImage(hbmColor, newWidth, newHeight)); + AttachHBITMAP(&hbmMask, CopyMonoImage(hbmMask, newWidth, newHeight)); } + HGDIOBJ hbmOld; HDC hDC = ::CreateCompatibleDC(NULL); if (nSkewDegX) { - hbmOld = ::SelectObject(hDC, m_hbmColor); - hbmColor = SkewDIB(hDC, m_hbmColor, nSkewDegX, FALSE); - ::SelectObject(hDC, m_hbmMask); - hbmMask = SkewDIB(hDC, m_hbmMask, nSkewDegX, FALSE, TRUE); + hbmOld = ::SelectObject(hDC, hbmColor); + AttachHBITMAP(&hbmColor, SkewDIB(hDC, hbmColor, nSkewDegX, FALSE)); + ::SelectObject(hDC, hbmMask); + AttachHBITMAP(&hbmMask, SkewDIB(hDC, hbmMask, nSkewDegX, FALSE, TRUE)); ::SelectObject(hDC, hbmOld); - InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); - ::DeleteObject(hbmColor); - ::DeleteObject(hbmMask); } if (nSkewDegY) { - hbmOld = ::SelectObject(hDC, m_hbmColor); - hbmColor = SkewDIB(hDC, m_hbmColor, nSkewDegY, TRUE); - ::SelectObject(hDC, m_hbmMask); - hbmMask = SkewDIB(hDC, m_hbmMask, nSkewDegY, TRUE, TRUE); + hbmOld = ::SelectObject(hDC, hbmColor); + AttachHBITMAP(&hbmColor, SkewDIB(hDC, hbmColor, nSkewDegY, TRUE)); + ::SelectObject(hDC, hbmMask); + AttachHBITMAP(&hbmMask, SkewDIB(hDC, hbmMask, nSkewDegY, TRUE, TRUE)); ::SelectObject(hDC, hbmOld); - InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); - ::DeleteObject(hbmColor); - ::DeleteObject(hbmMask); } ::DeleteDC(hDC); + InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); + m_bShow = TRUE; NotifyContentChanged(); } diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index 7a22b153794..3ac4b5b60d8 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -844,7 +844,6 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH if (hbmNew) { InsertSelectionFromHBITMAP(hbmNew, m_hWnd); - DeleteObject(hbmNew); } } break;
1 year, 4 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Delete useless CTextEditWindow::m_nAppIsMovingOrSizing
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7bb0561c2d1142fc4451d…
commit 7bb0561c2d1142fc4451dd32975772456c495ef0 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 19 13:46:16 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Jun 19 13:47:24 2023 +0900 [MSPAINT] Delete useless CTextEditWindow::m_nAppIsMovingOrSizing CORE-18867 --- base/applications/mspaint/textedit.cpp | 8 +++----- base/applications/mspaint/textedit.h | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/base/applications/mspaint/textedit.cpp b/base/applications/mspaint/textedit.cpp index 8ec1155d1c9..dcc21ab2a66 100644 --- a/base/applications/mspaint/textedit.cpp +++ b/base/applications/mspaint/textedit.cpp @@ -14,7 +14,9 @@ CTextEditWindow textEditWindow; /* FUNCTIONS ********************************************************/ -CTextEditWindow::CTextEditWindow() : m_hFont(NULL), m_hFontZoomed(NULL), m_nAppIsMovingOrSizing(0) +CTextEditWindow::CTextEditWindow() + : m_hFont(NULL) + , m_hFontZoomed(NULL) { SetRectEmpty(&m_rc); } @@ -77,9 +79,7 @@ void CTextEditWindow::FixEditPos(LPCTSTR pszOldText) ::GetClientRect(m_hwndParent, &rcParent); IntersectRect(&rc, &rcParent, &rcWnd); - ++m_nAppIsMovingOrSizing; MoveWindow(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE); - --m_nAppIsMovingOrSizing; DefWindowProc(WM_HSCROLL, SB_LEFT, 0); DefWindowProc(WM_VSCROLL, SB_TOP, 0); @@ -383,9 +383,7 @@ void CTextEditWindow::ValidateEditRect(LPCRECT prc OPTIONAL) CRect rc = m_rc; canvasWindow.ImageToCanvas(rc); - ++m_nAppIsMovingOrSizing; MoveWindow(rc.left, rc.top, rc.Width(), rc.Height(), TRUE); - --m_nAppIsMovingOrSizing; } LRESULT CTextEditWindow::OnMoving(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) diff --git a/base/applications/mspaint/textedit.h b/base/applications/mspaint/textedit.h index 7060919cae6..798ae1951fb 100644 --- a/base/applications/mspaint/textedit.h +++ b/base/applications/mspaint/textedit.h @@ -81,7 +81,6 @@ protected: HWND m_hwndParent; HFONT m_hFont; HFONT m_hFontZoomed; - LONG m_nAppIsMovingOrSizing; RECT m_rc; INT DoHitTest(RECT& rc, POINT pt);
1 year, 4 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Follow-up Part 2 of Realize Masked Skew (96d3883)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fdba69be7c64d4a46d977…
commit fdba69be7c64d4a46d977a1219d3f1c94115831f Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 19 10:11:35 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Jun 19 10:11:35 2023 +0900 [MSPAINT] Follow-up Part 2 of Realize Masked Skew (96d3883) CORE-18867 --- base/applications/mspaint/selectionmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/mspaint/selectionmodel.cpp b/base/applications/mspaint/selectionmodel.cpp index 609d2ffd59c..e14adddc0c2 100644 --- a/base/applications/mspaint/selectionmodel.cpp +++ b/base/applications/mspaint/selectionmodel.cpp @@ -378,7 +378,7 @@ void SelectionModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int hbmOld = ::SelectObject(hDC, m_hbmColor); hbmColor = SkewDIB(hDC, m_hbmColor, nSkewDegY, TRUE); ::SelectObject(hDC, m_hbmMask); - hbmMask = SkewDIB(hDC, m_hbmColor, nSkewDegY, TRUE, TRUE); + hbmMask = SkewDIB(hDC, m_hbmMask, nSkewDegY, TRUE, TRUE); ::SelectObject(hDC, hbmOld); InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); ::DeleteObject(hbmColor);
1 year, 4 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Improve Japanese (ja-JP) translation (IDS_CANTPASTE)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2661b2db61454a9e51aac…
commit 2661b2db61454a9e51aac224872f34a895ecd193 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 19 10:07:30 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Jun 19 10:08:04 2023 +0900 [MSPAINT] Improve Japanese (ja-JP) translation (IDS_CANTPASTE) CORE-18867 --- base/applications/mspaint/lang/ja-JP.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/mspaint/lang/ja-JP.rc b/base/applications/mspaint/lang/ja-JP.rc index 498c603aa55..f3d77b11507 100644 --- a/base/applications/mspaint/lang/ja-JP.rc +++ b/base/applications/mspaint/lang/ja-JP.rc @@ -261,5 +261,5 @@ BEGIN IDS_UNDERLINE "下線" IDS_VERTICAL "縦書き" IDS_PRINTRES "%d x %d ピクセル/cm" - IDS_CANTPASTE "申し訳ありませんが、このデータを貼り付けできません。データ形式が間違っているか、対応していません。" + IDS_CANTPASTE "クリップボードからの貼り付けに失敗しました。データ形式が間違っているか、未対応です。" END
1 year, 4 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Follow-up of Realize Masked Skew (9afcbea)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=96d388368696b481b5e28…
commit 96d388368696b481b5e280898e7d788244d3976a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 19 10:00:39 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Jun 19 10:00:39 2023 +0900 [MSPAINT] Follow-up of Realize Masked Skew (9afcbea) CORE-18867 --- base/applications/mspaint/dib.cpp | 2 +- base/applications/mspaint/selectionmodel.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base/applications/mspaint/dib.cpp b/base/applications/mspaint/dib.cpp index d72136f79d6..e2886e80a79 100644 --- a/base/applications/mspaint/dib.cpp +++ b/base/applications/mspaint/dib.cpp @@ -101,7 +101,7 @@ HBITMAP CopyMonoImage(HBITMAP hbm, INT cx, INT cy) HGDIOBJ hbm2Old = SelectObject(hdc2, hbmNew); StretchBlt(hdc2, 0, 0, cx, cy, hdc1, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); SelectObject(hdc1, hbm1Old); - SelectObject(hdc1, hbm2Old); + SelectObject(hdc2, hbm2Old); DeleteDC(hdc1); DeleteDC(hdc2); return hbmNew; diff --git a/base/applications/mspaint/selectionmodel.cpp b/base/applications/mspaint/selectionmodel.cpp index b96213313b1..609d2ffd59c 100644 --- a/base/applications/mspaint/selectionmodel.cpp +++ b/base/applications/mspaint/selectionmodel.cpp @@ -367,8 +367,8 @@ void SelectionModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int hbmColor = SkewDIB(hDC, m_hbmColor, nSkewDegX, FALSE); ::SelectObject(hDC, m_hbmMask); hbmMask = SkewDIB(hDC, m_hbmMask, nSkewDegX, FALSE, TRUE); - InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); ::SelectObject(hDC, hbmOld); + InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); ::DeleteObject(hbmColor); ::DeleteObject(hbmMask); } @@ -379,8 +379,8 @@ void SelectionModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int hbmColor = SkewDIB(hDC, m_hbmColor, nSkewDegY, TRUE); ::SelectObject(hDC, m_hbmMask); hbmMask = SkewDIB(hDC, m_hbmColor, nSkewDegY, TRUE, TRUE); - InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); ::SelectObject(hDC, hbmOld); + InsertFromHBITMAP(hbmColor, m_rc.left, m_rc.top, hbmMask); ::DeleteObject(hbmColor); ::DeleteObject(hbmMask); }
1 year, 4 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200