ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2020
----- 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
21 participants
133 discussions
Start a n
N
ew thread
[reactos] 01/01: [BOOTDATA] Add AppliedDPI registry value (#1966)
by Oleg Dubinskiy
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c8464e5717d5ef582c754…
commit c8464e5717d5ef582c754ddf350a15c8cfcd232c Author: Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua> AuthorDate: Thu Jan 2 11:06:18 2020 +0200 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Thu Jan 2 18:06:18 2020 +0900 [BOOTDATA] Add AppliedDPI registry value (#1966) Add AppliedDPI DWORD registry value 0x00000060 (96 DPI) into HKCU\Control Panel\Desktop\WindowMetrics registry key. For now it does nothing, since saving DPI registry settings is not implemented yet. It's required only for ViStart 8 to be started successfully (with MS VB6 Runtime installed and wshom.ocx replaced). CORE-13877 --- boot/bootdata/hivedef.inf | 1 + 1 file changed, 1 insertion(+) diff --git a/boot/bootdata/hivedef.inf b/boot/bootdata/hivedef.inf index cd08b15d3ff..bc8585d0c4c 100644 --- a/boot/bootdata/hivedef.inf +++ b/boot/bootdata/hivedef.inf @@ -83,6 +83,7 @@ HKCU,"Control Panel\Desktop","MenuShowDelay",2,"400" HKCU,"Control Panel\Desktop","WheelScrollLines",2,"3" HKCU,"Control Panel\Desktop","WheelScrollChars",2,"3" +HKCU,"Control Panel\Desktop\WindowMetrics","AppliedDPI",0x00010003,0x00000060 HKCU,"Control Panel\Desktop\WindowMetrics","ScrollWidth",2,"16" HKCU,"Control Panel\Desktop\WindowMetrics","ScrollHeight",2,"16" HKCU,"Control Panel\Desktop\WindowMetrics","CaptionWidth",2,"18"
4 years, 11 months
1
0
0
0
[reactos] 01/01: [FREELDR] Update ACPI Extended Attributes support to 6.3 (#1782)
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fa2e4e953738eebc71ac7…
commit fa2e4e953738eebc71ac707ae7a0c8534e78cd93 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Fri Aug 2 17:39:50 2019 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Jan 1 21:43:28 2020 +0100 [FREELDR] Update ACPI Extended Attributes support to 6.3 (#1782) Update BIOS_MEMORY_MAP and PcMemGetBiosMemoryMap() from ACPI 6.2-A to ACPI 6.3. Co-Authored-By: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> --- boot/freeldr/freeldr/arch/i386/pcmem.c | 11 ++++++++--- boot/freeldr/freeldr/include/arch/pc/pcbios.h | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/boot/freeldr/freeldr/arch/i386/pcmem.c b/boot/freeldr/freeldr/arch/i386/pcmem.c index 3fcab1f6a07..54a88672448 100644 --- a/boot/freeldr/freeldr/arch/i386/pcmem.c +++ b/boot/freeldr/freeldr/arch/i386/pcmem.c @@ -302,7 +302,7 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi if (Regs.x.ecx == 0) { - TRACE("Discard empty entry. (would-be-PcBiosMapCount = %lu)\n", + TRACE("Discarding empty entry. (would-be-PcBiosMapCount = %lu)\n", PcBiosMapCount); goto nextRange; } @@ -332,7 +332,7 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi if (((PBIOS_MEMORY_MAP)BIOSCALLBUFFER)->ExtendedAttributes.Enabled_Reserved == 0) { - WARN("Discard disabled/invalid entry. (would-be-PcBiosMapCount = %lu)\n", + WARN("Discarding disabled/invalid entry. (would-be-PcBiosMapCount = %lu)\n", PcBiosMapCount); /* This unlikely case was correct between ACPI 3.0 and 4.0, so assume all is fine. * Unless we would be ready to drop ACPI 3.0 compatibility. @@ -340,6 +340,11 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi goto nextRange; } + /* + * Other deprecated ExtendedAttributes flags such as NonVolatile_Deprecated_Reserved + * or SlowAccess_Deprecated_Reserved are simply ignored. + */ + /* Copy data to global buffer */ RtlCopyMemory(&PcBiosMemoryMap[PcBiosMapCount], (PVOID)BIOSCALLBUFFER, sizeof(BIOS_MEMORY_MAP)); @@ -362,7 +367,7 @@ PcMemGetBiosMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG MaxMemoryMapSi if (PcBiosMemoryMap[PcBiosMapCount].Length == 0) { - TRACE("Discard empty range. (would-be-PcBiosMapCount = %lu, BaseAddress = 0x%llx, Length = 0)\n", + TRACE("Discarding empty range. (would-be-PcBiosMapCount = %lu, BaseAddress = 0x%llx, Length = 0)\n", PcBiosMapCount, PcBiosMemoryMap[PcBiosMapCount].BaseAddress); goto nextRange; } diff --git a/boot/freeldr/freeldr/include/arch/pc/pcbios.h b/boot/freeldr/freeldr/include/arch/pc/pcbios.h index 804932de9ea..3b03a32dbc7 100644 --- a/boot/freeldr/freeldr/include/arch/pc/pcbios.h +++ b/boot/freeldr/freeldr/include/arch/pc/pcbios.h @@ -46,13 +46,19 @@ typedef struct struct { - // Bit 0. ACPI 3.0. As of ACPI 4.0, became "Reserved -> must be 1". + // Bit 0. ACPI 3.0. + // As of ACPI 4.0, became "Reserved -> must be 1". ULONG Enabled_Reserved : 1; - // Bit 1. ACPI 3.0. As of ACPI 6.1, became "Unimplemented -> Deprecated". - ULONG NonVolatile_Deprecated : 1; - // Bit 2. ACPI 4.0. As of ACPI 6.1, became "Unimplemented -> Deprecated". - ULONG SlowAccess_Deprecated : 1; - // Bit 3. ACPI 4.0. ACPI 5.0-A added "Used only on PC-AT BIOS" (not UEFI). + // Bit 1. ACPI 3.0. + // As of ACPI 6.1, became "Unimplemented -> Deprecated". + // As of ACPI 6.3, became "Reserved -> must be 0". + ULONG NonVolatile_Deprecated_Reserved : 1; + // Bit 2. ACPI 4.0. + // As of ACPI 6.1, became "Unimplemented -> Deprecated". + // As of ACPI 6.3, became "Reserved -> must be 0". + ULONG SlowAccess_Deprecated_Reserved : 1; + // Bit 3. ACPI 4.0. + // ACPI 5.0-A added "Used only on PC-AT BIOS" (not UEFI). ULONG ErrorLog : 1; // Bits 4-31. ACPI 3.0. ULONG Reserved : 28;
4 years, 11 months
1
0
0
0
[reactos] 03/03: [FREELDR] Simplify the PrintText() and FrLdrBugCheckWithMessage() routines by using a new PrintTextV() helper.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=60fbf459c33f6b5829ed2…
commit 60fbf459c33f6b5829ed2cafdf00a8aa53fa1f8c Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Wed Jan 1 21:08:37 2020 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Jan 1 21:15:05 2020 +0100 [FREELDR] Simplify the PrintText() and FrLdrBugCheckWithMessage() routines by using a new PrintTextV() helper. --- boot/freeldr/freeldr/arch/i386/i386bug.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/boot/freeldr/freeldr/arch/i386/i386bug.c b/boot/freeldr/freeldr/arch/i386/i386bug.c index 233b33332ef..f94639650f4 100644 --- a/boot/freeldr/freeldr/arch/i386/i386bug.c +++ b/boot/freeldr/freeldr/arch/i386/i386bug.c @@ -73,17 +73,24 @@ i386PrintText(CHAR *pszText) } static void -PrintText(const CHAR *format, ...) +PrintTextV(const CHAR *Format, va_list args) +{ + CHAR Buffer[512]; + + _vsnprintf(Buffer, sizeof(Buffer), Format, args); + Buffer[sizeof(Buffer) - 1] = ANSI_NULL; + + i386PrintText(Buffer); +} + +static void +PrintText(const CHAR *Format, ...) { va_list argptr; - CHAR buffer[256]; - va_start(argptr, format); - _vsnprintf(buffer, sizeof(buffer), format, argptr); - buffer[sizeof(buffer) - 1] = ANSI_NULL; + va_start(argptr, Format); + PrintTextV(Format, argptr); va_end(argptr); - - i386PrintText(buffer); } static void @@ -187,7 +194,6 @@ FrLdrBugCheckWithMessage( PSTR Format, ...) { - CHAR Buffer[1024]; va_list argptr; MachVideoHideShowTextCursor(FALSE); @@ -205,11 +211,8 @@ FrLdrBugCheckWithMessage( } va_start(argptr, Format); - _vsnprintf(Buffer, sizeof(Buffer), Format, argptr); + PrintTextV(Format, argptr); va_end(argptr); - Buffer[sizeof(Buffer) - 1] = 0; - - i386PrintText(Buffer); _disable(); __halt();
4 years, 11 months
1
0
0
0
[reactos] 02/03: [FREELDR] Reimplement i386PrintText(), adding line wrap handling. CORE-16268
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad43210b41fba808b5e0c…
commit ad43210b41fba808b5e0c5b703eeaeec6ab6c6d5 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Wed Jul 31 15:48:46 2019 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Jan 1 21:14:08 2020 +0100 [FREELDR] Reimplement i386PrintText(), adding line wrap handling. CORE-16268 Co-Authored-By: Stanislav Motylkov <x86corez(a)gmail.com> --- boot/freeldr/freeldr/arch/i386/i386bug.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/boot/freeldr/freeldr/arch/i386/i386bug.c b/boot/freeldr/freeldr/arch/i386/i386bug.c index b0052d7e4b1..233b33332ef 100644 --- a/boot/freeldr/freeldr/arch/i386/i386bug.c +++ b/boot/freeldr/freeldr/arch/i386/i386bug.c @@ -49,21 +49,26 @@ i386PrintChar(CHAR chr, ULONG x, ULONG y) static void i386PrintText(CHAR *pszText) { - char chr; - while (1) - { - chr = *pszText++; + ULONG Width, Unused; + + MachVideoGetDisplaySize(&Width, &Unused, &Unused); - if (chr == 0) break; - if (chr == '\n') + for (; *pszText != ANSI_NULL; ++pszText) + { + if (*pszText == '\n') { - i386_ScreenPosY++; i386_ScreenPosX = 0; + ++i386_ScreenPosY; continue; } - MachVideoPutChar(chr, SCREEN_ATTR, i386_ScreenPosX, i386_ScreenPosY); - i386_ScreenPosX++; + MachVideoPutChar(*pszText, SCREEN_ATTR, i386_ScreenPosX, i386_ScreenPosY); + if (++i386_ScreenPosX >= Width) + { + i386_ScreenPosX = 0; + ++i386_ScreenPosY; + } + // FIXME: Implement vertical screen scrolling if we are at the end of the screen. } }
4 years, 11 months
1
0
0
0
[reactos] 01/03: [FREELDR] xboxcons.c, i386bug.c: Formatting and whitespace fixes.
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=043307624f84881737738…
commit 043307624f84881737738f68c0ea9003d6329783 Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr> AuthorDate: Wed Jul 31 15:39:59 2019 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Jan 1 21:12:24 2020 +0100 [FREELDR] xboxcons.c, i386bug.c: Formatting and whitespace fixes. Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> --- boot/freeldr/freeldr/arch/i386/i386bug.c | 21 +++++++------- boot/freeldr/freeldr/arch/i386/xboxcons.c | 47 +++++++++++++++---------------- 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/boot/freeldr/freeldr/arch/i386/i386bug.c b/boot/freeldr/freeldr/arch/i386/i386bug.c index fd89ddf7873..b0052d7e4b1 100644 --- a/boot/freeldr/freeldr/arch/i386/i386bug.c +++ b/boot/freeldr/freeldr/arch/i386/i386bug.c @@ -9,7 +9,7 @@ typedef struct _FRAME void *Address; } FRAME; -static const char *i386ExceptionDescriptionText[] = +static const CHAR *i386ExceptionDescriptionText[] = { "Exception 00: DIVIDE BY ZERO\n\n", "Exception 01: DEBUG EXCEPTION\n\n", @@ -34,20 +34,20 @@ static const char *i386ExceptionDescriptionText[] = #define SCREEN_ATTR 0x1F // Bright white on blue background +/* Used to store the current X and Y position on the screen */ +static ULONG i386_ScreenPosX = 0; +static ULONG i386_ScreenPosY = 0; + #if 0 static void -i386PrintChar(char chr, ULONG x, ULONG y) +i386PrintChar(CHAR chr, ULONG x, ULONG y) { MachVideoPutChar(chr, SCREEN_ATTR, x, y); } #endif -/* Used to store the current X and Y position on the screen */ -ULONG i386_ScreenPosX = 0; -ULONG i386_ScreenPosY = 0; - static void -i386PrintText(char *pszText) +i386PrintText(CHAR *pszText) { char chr; while (1) @@ -68,15 +68,16 @@ i386PrintText(char *pszText) } static void -PrintText(const char *format, ...) +PrintText(const CHAR *format, ...) { va_list argptr; - char buffer[256]; + CHAR buffer[256]; va_start(argptr, format); _vsnprintf(buffer, sizeof(buffer), format, argptr); - buffer[sizeof(buffer) - 1] = 0; + buffer[sizeof(buffer) - 1] = ANSI_NULL; va_end(argptr); + i386PrintText(buffer); } diff --git a/boot/freeldr/freeldr/arch/i386/xboxcons.c b/boot/freeldr/freeldr/arch/i386/xboxcons.c index 769a8f16b6d..8baba25b5cc 100644 --- a/boot/freeldr/freeldr/arch/i386/xboxcons.c +++ b/boot/freeldr/freeldr/arch/i386/xboxcons.c @@ -25,53 +25,50 @@ static unsigned CurrentAttr = 0x0f; VOID XboxConsPutChar(int c) { - ULONG Width; - ULONG Height; - ULONG Depth; + ULONG Width, Unused; - if ('\r' == c) + if (c == '\r') { - CurrentCursorX = 0; + CurrentCursorX = 0; } - else if ('\n' == c) + else if (c == '\n') { - CurrentCursorX = 0; - CurrentCursorY++; + CurrentCursorX = 0; + CurrentCursorY++; } - else if ('\t' == c) + else if (c == '\t') { - CurrentCursorX = (CurrentCursorX + 8) & ~ 7; + CurrentCursorX = (CurrentCursorX + 8) & ~ 7; } - else + else { - XboxVideoPutChar(c, CurrentAttr, CurrentCursorX, CurrentCursorY); - CurrentCursorX++; + XboxVideoPutChar(c, CurrentAttr, CurrentCursorX, CurrentCursorY); + CurrentCursorX++; } - XboxVideoGetDisplaySize(&Width, &Height, &Depth); - if (Width <= CurrentCursorX) + + XboxVideoGetDisplaySize(&Width, &Unused, &Unused); + if (CurrentCursorX >= Width) { - CurrentCursorX = 0; - CurrentCursorY++; + CurrentCursorX = 0; + CurrentCursorY++; } + // FIXME: Implement vertical screen scrolling if we are at the end of the screen. } BOOLEAN XboxConsKbHit(VOID) { - /* No keyboard support yet */ - return FALSE; + /* No keyboard support yet */ + return FALSE; } int XboxConsGetCh(void) { - /* No keyboard support yet */ - while (1) - { - ; - } + /* No keyboard support yet */ + while (1) ; - return 0; + return 0; } /* EOF */
4 years, 11 months
1
0
0
0
[reactos] 01/01: [WS2_32_APITEST] Add some tests for GetAddrInfoW
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fbf4660f468fb2be2368f…
commit fbf4660f468fb2be2368f783556690e16e1c0f99 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Sat Dec 28 23:52:18 2019 +0300 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Wed Jan 1 18:53:40 2020 +0200 [WS2_32_APITEST] Add some tests for GetAddrInfoW Test results proves WSAStartup call should precede GetAddrInfoW calls. --- modules/rostests/apitests/ws2_32/getaddrinfo.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/rostests/apitests/ws2_32/getaddrinfo.c b/modules/rostests/apitests/ws2_32/getaddrinfo.c index 369c5b3e694..068881a07f5 100644 --- a/modules/rostests/apitests/ws2_32/getaddrinfo.c +++ b/modules/rostests/apitests/ws2_32/getaddrinfo.c @@ -199,7 +199,9 @@ START_TEST(getaddrinfo) WSADATA WsaData; int Error; PADDRINFOA AddrInfo; + PADDRINFOW AddrInfoW; ADDRINFOA Hints; + ADDRINFOW HintsW; CHAR LocalHostName[128]; struct hostent *Hostent; @@ -218,6 +220,9 @@ START_TEST(getaddrinfo) Error = getaddrinfo("127.0.0.1", "80", NULL, &AddrInfo); ok_dec(Error, WSANOTINITIALISED); + Error = GetAddrInfoW(L"127.0.0.1", L"80", NULL, &AddrInfoW); + ok_dec(Error, WSANOTINITIALISED); + Error = WSAStartup(MAKEWORD(2, 2), &WsaData); ok_dec(Error, 0); @@ -239,7 +244,7 @@ START_TEST(getaddrinfo) "Could not determine local address. Following test results may be wrong.\n"); ZeroMemory(&Hints, sizeof(Hints)); - /* parameter tests */ + /* parameter tests for getaddrinfo */ StartSeh() getaddrinfo(NULL, NULL, NULL, NULL); EndSeh(STATUS_ACCESS_VIOLATION); StartSeh() getaddrinfo("", "", &Hints, NULL); EndSeh(STATUS_ACCESS_VIOLATION); StartSeh() @@ -250,6 +255,17 @@ START_TEST(getaddrinfo) ok_ptr(AddrInfo, NULL); EndSeh(STATUS_SUCCESS); + /* parameter tests for GetAddrInfoW */ + StartSeh() GetAddrInfoW(NULL, NULL, NULL, NULL); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() GetAddrInfoW(L"", L"", &HintsW, NULL); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() + AddrInfo = InvalidPointer; + Error = GetAddrInfoW(NULL, NULL, NULL, &AddrInfoW); + ok_dec(Error, WSAHOST_NOT_FOUND); + ok_dec(WSAGetLastError(), WSAHOST_NOT_FOUND); + ok_ptr(AddrInfo, InvalidPointer); /* differs from getaddrinfo */ + EndSeh(STATUS_SUCCESS); + TestNodeName(); TestServiceName(); /* TODO: test passing both node name and service name */ @@ -262,4 +278,7 @@ START_TEST(getaddrinfo) /* not initialized anymore */ Error = getaddrinfo("127.0.0.1", "80", NULL, &AddrInfo); ok_dec(Error, WSANOTINITIALISED); + + Error = GetAddrInfoW(L"127.0.0.1", L"80", NULL, &AddrInfoW); + ok_dec(Error, WSANOTINITIALISED); }
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Total refinement of Gdiplus headers (#2223)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1e83f8b5fd3105f5d17f9…
commit 1e83f8b5fd3105f5d17f9093c060aec6fcc01416 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jan 1 20:28:42 2020 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Jan 1 20:28:42 2020 +0900 [SDK][INCLUDE] Total refinement of Gdiplus headers (#2223) Missing functions added. CORE-16585 --- sdk/include/psdk/gdiplusbase.h | 3 +++ sdk/include/psdk/gdiplusflat.h | 39 ++++++++++++++++++++++++++- sdk/include/psdk/gdiplusgraphics.h | 8 ------ sdk/include/psdk/gdiplusheaders.h | 19 +------------- sdk/include/psdk/gdiplusmetafile.h | 5 ---- sdk/include/psdk/gdipluspath.h | 54 ++++++++++---------------------------- sdk/include/psdk/gdipluspen.h | 8 ------ 7 files changed, 56 insertions(+), 80 deletions(-) diff --git a/sdk/include/psdk/gdiplusbase.h b/sdk/include/psdk/gdiplusbase.h index 7eeb5156b5e..a7fc5431872 100644 --- a/sdk/include/psdk/gdiplusbase.h +++ b/sdk/include/psdk/gdiplusbase.h @@ -79,6 +79,9 @@ getNat(const Font *font); GpFontCollection *& getNat(const FontCollection *fc); +GpFontFamily *& +getNat(const FontFamily *ff); + GpGraphics *& getNat(const Graphics *graphics); diff --git a/sdk/include/psdk/gdiplusflat.h b/sdk/include/psdk/gdiplusflat.h index 462301a75a6..83f4caba954 100644 --- a/sdk/include/psdk/gdiplusflat.h +++ b/sdk/include/psdk/gdiplusflat.h @@ -496,6 +496,8 @@ extern "C" GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *, REAL *); GpStatus WINGDIPAPI + GdipGetEncoderParameterListSize(GpImage *, GDIPCONST CLSID *, UINT *); + GpStatus WINGDIPAPI GdipGetImageDecoders(UINT, UINT, ImageCodecInfo *); GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT *, UINT *); @@ -512,6 +514,8 @@ extern "C" GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics *, PixelOffsetMode *); GpStatus WINGDIPAPI + GdipGetRenderingOrigin(GpGraphics *, INT *, INT *); + GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics *, SmoothingMode *); GpStatus WINGDIPAPI GdipGetTextContrast(GpGraphics *, UINT *); @@ -532,6 +536,8 @@ extern "C" GpStatus WINGDIPAPI GdipIsClipEmpty(GpGraphics *, BOOL *); GpStatus WINGDIPAPI + GdipIsVisibleClipEmpty(GpGraphics *, BOOL *); + GpStatus WINGDIPAPI GdipIsVisiblePoint(GpGraphics *, REAL, REAL, BOOL *); GpStatus WINGDIPAPI GdipIsVisiblePointI(GpGraphics *, INT, INT, BOOL *); @@ -603,6 +609,8 @@ extern "C" GpStatus WINGDIPAPI GdipRotateWorldTransform(GpGraphics *, REAL, GpMatrixOrder); GpStatus WINGDIPAPI + GdipSaveAdd(GpImage *, GDIPCONST EncoderParameters *); + GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics *, GraphicsState *); GpStatus WINGDIPAPI GdipScaleWorldTransform(GpGraphics *, REAL, REAL, GpMatrixOrder); @@ -794,6 +802,8 @@ extern "C" GdipWarpPath(GpPath *, GpMatrix *, GDIPCONST GpPointF *, INT, REAL, REAL, REAL, REAL, WarpMode, REAL); GpStatus WINGDIPAPI GdipWidenPath(GpPath *, GpPen *, GpMatrix *, REAL); + GpStatus WINGDIPAPI + GdipWindingModeOutline(GpPath *, GpMatrix *, REAL); /* HatchBrush */ GpStatus WINGDIPAPI @@ -1071,6 +1081,15 @@ extern "C" GdipSetMetafileDownLevelRasterizationLimit(GpMetafile *, UINT); GpStatus WINGDIPAPI GdipRecordMetafile(HDC, EmfType, GDIPCONST GpRectF *, MetafileFrameUnit, GDIPCONST WCHAR *, GpMetafile **); + GpStatus WINGDIPAPI + GdipRecordMetafileStream( + IStream *, + HDC, + EmfType, + GDIPCONST GpRectF *, + MetafileFrameUnit, + GDIPCONST WCHAR *, + GpMetafile **); /* MetafileHeader */ GpStatus WINGDIPAPI @@ -1125,10 +1144,24 @@ extern "C" GpStatus WINGDIPAPI GdipGetPathGradientRectI(GpPathGradient *, GpRect *); GpStatus WINGDIPAPI + GdipGetPathGradientSurroundColorCount(GpPathGradient *, INT *); + GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient *, ARGB *, INT *); GpStatus WINGDIPAPI + GdipGetPathGradientTransform(GpPathGradient *, GpMatrix *); + GpStatus WINGDIPAPI GdipGetPathGradientWrapMode(GpPathGradient *, GpWrapMode *); GpStatus WINGDIPAPI + GdipMultiplyPathGradientTransform(GpPathGradient *, GDIPCONST GpMatrix *, GpMatrixOrder); + GpStatus WINGDIPAPI + GdipResetPathGradientTransform(GpPathGradient *); + GpStatus WINGDIPAPI + GdipRotatePathGradientTransform(GpPathGradient *, REAL, GpMatrixOrder); + GpStatus WINGDIPAPI + GdipScalePathGradientTransform(GpPathGradient *, REAL, REAL, GpMatrixOrder); + GpStatus WINGDIPAPI + GdipSetPathGradientLinearBlend(GpPathGradient *, REAL, REAL); + GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *, GDIPCONST REAL *, GDIPCONST REAL *, INT); GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient *, ARGB); @@ -1147,9 +1180,11 @@ extern "C" GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient *, GDIPCONST ARGB *, INT *); GpStatus WINGDIPAPI + GdipSetPathGradientTransform(GpPathGradient *, GpMatrix *); + GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(GpPathGradient *, GpWrapMode); GpStatus WINGDIPAPI - GdipGetPathGradientSurroundColorCount(GpPathGradient *, INT *); + GdipTranslatePathGradientTransform(GpPathGradient *, REAL, REAL, GpMatrixOrder); /* PathIterator */ GpStatus WINGDIPAPI @@ -1405,6 +1440,8 @@ extern "C" GpStatus WINGDIPAPI GdipCreateTextureIAI(GpImage *, GDIPCONST GpImageAttributes *, INT, INT, INT, INT, GpTexture **); GpStatus WINGDIPAPI + GdipGetTextureImage(GpTexture *, GpImage **); + GpStatus WINGDIPAPI GdipGetTextureTransform(GpTexture *, GpMatrix *); GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture *, GpWrapMode *); diff --git a/sdk/include/psdk/gdiplusgraphics.h b/sdk/include/psdk/gdiplusgraphics.h index 4f7bfff799f..4704bd57067 100644 --- a/sdk/include/psdk/gdiplusgraphics.h +++ b/sdk/include/psdk/gdiplusgraphics.h @@ -1084,11 +1084,7 @@ class Graphics : public GdiplusBase Status GetRenderingOrigin(INT *x, INT *y) const { -#if 1 - return SetStatus(NotImplemented); // FIXME -#else return SetStatus(DllExports::GdipGetRenderingOrigin(nativeGraphics, x, y)); -#endif } SmoothingMode @@ -1240,13 +1236,9 @@ class Graphics : public GdiplusBase BOOL IsVisibleClipEmpty() const { -#if 1 - return FALSE; // FIXME -#else BOOL flag = FALSE; SetStatus(DllExports::GdipIsVisibleClipEmpty(nativeGraphics, &flag)); return flag; -#endif } Status diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h index d839ce324ff..f78fdaae662 100644 --- a/sdk/include/psdk/gdiplusheaders.h +++ b/sdk/include/psdk/gdiplusheaders.h @@ -84,7 +84,6 @@ class Image : public GdiplusBase GetEncoderParameterList(const CLSID *clsidEncoder, UINT size, EncoderParameters *buffer) { #if 1 - // FIXME: Not available yet return SetStatus(NotImplemented); #else return SetStatus(DllExports::GdipGetEncoderParameterList(nativeImage, clsidEncoder, size, buffer)); @@ -94,14 +93,9 @@ class Image : public GdiplusBase UINT GetEncoderParameterListSize(const CLSID *clsidEncoder) { -#if 1 - // FIXME: Not available yet - return SetStatus(NotImplemented); -#else UINT size = 0; SetStatus(DllExports::GdipGetEncoderParameterListSize(nativeImage, clsidEncoder, &size)); return size; -#endif } UINT @@ -292,12 +286,7 @@ class Image : public GdiplusBase Status SaveAdd(const EncoderParameters *encoderParams) { -#if 1 - // FIXME: Not available yet - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipSaveAdd(nativeImage, encoderParams)); -#endif } Status @@ -1457,10 +1446,8 @@ class CustomLineCap : public GdiplusBase { } - CustomLineCap(GpCustomLineCap *nativeCap, Status status) + CustomLineCap(GpCustomLineCap *cap, Status status) : nativeCap(cap), lastStatus(status) { - lastStatus = status; - SetNativeCap(nativeCap); } void @@ -1494,9 +1481,6 @@ class CustomLineCap : public GdiplusBase inline Image * TextureBrush::GetImage() const { -#if 1 - return NULL; // FIXME -#else GpImage *image = NULL; GpTexture *texture = GetNativeTexture(); SetStatus(DllExports::GdipGetTextureImage(texture, &image)); @@ -1507,7 +1491,6 @@ TextureBrush::GetImage() const if (!newImage) DllExports::GdipDisposeImage(image); return newImage; -#endif } #endif /* _GDIPLUSHEADERS_H */ diff --git a/sdk/include/psdk/gdiplusmetafile.h b/sdk/include/psdk/gdiplusmetafile.h index 9a217200272..126a10501e7 100644 --- a/sdk/include/psdk/gdiplusmetafile.h +++ b/sdk/include/psdk/gdiplusmetafile.h @@ -85,15 +85,10 @@ class Metafile : public Image Metafile(IStream *stream, HDC referenceHdc, EmfType type = EmfTypeEmfPlusDual, const WCHAR *description = NULL) { -#if 1 - // FIXME - SetNativeImage(NULL); -#else GpMetafile *metafile = NULL; lastStatus = DllExports::GdipRecordMetafileStream( stream, referenceHdc, type, NULL, MetafileFrameUnitGdi, description, &metafile); SetNativeImage(metafile); -#endif } Metafile( diff --git a/sdk/include/psdk/gdipluspath.h b/sdk/include/psdk/gdipluspath.h index 2665bccbb0a..1496880decf 100644 --- a/sdk/include/psdk/gdipluspath.h +++ b/sdk/include/psdk/gdipluspath.h @@ -304,7 +304,9 @@ class GraphicsPath : public GdiplusBase const Rect &layoutRect, const StringFormat *format) { - return SetStatus(NotImplemented); + return SetStatus(DllExports::GdipAddPathStringI( + nativePath, string, length, family ? getNat(family) : NULL, style, emSize, &layoutRect, + format ? getNat(format) : NULL)); } Status @@ -317,7 +319,10 @@ class GraphicsPath : public GdiplusBase const PointF &origin, const StringFormat *format) { - return SetStatus(NotImplemented); + RectF rect(origin.X, origin.Y, 0.0f, 0.0f); + return SetStatus(DllExports::GdipAddPathString( + nativePath, string, length, family ? getNat(family) : NULL, style, emSize, &rect, + format ? getNat(format) : NULL)); } Status @@ -330,7 +335,10 @@ class GraphicsPath : public GdiplusBase const Point &origin, const StringFormat *format) { - return SetStatus(NotImplemented); + Rect rect(origin.X, origin.Y, 0, 0); + return SetStatus(DllExports::GdipAddPathStringI( + nativePath, string, length, family ? getNat(family) : NULL, style, emSize, &rect, + format ? getNat(format) : NULL)); } Status @@ -343,7 +351,9 @@ class GraphicsPath : public GdiplusBase const RectF &layoutRect, const StringFormat *format) { - return SetStatus(NotImplemented); + return SetStatus(DllExports::GdipAddPathString( + nativePath, string, length, family ? getNat(family) : NULL, style, emSize, &layoutRect, + format ? getNat(format) : NULL)); } Status @@ -510,12 +520,8 @@ class GraphicsPath : public GdiplusBase Status Outline(const Matrix *matrix, REAL flatness) { -#if 1 - return SetStatus(NotImplemented); // FIXME -#else GpMatrix *nativeMatrix = matrix ? getNat(matrix) : NULL; return SetStatus(DllExports::GdipWindingModeOutline(nativePath, nativeMatrix, flatness)); -#endif } Status @@ -879,11 +885,7 @@ class PathGradientBrush : public Brush Status GetTransform(Matrix *matrix) const { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipGetPathGradientTransform(GetNativeGradient(), getNat(matrix))); -#endif } WrapMode @@ -897,41 +899,25 @@ class PathGradientBrush : public Brush Status MultiplyTransform(Matrix *matrix, MatrixOrder order = MatrixOrderPrepend) { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipMultiplyPathGradientTransform(GetNativeGradient(), getNat(matrix), order)); -#endif } Status ResetTransform() { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipResetPathGradientTransform(GetNativeGradient())); -#endif } Status RotateTransform(REAL angle, MatrixOrder order = MatrixOrderPrepend) { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipRotatePathGradientTransform(GetNativeGradient(), angle, order)); -#endif } Status ScaleTransform(REAL sx, REAL sy, MatrixOrder order = MatrixOrderPrepend) { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipScalePathGradientTransform(GetNativeGradient(), sx, sy, order)); -#endif } Status @@ -950,11 +936,7 @@ class PathGradientBrush : public Brush Status SetBlendTriangularShape(REAL focus, REAL scale = 1.0f) { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipSetPathGradientLinearBlend(GetNativeGradient(), focus, scale)); -#endif } Status @@ -1010,11 +992,7 @@ class PathGradientBrush : public Brush Status SetTransform(const Matrix *matrix) { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipSetPathGradientTransform(GetNativeGradient(), getNat(matrix))); -#endif } Status @@ -1026,11 +1004,7 @@ class PathGradientBrush : public Brush Status TranslateTransform(REAL dx, REAL dy, MatrixOrder order = MatrixOrderPrepend) { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipTranslatePathGradientTransform(GetNativeGradient(), dx, dy, order)); -#endif } protected: diff --git a/sdk/include/psdk/gdipluspen.h b/sdk/include/psdk/gdipluspen.h index 58c08a4ed98..3a55e1496b3 100644 --- a/sdk/include/psdk/gdipluspen.h +++ b/sdk/include/psdk/gdipluspen.h @@ -106,11 +106,7 @@ class Pen : public GdiplusBase if (!customCap) return SetStatus(InvalidParameter); -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipGetPenCustomEndCap(nativePen, &getNat(customCap))); -#endif } Status @@ -226,11 +222,7 @@ class Pen : public GdiplusBase Status MultiplyTransform(Matrix *matrix, MatrixOrder order = MatrixOrderPrepend) { -#if 1 - return SetStatus(NotImplemented); -#else return SetStatus(DllExports::GdipMultiplyPenTransform(nativePen, getNat(matrix), order)); -#endif } Status
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Improve gdiplusgraphics.h (#2222)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=265a890d7c417323aace1…
commit 265a890d7c417323aace1e74386eb78d98f05281 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jan 1 19:10:47 2020 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Jan 1 19:10:47 2020 +0900 [SDK][INCLUDE] Improve gdiplusgraphics.h (#2222) CORE-16585 --- sdk/include/psdk/gdiplusbase.h | 10 ++++ sdk/include/psdk/gdiplusgraphics.h | 102 ++++++++++++++++++--------------- sdk/include/psdk/gdiplusmetafile.h | 7 +++ sdk/include/psdk/gdiplusstringformat.h | 7 +++ 4 files changed, 81 insertions(+), 45 deletions(-) diff --git a/sdk/include/psdk/gdiplusbase.h b/sdk/include/psdk/gdiplusbase.h index 92e3aafc7c5..7eeb5156b5e 100644 --- a/sdk/include/psdk/gdiplusbase.h +++ b/sdk/include/psdk/gdiplusbase.h @@ -61,6 +61,7 @@ class Matrix; class Metafile; class Pen; class Region; +class StringFormat; // get native GpBrush *& @@ -72,6 +73,9 @@ getNat(const CachedBitmap *cb); GpCustomLineCap *& getNat(const CustomLineCap *cap); +GpFont *& +getNat(const Font *font); + GpFontCollection *& getNat(const FontCollection *fc); @@ -90,10 +94,16 @@ getNat(const ImageAttributes *ia); GpMatrix *& getNat(const Matrix *matrix); +GpMetafile *& +getNat(const Metafile *metafile); + GpPen *& getNat(const Pen *pen); GpRegion *& getNat(const Region *region); +GpStringFormat *& +getNat(const StringFormat *sf); + #endif /* _GDIPLUSBASE_H */ diff --git a/sdk/include/psdk/gdiplusgraphics.h b/sdk/include/psdk/gdiplusgraphics.h index d93dd542694..4f7bfff799f 100644 --- a/sdk/include/psdk/gdiplusgraphics.h +++ b/sdk/include/psdk/gdiplusgraphics.h @@ -25,6 +25,7 @@ class Graphics : public GdiplusBase friend class Font; friend class Bitmap; friend class CachedBitmap; + friend class ImageAttributes; public: Graphics(Image *image) @@ -248,7 +249,9 @@ class Graphics : public GdiplusBase INT flags, const Matrix *matrix) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawDriverString( + nativeGraphics, text, length, font ? getNat(font) : NULL, brush ? getNat(brush) : NULL, positions, flags, + matrix ? getNat(matrix) : NULL)); } Status @@ -569,13 +572,17 @@ class Graphics : public GdiplusBase const StringFormat *stringFormat, const Brush *brush) { - return NotImplemented; + return SetStatus(DllExports::GdipDrawString( + nativeGraphics, string, length, font ? getNat(font) : NULL, &layoutRect, + stringFormat ? getNat(stringFormat) : NULL, brush ? brush->nativeBrush : NULL)); } Status DrawString(const WCHAR *string, INT length, const Font *font, const PointF &origin, const Brush *brush) { - return NotImplemented; + RectF rect(origin.X, origin.Y, 0.0f, 0.0f); + return SetStatus(DllExports::GdipDrawString( + nativeGraphics, string, length, font ? getNat(font) : NULL, &rect, NULL, brush ? getNat(brush) : NULL)); } Status @@ -587,7 +594,10 @@ class Graphics : public GdiplusBase const StringFormat *stringFormat, const Brush *brush) { - return NotImplemented; + RectF rect(origin.X, origin.Y, 0.0f, 0.0f); + return SetStatus(DllExports::GdipDrawString( + nativeGraphics, string, length, font ? getNat(font) : NULL, &rect, + stringFormat ? getNat(stringFormat) : NULL, brush ? getNat(brush) : NULL)); } Status @@ -599,12 +609,12 @@ class Graphics : public GdiplusBase Status EnumerateMetafile( const Metafile *metafile, - const Metafile &destPoint, + const PointF &destPoint, EnumerateMetafileProc callback, VOID *callbackData = NULL, - ImageAttributes *imageAttributes = NULL) + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -613,10 +623,10 @@ class Graphics : public GdiplusBase const Point *destPoints, INT count, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -626,10 +636,10 @@ class Graphics : public GdiplusBase const Rect &srcRect, Unit srcUnit, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -638,10 +648,10 @@ class Graphics : public GdiplusBase const PointF *destPoints, INT count, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -649,10 +659,10 @@ class Graphics : public GdiplusBase const Metafile *metafile, const Rect &destRect, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -662,10 +672,10 @@ class Graphics : public GdiplusBase const RectF &srcRect, Unit srcUnit, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -673,23 +683,23 @@ class Graphics : public GdiplusBase const Metafile *metafile, const RectF &destRect, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status EnumerateMetafile( const Metafile *metafile, const PointF &destPoint, - const Rect &srcRect, + const RectF &srcRect, Unit srcUnit, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -700,10 +710,10 @@ class Graphics : public GdiplusBase const Rect &srcRect, Unit srcUnit, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -713,35 +723,35 @@ class Graphics : public GdiplusBase const Rect &srcRect, Unit srcUnit, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status EnumerateMetafile( const Metafile *metafile, - const Point *destPoints, + const PointF *destPoints, INT count, const RectF &srcRect, Unit srcUnit, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status EnumerateMetafile( const Metafile *metafile, - const PointF &destPoint, + const Point &destPoint, EnumerateMetafileProc callback, - VOID *callbackData, - ImageAttributes *imageAttributes) + VOID *callbackData = NULL, + const ImageAttributes *imageAttributes = NULL) { - return NotImplemented; + return SetStatus(NotImplemented); } Status @@ -1344,7 +1354,7 @@ class Graphics : public GdiplusBase Status Restore(GraphicsState gstate) { - return NotImplemented; + return SetStatus(DllExports::GdipRestoreGraphics(nativeGraphics, gstate)); } Status @@ -1356,7 +1366,9 @@ class Graphics : public GdiplusBase GraphicsState Save() { - return 0; + GraphicsState gstate; + SetStatus(DllExports::GdipSaveGraphics(nativeGraphics, &gstate)); + return gstate; } Status diff --git a/sdk/include/psdk/gdiplusmetafile.h b/sdk/include/psdk/gdiplusmetafile.h index ca9336281b9..9a217200272 100644 --- a/sdk/include/psdk/gdiplusmetafile.h +++ b/sdk/include/psdk/gdiplusmetafile.h @@ -242,6 +242,13 @@ class Metafile : public Image { return static_cast<GpMetafile *>(nativeImage); } + + // get native + friend inline GpMetafile *& + getNat(const Metafile *metafile) + { + return reinterpret_cast<GpMetafile *&>(const_cast<Metafile *>(metafile)->nativeImage); + } }; #endif /* _GDIPLUSMETAFILE_H */ diff --git a/sdk/include/psdk/gdiplusstringformat.h b/sdk/include/psdk/gdiplusstringformat.h index b94f06fff4c..471cb7d6e62 100644 --- a/sdk/include/psdk/gdiplusstringformat.h +++ b/sdk/include/psdk/gdiplusstringformat.h @@ -211,6 +211,13 @@ class StringFormat : public GdiplusBase lastStatus = status; return status; } + + // get native + friend inline GpStringFormat *& + getNat(const StringFormat *sf) + { + return const_cast<StringFormat *>(sf)->nativeFormat; + } }; #endif /* _GDIPLUSSTRINGFORMAT_H */
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Improve gdiplusmetafile.h (#2221)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=91f3c8f81aeaae573852b…
commit 91f3c8f81aeaae573852b7d5ea298c3d623deb0d Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jan 1 17:06:34 2020 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Jan 1 17:06:34 2020 +0900 [SDK][INCLUDE] Improve gdiplusmetafile.h (#2221) CORE-16585 --- sdk/include/psdk/gdiplusmetafile.h | 151 ++++++++++++++++++++++++++++--------- 1 file changed, 114 insertions(+), 37 deletions(-) diff --git a/sdk/include/psdk/gdiplusmetafile.h b/sdk/include/psdk/gdiplusmetafile.h index cc59e23abf6..ca9336281b9 100644 --- a/sdk/include/psdk/gdiplusmetafile.h +++ b/sdk/include/psdk/gdiplusmetafile.h @@ -22,148 +22,225 @@ class Metafile : public Image { public: - Metafile(HDC referenceHdc, EmfType type, const WCHAR *description) + Metafile(HDC referenceHdc, EmfType type = EmfTypeEmfPlusDual, const WCHAR *description = NULL) { + GpMetafile *metafile = NULL; + lastStatus = + DllExports::GdipRecordMetafile(referenceHdc, type, NULL, MetafileFrameUnitGdi, description, &metafile); + SetNativeImage(metafile); } Metafile(const WCHAR *filename) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipCreateMetafileFromFile(filename, &metafile); + SetNativeImage(metafile); } Metafile( HDC referenceHdc, const RectF &frameRect, - MetafileFrameUnit frameUnit, - EmfType type, - const WCHAR *description) + MetafileFrameUnit frameUnit = MetafileFrameUnitGdi, + EmfType type = EmfTypeEmfPlusDual, + const WCHAR *description = NULL) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipRecordMetafile(referenceHdc, type, &frameRect, frameUnit, description, &metafile); + SetNativeImage(metafile); } - Metafile(HMETAFILE hWmf, const WmfPlaceableFileHeader *wmfPlaceableFileHeader, BOOL deleteWmf) + Metafile(HMETAFILE hWmf, const WmfPlaceableFileHeader *wmfPlaceableFileHeader, BOOL deleteWmf = FALSE) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipCreateMetafileFromWmf(hWmf, deleteWmf, wmfPlaceableFileHeader, &metafile); + SetNativeImage(metafile); } Metafile( const WCHAR *fileName, HDC referenceHdc, const Rect &frameRect, - MetafileFrameUnit frameUnit, - EmfType type, - const WCHAR *description) + MetafileFrameUnit frameUnit = MetafileFrameUnitGdi, + EmfType type = EmfTypeEmfPlusDual, + const WCHAR *description = NULL) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipRecordMetafileFileNameI( + fileName, referenceHdc, type, &frameRect, frameUnit, description, &metafile); + SetNativeImage(metafile); } Metafile( IStream *stream, HDC referenceHdc, const RectF &frameRect, - MetafileFrameUnit frameUnit, - EmfType type, - const WCHAR *description) + MetafileFrameUnit frameUnit = MetafileFrameUnitGdi, + EmfType type = EmfTypeEmfPlusDual, + const WCHAR *description = NULL) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipRecordMetafile(referenceHdc, type, &frameRect, frameUnit, description, &metafile); + SetNativeImage(metafile); } - Metafile(IStream *stream, HDC referenceHdc, EmfType type, const WCHAR *description) + Metafile(IStream *stream, HDC referenceHdc, EmfType type = EmfTypeEmfPlusDual, const WCHAR *description = NULL) { +#if 1 + // FIXME + SetNativeImage(NULL); +#else + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipRecordMetafileStream( + stream, referenceHdc, type, NULL, MetafileFrameUnitGdi, description, &metafile); + SetNativeImage(metafile); +#endif } Metafile( IStream *stream, HDC referenceHdc, const Rect &frameRect, - MetafileFrameUnit frameUnit, - EmfType type, - const WCHAR *description) + MetafileFrameUnit frameUnit = MetafileFrameUnitGdi, + EmfType type = EmfTypeEmfPlusDual, + const WCHAR *description = NULL) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipRecordMetafileI(referenceHdc, type, &frameRect, frameUnit, description, &metafile); + SetNativeImage(metafile); } Metafile( const WCHAR *fileName, HDC referenceHdc, const RectF &frameRect, - MetafileFrameUnit frameUnit, - EmfType type, - const WCHAR *description) + MetafileFrameUnit frameUnit = MetafileFrameUnitGdi, + EmfType type = EmfTypeEmfPlusDual, + const WCHAR *description = NULL) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipRecordMetafileFileName( + fileName, referenceHdc, type, &frameRect, frameUnit, description, &metafile); + SetNativeImage(metafile); } - Metafile(const WCHAR *fileName, HDC referenceHdc, EmfType type, const WCHAR *description) + Metafile( + const WCHAR *fileName, + HDC referenceHdc, + EmfType type = EmfTypeEmfPlusDual, + const WCHAR *description = NULL) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipRecordMetafileFileName( + fileName, referenceHdc, type, NULL, MetafileFrameUnitGdi, description, &metafile); + SetNativeImage(metafile); } Metafile(IStream *stream) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipCreateMetafileFromStream(stream, &metafile); + SetNativeImage(metafile); } - Metafile(HENHMETAFILE hEmf, BOOL deleteEmf) + Metafile(HENHMETAFILE hEmf, BOOL deleteEmf = FALSE) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipCreateMetafileFromEmf(hEmf, deleteEmf, &metafile); + SetNativeImage(metafile); } Metafile( HDC referenceHdc, const Rect &frameRect, - MetafileFrameUnit frameUnit, - EmfType type, - const WCHAR *description) + MetafileFrameUnit frameUnit = MetafileFrameUnitGdi, + EmfType type = EmfTypeEmfPlusDual, + const WCHAR *description = NULL) { + GpMetafile *metafile = NULL; + lastStatus = DllExports::GdipRecordMetafileI(referenceHdc, type, &frameRect, frameUnit, description, &metafile); + SetNativeImage(metafile); } static UINT - EmfToWmfBits(HENHMETAFILE hemf, UINT cbData16, LPBYTE pData16, INT iMapMode, EmfToWmfBitsFlags eFlags) + EmfToWmfBits( + HENHMETAFILE hemf, + UINT cbData16, + LPBYTE pData16, + INT iMapMode = MM_ANISOTROPIC, + EmfToWmfBitsFlags eFlags = EmfToWmfBitsFlagsDefault) { - return 0; + return DllExports::GdipEmfToWmfBits(hemf, cbData16, pData16, iMapMode, eFlags); } - UINT GetDownLevelRasterizationLimit(VOID) + UINT + GetDownLevelRasterizationLimit() const { - return 0; +#if 1 + return 0; // FIXME +#else + UINT metafileRasterizationLimitDpi = 0; + SetStatus(DllExports::GdipGetMetafileDownLevelRasterizationLimit( + GetNativeMetafile(), &metafileRasterizationLimitDpi)); + return metafileRasterizationLimitDpi; +#endif } - HENHMETAFILE GetHENHMETAFILE(VOID) + HENHMETAFILE + GetHENHMETAFILE() const { - return NULL; + HENHMETAFILE hEmf; + SetStatus(DllExports::GdipGetHemfFromMetafile(GetNativeMetafile(), &hEmf)); + return hEmf; } static Status GetMetafileHeader(const WCHAR *filename, MetafileHeader *header) { - return NotImplemented; + return DllExports::GdipGetMetafileHeaderFromFile(filename, header); } static Status - GetMetafileHeader(HENHMETAFILE *hEmf, MetafileHeader *header) + GetMetafileHeader(HENHMETAFILE hEmf, MetafileHeader *header) { - return NotImplemented; + return DllExports::GdipGetMetafileHeaderFromEmf(hEmf, header); } static Status GetMetafileHeader(HMETAFILE hWmf, const WmfPlaceableFileHeader *wmfPlaceableFileHeader, MetafileHeader *header) { - return NotImplemented; + return DllExports::GdipGetMetafileHeaderFromWmf(hWmf, wmfPlaceableFileHeader, header); } Status GetMetafileHeader(MetafileHeader *header) const { - return NotImplemented; + return SetStatus(DllExports::GdipGetMetafileHeaderFromMetafile(GetNativeMetafile(), header)); } static Status GetMetafileHeader(IStream *stream, MetafileHeader *header) { - return NotImplemented; + return DllExports::GdipGetMetafileHeaderFromStream(stream, header); } Status PlayRecord(EmfPlusRecordType recordType, UINT flags, UINT dataSize, const BYTE *data) { - return NotImplemented; + return SetStatus(DllExports::GdipPlayMetafileRecord(GetNativeMetafile(), recordType, flags, dataSize, data)); } Status SetDownLevelRasterizationLimit(UINT metafileRasterizationLimitDpi) { - return NotImplemented; + return SetStatus( + DllExports::GdipSetMetafileDownLevelRasterizationLimit(GetNativeMetafile(), metafileRasterizationLimitDpi)); + } + + protected: + GpMetafile * + GetNativeMetafile() const + { + return static_cast<GpMetafile *>(nativeImage); } };
4 years, 11 months
1
0
0
0
[reactos] 01/01: [SDK][INCLUDE] Improve gdiplusmatrix.h (#2220)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f48a01324c82341a3bc79…
commit f48a01324c82341a3bc79815fc3e3bf5f7b81275 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jan 1 16:48:52 2020 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Jan 1 16:48:52 2020 +0900 [SDK][INCLUDE] Improve gdiplusmatrix.h (#2220) CORE-16585 --- sdk/include/psdk/gdiplusmatrix.h | 62 ++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/sdk/include/psdk/gdiplusmatrix.h b/sdk/include/psdk/gdiplusmatrix.h index 124b070a9e4..f959dc9d07a 100644 --- a/sdk/include/psdk/gdiplusmatrix.h +++ b/sdk/include/psdk/gdiplusmatrix.h @@ -50,7 +50,7 @@ class Matrix : public GdiplusBase } Matrix * - Clone() + Clone() const { GpMatrix *cloneMatrix = NULL; SetStatus(DllExports::GdipCloneMatrix(nativeMatrix, &cloneMatrix)); @@ -58,7 +58,11 @@ class Matrix : public GdiplusBase if (lastStatus != Ok) return NULL; - return new Matrix(cloneMatrix); + Matrix *newMatrix = new Matrix(cloneMatrix); + if (!newMatrix) + DllExports::GdipDeleteMatrix(cloneMatrix); + + return newMatrix; } ~Matrix() @@ -67,7 +71,7 @@ class Matrix : public GdiplusBase } BOOL - Equals(const Matrix *matrix) + Equals(const Matrix *matrix) const { BOOL result; SetStatus(DllExports::GdipIsMatrixEqual(nativeMatrix, matrix ? getNat(matrix) : NULL, &result)); @@ -93,7 +97,7 @@ class Matrix : public GdiplusBase } BOOL - IsIdentity() + IsIdentity() const { BOOL result; SetStatus(DllExports::GdipIsMatrixIdentity(nativeMatrix, &result)); @@ -101,7 +105,7 @@ class Matrix : public GdiplusBase } BOOL - IsInvertible() + IsInvertible() const { BOOL result; SetStatus(DllExports::GdipIsMatrixInvertible(nativeMatrix, &result)); @@ -109,40 +113,60 @@ class Matrix : public GdiplusBase } Status - Multiply(const Matrix *matrix, MatrixOrder order) + Multiply(const Matrix *matrix, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipMultiplyMatrix(nativeMatrix, matrix ? getNat(matrix) : NULL, order)); } - REAL OffsetX(VOID) + REAL + OffsetX() const { - return 0; + REAL elements[6]; + if (GetElements(elements) == Ok) + return elements[4]; + return 0.0f; } - REAL OffsetY(VOID) + REAL + OffsetY() const { - return 0; + REAL elements[6]; + if (GetElements(elements) == Ok) + return elements[5]; + return 0.0f; } - Status Reset(VOID) + Status + Reset() { - return NotImplemented; + return SetStatus(DllExports::GdipSetMatrixElements(nativeMatrix, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0)); } Status - Rotate(REAL angle, MatrixOrder order) + Rotate(REAL angle, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order)); } Status - RotateAt(REAL angle, const PointF ¢er, MatrixOrder order) - { - return NotImplemented; + RotateAt(REAL angle, const PointF ¢er, MatrixOrder order = MatrixOrderPrepend) + { + if (order == MatrixOrderPrepend) + { + SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, center.X, center.Y, order)); + SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order)); + return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, -center.X, -center.Y, order)); + } + else + { + SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, -center.X, -center.Y, order)); + SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order)); + return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, center.X, center.Y, order)); + } } Status - Scale(REAL scaleX, REAL scaleY, MatrixOrder order) + Scale(REAL scaleX, REAL scaleY, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipScaleMatrix(nativeMatrix, scaleX, scaleY, order)); } @@ -154,7 +178,7 @@ class Matrix : public GdiplusBase } Status - Shear(REAL shearX, REAL shearY, MatrixOrder order) + Shear(REAL shearX, REAL shearY, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipShearMatrix(nativeMatrix, shearX, shearY, order)); } @@ -184,7 +208,7 @@ class Matrix : public GdiplusBase } Status - Translate(REAL offsetX, REAL offsetY, MatrixOrder order) + Translate(REAL offsetX, REAL offsetY, MatrixOrder order = MatrixOrderPrepend) { return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, offsetX, offsetY, order)); }
4 years, 11 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200