From 7885d994ff3ad7270ff274f43e1c1c05b0044909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Fri, 10 Nov 2006 18:20:00 +0000 Subject: [PATCH] Move some files to subdirectories. No code change. svn path=/trunk/; revision=24717 --- reactos/base/setup/usetup/interface/consup.c | 506 ++++++++++++++++++ reactos/base/setup/usetup/interface/consup.h | 155 ++++++ .../setup/usetup/{ => interface}/usetup.c | 0 .../setup/usetup/{ => native/utils}/console.c | 470 ---------------- .../setup/usetup/{ => native/utils}/console.h | 122 +---- .../usetup/{ => native/utils}/keytrans.c | 0 .../usetup/{ => native/utils}/keytrans.h | 0 reactos/base/setup/usetup/usetup.h | 5 +- reactos/base/setup/usetup/usetup.rbuild | 13 +- 9 files changed, 682 insertions(+), 589 deletions(-) create mode 100644 reactos/base/setup/usetup/interface/consup.c create mode 100644 reactos/base/setup/usetup/interface/consup.h rename reactos/base/setup/usetup/{ => interface}/usetup.c (100%) rename reactos/base/setup/usetup/{ => native/utils}/console.c (59%) rename reactos/base/setup/usetup/{ => native/utils}/console.h (74%) rename reactos/base/setup/usetup/{ => native/utils}/keytrans.c (100%) rename reactos/base/setup/usetup/{ => native/utils}/keytrans.h (100%) diff --git a/reactos/base/setup/usetup/interface/consup.c b/reactos/base/setup/usetup/interface/consup.c new file mode 100644 index 00000000000..c33bff388e7 --- /dev/null +++ b/reactos/base/setup/usetup/interface/consup.c @@ -0,0 +1,506 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS text-mode setup + * FILE: subsys/system/usetup/console.c + * PURPOSE: Console support functions + * PROGRAMMER: Eric Kohl + */ + +/* INCLUDES ******************************************************************/ + +#include "usetup.h" + +#define NDEBUG +#include + +/* FUNCTIONS *****************************************************************/ + +VOID +CONSOLE_ConInKey( + OUT PINPUT_RECORD Buffer) +{ + ULONG Read; + + while (TRUE) + { + ReadConsoleInput(StdInput, Buffer, 1, &Read); + + if ((Buffer->EventType == KEY_EVENT) + && (Buffer->Event.KeyEvent.bKeyDown == TRUE)) + break; + } +} + +VOID +CONSOLE_ConOutChar( + IN CHAR c) +{ + ULONG Written; + + WriteConsole( + StdOutput, + &c, + 1, + &Written, + NULL); +} + +VOID +CONSOLE_ConOutPuts( + IN LPCSTR szText) +{ + ULONG Written; + + WriteConsole( + StdOutput, + szText, + strlen(szText), + &Written, + NULL); + WriteConsole( + StdOutput, + "\n", + 1, + &Written, + NULL); +} + +VOID +CONSOLE_ConOutPrintf( + IN LPCSTR szFormat, ...) +{ + CHAR szOut[256]; + DWORD dwWritten; + va_list arg_ptr; + + va_start(arg_ptr, szFormat); + vsprintf(szOut, szFormat, arg_ptr); + va_end(arg_ptr); + + WriteConsole( + StdOutput, + szOut, + strlen(szOut), + &dwWritten, + NULL); +} + +SHORT +CONSOLE_GetCursorX(VOID) +{ + CONSOLE_SCREEN_BUFFER_INFO csbi; + + GetConsoleScreenBufferInfo(StdOutput, &csbi); + + return csbi.dwCursorPosition.X; +} + +SHORT +CONSOLE_GetCursorY(VOID) +{ + CONSOLE_SCREEN_BUFFER_INFO csbi; + + GetConsoleScreenBufferInfo(StdOutput, &csbi); + + return csbi.dwCursorPosition.Y; +} + +VOID +CONSOLE_GetScreenSize( + OUT SHORT *maxx, + OUT SHORT *maxy) +{ + CONSOLE_SCREEN_BUFFER_INFO csbi; + + GetConsoleScreenBufferInfo(StdOutput, &csbi); + + *maxx = csbi.dwSize.X; + + *maxy = csbi.dwSize.Y; +} + +VOID +CONSOLE_SetCursorType( + IN BOOL bInsert, + IN BOOL bVisible) +{ + CONSOLE_CURSOR_INFO cci; + + cci.dwSize = bInsert ? 10 : 99; + cci.bVisible = bVisible; + + SetConsoleCursorInfo(StdOutput, &cci); +} + +VOID +CONSOLE_SetCursorXY( + IN SHORT x, + IN SHORT y) +{ + COORD coPos; + + coPos.X = x; + coPos.Y = y; + SetConsoleCursorPosition(StdOutput, coPos); +} + +VOID +CONSOLE_ClearScreen(VOID) +{ + COORD coPos; + ULONG Written; + + coPos.X = 0; + coPos.Y = 0; + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_WHITE | BACKGROUND_BLUE, + xScreen * yScreen, + coPos, + &Written); + + FillConsoleOutputCharacterA( + StdOutput, + ' ', + xScreen * yScreen, + coPos, + &Written); +} + +VOID +CONSOLE_SetStatusText( + IN LPCSTR fmt, ...) +{ + CHAR Buffer[128]; + va_list ap; + COORD coPos; + ULONG Written; + + va_start(ap, fmt); + vsprintf(Buffer, fmt, ap); + va_end(ap); + + coPos.X = 0; + coPos.Y = yScreen - 1; + + FillConsoleOutputAttribute( + StdOutput, + BACKGROUND_WHITE, + xScreen, + coPos, + &Written); + + FillConsoleOutputCharacterA( + StdOutput, + ' ', + xScreen, + coPos, + &Written); + + WriteConsoleOutputCharacterA( + StdOutput, + Buffer, + strlen(Buffer), + coPos, + &Written); +} + +VOID +CONSOLE_InvertTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT col, + IN SHORT row) +{ + COORD coPos; + ULONG Written; + + for (coPos.Y = y; coPos.Y < y + row; coPos.Y++) + { + coPos.X = x; + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_BLUE | BACKGROUND_WHITE, + col, + coPos, + &Written); + } +} + +VOID +CONSOLE_NormalTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT col, + IN SHORT row) +{ + COORD coPos; + ULONG Written; + + for (coPos.Y = y; coPos.Y < y + row; coPos.Y++) + { + coPos.X = x; + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_WHITE | BACKGROUND_BLUE, + col, + coPos, + &Written); + } +} + +VOID +CONSOLE_SetTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text) +{ + COORD coPos; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + WriteConsoleOutputCharacterA( + StdOutput, + Text, + strlen(Text), + coPos, + &Written); +} + +VOID +CONSOLE_SetInputTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCWSTR Text) +{ + COORD coPos; + ULONG Length; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + Length = wcslen(Text); + if (Length > (ULONG)len - 1) + Length = len - 1; + + FillConsoleOutputAttribute( + StdOutput, + BACKGROUND_WHITE, + len, + coPos, + &Written); + + WriteConsoleOutputCharacterW( + StdOutput, + Text, + Length, + coPos, + &Written); + + coPos.X += Length; + FillConsoleOutputCharacterA( + StdOutput, + '_', + 1, + coPos, + &Written); + + if ((ULONG)len > Length + 1) + { + coPos.X++; + FillConsoleOutputCharacterA( + StdOutput, + ' ', + len - Length - 1, + coPos, + &Written); + } +} + +VOID +CONSOLE_SetUnderlinedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text) +{ + COORD coPos; + ULONG Length; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + Length = strlen(Text); + + WriteConsoleOutputCharacterA( + StdOutput, + Text, + Length, + coPos, + &Written); + + coPos.Y++; + FillConsoleOutputCharacterA( + StdOutput, + 0xCD, + Length, + coPos, + &Written); +} + +VOID +CONSOLE_SetInvertedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text) +{ + COORD coPos; + ULONG Length; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + Length = strlen(Text); + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_BLUE | BACKGROUND_WHITE, + Length, + coPos, + &Written); + + WriteConsoleOutputCharacterA( + StdOutput, + Text, + Length, + coPos, + &Written); +} + +VOID +CONSOLE_SetHighlightedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text) +{ + COORD coPos; + ULONG Length; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + Length = strlen(Text); + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_WHITE | FOREGROUND_INTENSITY | BACKGROUND_BLUE, + Length, + coPos, + &Written); + + WriteConsoleOutputCharacterA( + StdOutput, + Text, + Length, + coPos, + &Written); +} + +VOID +CONSOLE_PrintTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR fmt, ...) +{ + CHAR buffer[512]; + va_list ap; + COORD coPos; + ULONG Written; + + va_start(ap, fmt); + vsprintf(buffer, fmt, ap); + va_end(ap); + + coPos.X = x; + coPos.Y = y; + + WriteConsoleOutputCharacterA( + StdOutput, + buffer, + strlen(buffer), + coPos, + &Written); +} + +VOID +CONSOLE_PrintTextXYN( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCSTR fmt, ...) +{ + CHAR buffer[512]; + va_list ap; + COORD coPos; + ULONG Length; + ULONG Written; + + va_start(ap, fmt); + vsprintf(buffer, fmt, ap); + va_end(ap); + + coPos.X = x; + coPos.Y = y; + + Length = strlen(buffer); + if (Length > (ULONG)len - 1) + Length = len - 1; + + WriteConsoleOutputCharacterA( + StdOutput, + buffer, + Length, + coPos, + &Written); + + coPos.X += Length; + + if ((ULONG)len > Length) + { + FillConsoleOutputCharacterA( + StdOutput, + ' ', + len - Length, + coPos, + &Written); + } +} + +/* EOF */ diff --git a/reactos/base/setup/usetup/interface/consup.h b/reactos/base/setup/usetup/interface/consup.h new file mode 100644 index 00000000000..6b4a4c849e9 --- /dev/null +++ b/reactos/base/setup/usetup/interface/consup.h @@ -0,0 +1,155 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS text-mode setup + * FILE: subsys/system/usetup/console.h + * PURPOSE: Console support functions + * PROGRAMMER: Eric Kohl + */ + +#ifndef __CONSUP_H__ +#define __CONSUP_H__ + +#define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE) +#define FOREGROUND_YELLOW (FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN) +#define BACKGROUND_WHITE (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE) + +extern HANDLE StdInput, StdOutput; +extern SHORT xScreen, yScreen; + +#include "../native/utils/console.h" + +VOID +CONSOLE_ClearScreen(VOID); + +VOID +CONSOLE_ConInKey( + OUT PINPUT_RECORD Buffer); + +VOID +CONSOLE_ConOutChar( + IN CHAR c); + +VOID +CONSOLE_ConOutPrintf( + IN LPCSTR szFormat, ...); + +VOID +CONSOLE_ConOutPuts( + IN LPCSTR szText); + +SHORT +CONSOLE_GetCursorX(VOID); + +SHORT +CONSOLE_GetCursorY(VOID); + +VOID +CONSOLE_GetScreenSize( + OUT SHORT *maxx, + OUT SHORT *maxy); + +VOID +CONSOLE_InvertTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT col, + IN SHORT row); + +VOID +CONSOLE_NormalTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT col, + IN SHORT row); + +VOID +CONSOLE_PrintTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR fmt, ...); + +VOID +CONSOLE_PrintTextXYN( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCSTR fmt, ...); + +VOID +CONSOLE_SetCursorType( + IN BOOL bInsert, + IN BOOL bVisible); + +VOID +CONSOLE_SetCursorXY( + IN SHORT x, + IN SHORT y); + +VOID +CONSOLE_SetCursorXY( + IN SHORT x, + IN SHORT y); + +VOID +CONSOLE_SetHighlightedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text); + +VOID +CONSOLE_SetInputTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCWSTR Text); + +VOID +CONSOLE_SetInputTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCWSTR Text); + +VOID +CONSOLE_SetInvertedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text); + +VOID +CONSOLE_SetStatusText( + IN LPCSTR fmt, ...); + +VOID +CONSOLE_SetTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text); + +VOID +CONSOLE_SetUnderlinedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text); + +#endif /* __CONSOLE_H__*/ + +/* EOF */ diff --git a/reactos/base/setup/usetup/usetup.c b/reactos/base/setup/usetup/interface/usetup.c similarity index 100% rename from reactos/base/setup/usetup/usetup.c rename to reactos/base/setup/usetup/interface/usetup.c diff --git a/reactos/base/setup/usetup/console.c b/reactos/base/setup/usetup/native/utils/console.c similarity index 59% rename from reactos/base/setup/usetup/console.c rename to reactos/base/setup/usetup/native/utils/console.c index b3141c6d9c9..e0a176622bf 100644 --- a/reactos/base/setup/usetup/console.c +++ b/reactos/base/setup/usetup/native/utils/console.c @@ -454,474 +454,4 @@ ConSetConsoleTextAttribute( #endif /* !WIN32_USETUP */ -VOID -CONSOLE_ConInKey( - OUT PINPUT_RECORD Buffer) -{ - ULONG Read; - - while (TRUE) - { - ReadConsoleInput(StdInput, Buffer, 1, &Read); - - if ((Buffer->EventType == KEY_EVENT) - && (Buffer->Event.KeyEvent.bKeyDown == TRUE)) - break; - } -} - -VOID -CONSOLE_ConOutChar( - IN CHAR c) -{ - ULONG Written; - - WriteConsole( - StdOutput, - &c, - 1, - &Written, - NULL); -} - -VOID -CONSOLE_ConOutPuts( - IN LPCSTR szText) -{ - ULONG Written; - - WriteConsole( - StdOutput, - szText, - strlen(szText), - &Written, - NULL); - WriteConsole( - StdOutput, - "\n", - 1, - &Written, - NULL); -} - -VOID -CONSOLE_ConOutPrintf( - IN LPCSTR szFormat, ...) -{ - CHAR szOut[256]; - DWORD dwWritten; - va_list arg_ptr; - - va_start(arg_ptr, szFormat); - vsprintf(szOut, szFormat, arg_ptr); - va_end(arg_ptr); - - WriteConsole( - StdOutput, - szOut, - strlen(szOut), - &dwWritten, - NULL); -} - -SHORT -CONSOLE_GetCursorX(VOID) -{ - CONSOLE_SCREEN_BUFFER_INFO csbi; - - GetConsoleScreenBufferInfo(StdOutput, &csbi); - - return csbi.dwCursorPosition.X; -} - -SHORT -CONSOLE_GetCursorY(VOID) -{ - CONSOLE_SCREEN_BUFFER_INFO csbi; - - GetConsoleScreenBufferInfo(StdOutput, &csbi); - - return csbi.dwCursorPosition.Y; -} - -VOID -CONSOLE_GetScreenSize( - OUT SHORT *maxx, - OUT SHORT *maxy) -{ - CONSOLE_SCREEN_BUFFER_INFO csbi; - - GetConsoleScreenBufferInfo(StdOutput, &csbi); - - *maxx = csbi.dwSize.X; - - *maxy = csbi.dwSize.Y; -} - -VOID -CONSOLE_SetCursorType( - IN BOOL bInsert, - IN BOOL bVisible) -{ - CONSOLE_CURSOR_INFO cci; - - cci.dwSize = bInsert ? 10 : 99; - cci.bVisible = bVisible; - - SetConsoleCursorInfo(StdOutput, &cci); -} - -VOID -CONSOLE_SetCursorXY( - IN SHORT x, - IN SHORT y) -{ - COORD coPos; - - coPos.X = x; - coPos.Y = y; - SetConsoleCursorPosition(StdOutput, coPos); -} - -VOID -CONSOLE_ClearScreen(VOID) -{ - COORD coPos; - ULONG Written; - - coPos.X = 0; - coPos.Y = 0; - - FillConsoleOutputAttribute( - StdOutput, - FOREGROUND_WHITE | BACKGROUND_BLUE, - xScreen * yScreen, - coPos, - &Written); - - FillConsoleOutputCharacterA( - StdOutput, - ' ', - xScreen * yScreen, - coPos, - &Written); -} - -VOID -CONSOLE_SetStatusText( - IN LPCSTR fmt, ...) -{ - CHAR Buffer[128]; - va_list ap; - COORD coPos; - ULONG Written; - - va_start(ap, fmt); - vsprintf(Buffer, fmt, ap); - va_end(ap); - - coPos.X = 0; - coPos.Y = yScreen - 1; - - FillConsoleOutputAttribute( - StdOutput, - BACKGROUND_WHITE, - xScreen, - coPos, - &Written); - - FillConsoleOutputCharacterA( - StdOutput, - ' ', - xScreen, - coPos, - &Written); - - WriteConsoleOutputCharacterA( - StdOutput, - Buffer, - strlen(Buffer), - coPos, - &Written); -} - -VOID -CONSOLE_InvertTextXY( - IN SHORT x, - IN SHORT y, - IN SHORT col, - IN SHORT row) -{ - COORD coPos; - ULONG Written; - - for (coPos.Y = y; coPos.Y < y + row; coPos.Y++) - { - coPos.X = x; - - FillConsoleOutputAttribute( - StdOutput, - FOREGROUND_BLUE | BACKGROUND_WHITE, - col, - coPos, - &Written); - } -} - -VOID -CONSOLE_NormalTextXY( - IN SHORT x, - IN SHORT y, - IN SHORT col, - IN SHORT row) -{ - COORD coPos; - ULONG Written; - - for (coPos.Y = y; coPos.Y < y + row; coPos.Y++) - { - coPos.X = x; - - FillConsoleOutputAttribute( - StdOutput, - FOREGROUND_WHITE | BACKGROUND_BLUE, - col, - coPos, - &Written); - } -} - -VOID -CONSOLE_SetTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR Text) -{ - COORD coPos; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - WriteConsoleOutputCharacterA( - StdOutput, - Text, - strlen(Text), - coPos, - &Written); -} - -VOID -CONSOLE_SetInputTextXY( - IN SHORT x, - IN SHORT y, - IN SHORT len, - IN LPCWSTR Text) -{ - COORD coPos; - ULONG Length; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - Length = wcslen(Text); - if (Length > (ULONG)len - 1) - Length = len - 1; - - FillConsoleOutputAttribute( - StdOutput, - BACKGROUND_WHITE, - len, - coPos, - &Written); - - WriteConsoleOutputCharacterW( - StdOutput, - Text, - Length, - coPos, - &Written); - - coPos.X += Length; - FillConsoleOutputCharacterA( - StdOutput, - '_', - 1, - coPos, - &Written); - - if ((ULONG)len > Length + 1) - { - coPos.X++; - FillConsoleOutputCharacterA( - StdOutput, - ' ', - len - Length - 1, - coPos, - &Written); - } -} - -VOID -CONSOLE_SetUnderlinedTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR Text) -{ - COORD coPos; - ULONG Length; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - Length = strlen(Text); - - WriteConsoleOutputCharacterA( - StdOutput, - Text, - Length, - coPos, - &Written); - - coPos.Y++; - FillConsoleOutputCharacterA( - StdOutput, - 0xCD, - Length, - coPos, - &Written); -} - -VOID -CONSOLE_SetInvertedTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR Text) -{ - COORD coPos; - ULONG Length; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - Length = strlen(Text); - - FillConsoleOutputAttribute( - StdOutput, - FOREGROUND_BLUE | BACKGROUND_WHITE, - Length, - coPos, - &Written); - - WriteConsoleOutputCharacterA( - StdOutput, - Text, - Length, - coPos, - &Written); -} - -VOID -CONSOLE_SetHighlightedTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR Text) -{ - COORD coPos; - ULONG Length; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - Length = strlen(Text); - - FillConsoleOutputAttribute( - StdOutput, - FOREGROUND_WHITE | FOREGROUND_INTENSITY | BACKGROUND_BLUE, - Length, - coPos, - &Written); - - WriteConsoleOutputCharacterA( - StdOutput, - Text, - Length, - coPos, - &Written); -} - -VOID -CONSOLE_PrintTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR fmt, ...) -{ - CHAR buffer[512]; - va_list ap; - COORD coPos; - ULONG Written; - - va_start(ap, fmt); - vsprintf(buffer, fmt, ap); - va_end(ap); - - coPos.X = x; - coPos.Y = y; - - WriteConsoleOutputCharacterA( - StdOutput, - buffer, - strlen(buffer), - coPos, - &Written); -} - -VOID -CONSOLE_PrintTextXYN( - IN SHORT x, - IN SHORT y, - IN SHORT len, - IN LPCSTR fmt, ...) -{ - CHAR buffer[512]; - va_list ap; - COORD coPos; - ULONG Length; - ULONG Written; - - va_start(ap, fmt); - vsprintf(buffer, fmt, ap); - va_end(ap); - - coPos.X = x; - coPos.Y = y; - - Length = strlen(buffer); - if (Length > (ULONG)len - 1) - Length = len - 1; - - WriteConsoleOutputCharacterA( - StdOutput, - buffer, - Length, - coPos, - &Written); - - coPos.X += Length; - - if ((ULONG)len > Length) - { - FillConsoleOutputCharacterA( - StdOutput, - ' ', - len - Length, - coPos, - &Written); - } -} - /* EOF */ diff --git a/reactos/base/setup/usetup/console.h b/reactos/base/setup/usetup/native/utils/console.h similarity index 74% rename from reactos/base/setup/usetup/console.h rename to reactos/base/setup/usetup/native/utils/console.h index e6d38f17209..1041dc43a04 100644 --- a/reactos/base/setup/usetup/console.h +++ b/reactos/base/setup/usetup/native/utils/console.h @@ -141,122 +141,16 @@ ConWriteConsoleOutputCharacterA( IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten); +BOOL WINAPI +ConWriteConsoleOutputCharacterW( + HANDLE hConsoleOutput, + IN LPCWSTR lpCharacter, + IN DWORD nLength, + IN COORD dwWriteCoord, + OUT LPDWORD lpNumberOfCharsWritten); + #endif /* !WIN32_USETUP */ -VOID -CONSOLE_ClearScreen(VOID); - -VOID -CONSOLE_ConInKey( - OUT PINPUT_RECORD Buffer); - -VOID -CONSOLE_ConOutChar( - IN CHAR c); - -VOID -CONSOLE_ConOutPrintf( - IN LPCSTR szFormat, ...); - -VOID -CONSOLE_ConOutPuts( - IN LPCSTR szText); - -SHORT -CONSOLE_GetCursorX(VOID); - -SHORT -CONSOLE_GetCursorY(VOID); - -VOID -CONSOLE_GetScreenSize( - OUT SHORT *maxx, - OUT SHORT *maxy); - -VOID -CONSOLE_InvertTextXY( - IN SHORT x, - IN SHORT y, - IN SHORT col, - IN SHORT row); - -VOID -CONSOLE_NormalTextXY( - IN SHORT x, - IN SHORT y, - IN SHORT col, - IN SHORT row); - -VOID -CONSOLE_PrintTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR fmt, ...); - -VOID -CONSOLE_PrintTextXYN( - IN SHORT x, - IN SHORT y, - IN SHORT len, - IN LPCSTR fmt, ...); - -VOID -CONSOLE_SetCursorType( - IN BOOL bInsert, - IN BOOL bVisible); - -VOID -CONSOLE_SetCursorXY( - IN SHORT x, - IN SHORT y); - -VOID -CONSOLE_SetCursorXY( - IN SHORT x, - IN SHORT y); - -VOID -CONSOLE_SetHighlightedTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR Text); - -VOID -CONSOLE_SetInputTextXY( - IN SHORT x, - IN SHORT y, - IN SHORT len, - IN LPCWSTR Text); - -VOID -CONSOLE_SetInputTextXY( - IN SHORT x, - IN SHORT y, - IN SHORT len, - IN LPCWSTR Text); - -VOID -CONSOLE_SetInvertedTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR Text); - -VOID -CONSOLE_SetStatusText( - IN LPCSTR fmt, ...); - -VOID -CONSOLE_SetTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR Text); - -VOID -CONSOLE_SetUnderlinedTextXY( - IN SHORT x, - IN SHORT y, - IN LPCSTR Text); - #endif /* __CONSOLE_H__*/ /* EOF */ diff --git a/reactos/base/setup/usetup/keytrans.c b/reactos/base/setup/usetup/native/utils/keytrans.c similarity index 100% rename from reactos/base/setup/usetup/keytrans.c rename to reactos/base/setup/usetup/native/utils/keytrans.c diff --git a/reactos/base/setup/usetup/keytrans.h b/reactos/base/setup/usetup/native/utils/keytrans.h similarity index 100% rename from reactos/base/setup/usetup/keytrans.h rename to reactos/base/setup/usetup/native/utils/keytrans.h diff --git a/reactos/base/setup/usetup/usetup.h b/reactos/base/setup/usetup/usetup.h index 07f3db18db2..ee9b968a809 100644 --- a/reactos/base/setup/usetup/usetup.h +++ b/reactos/base/setup/usetup/usetup.h @@ -55,14 +55,15 @@ #include /* Internal Headers */ -#include "console.h" +#include "interface/consup.h" +#include "native/utils/console.h" +#include "native/utils/keytrans.h" #include "partlist.h" #include "inffile.h" #include "inicache.h" #include "progress.h" #include "filequeue.h" #include "bootsup.h" -#include "keytrans.h" #include "registry.h" #include "fslist.h" #include "chkdsk.h" diff --git a/reactos/base/setup/usetup/usetup.rbuild b/reactos/base/setup/usetup/usetup.rbuild index f4eb911b6e7..61bc08a6f17 100644 --- a/reactos/base/setup/usetup/usetup.rbuild +++ b/reactos/base/setup/usetup/usetup.rbuild @@ -15,10 +15,19 @@ ntdll usetup.h + + consup.c + usetup.c + + + + console.c + keytrans.c + + bootsup.c cabinet.c chkdsk.c - console.c drivesup.c filequeue.c filesup.c @@ -27,12 +36,10 @@ genlist.c inffile.c inicache.c - keytrans.c partlist.c progress.c registry.c settings.c - usetup.c usetup.rc