Author: hbelusca
Date: Thu Oct 10 01:16:02 2013
New Revision: 60593
URL:
http://svn.reactos.org/svn/reactos?rev=60593&view=rev
Log:
[CONSRV]
- Macros renaming.
- When switching active screen buffers, do it a bit more properly, i.e. announce it to the
terminal emulator (aka. frontend) so that it will be able to change the associated console
palette, be able to support displaying multi screen buffers or displaying another screen
buffer than the active one (for debugging purposes or whatever), etc...
There are still some hacks and commented code, which whill be cleaned when I'll be
sure that everything works and is not broken somewhere.
Added:
trunk/reactos/win32ss/user/winsrv/consrv/include/term.h
- copied, changed from r60589,
trunk/reactos/win32ss/user/winsrv/consrv/include/conio2.h
Removed:
trunk/reactos/win32ss/user/winsrv/consrv/include/conio2.h
Modified:
trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c
trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c
trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c
trunk/reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c
trunk/reactos/win32ss/user/winsrv/consrv/condrv/graphics.c
trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c
trunk/reactos/win32ss/user/winsrv/consrv/coninput.c
trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
trunk/reactos/win32ss/user/winsrv/consrv/conoutput.h
trunk/reactos/win32ss/user/winsrv/consrv/console.c
trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
trunk/reactos/win32ss/user/winsrv/consrv/handle.c
trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c
trunk/reactos/win32ss/user/winsrv/consrv/settings.c
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -11,7 +11,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "handle.h"
#include "lineinput.h"
@@ -128,6 +128,11 @@
CloseHandle(Console->InputBuffer.ActiveEvent);
}
+/*
+ * This function explicitely references Console->ActiveBuffer
+ * (and also makes use of keyboard functions...).
+ * It is possible that it will move into frontends...
+ */
VOID NTAPI
ConDrvProcessKey(IN PCONSOLE Console,
IN BOOLEAN Down,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -12,7 +12,7 @@
#include "consrv.h"
#include "console.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "conoutput.h"
#include "handle.h"
@@ -84,14 +84,12 @@
if (BufferType == CONSOLE_TEXTMODE_BUFFER)
{
- Status = TEXTMODE_BUFFER_Initialize(Buffer,
- Console,
+ Status = TEXTMODE_BUFFER_Initialize(Buffer, Console,
(PTEXTMODE_BUFFER_INFO)ScreenBufferInfo);
}
else if (BufferType == CONSOLE_GRAPHICS_BUFFER)
{
- Status = GRAPHICS_BUFFER_Initialize(Buffer,
- Console,
+ Status = GRAPHICS_BUFFER_Initialize(Buffer, Console,
(PGRAPHICS_BUFFER_INFO)ScreenBufferInfo);
}
else
@@ -115,18 +113,33 @@
PCONSOLE Console = Buffer->Header.Console;
PCONSOLE_SCREEN_BUFFER NewBuffer;
+ /*
+ * We should notify temporarily the frontend because we are susceptible
+ * to delete the screen buffer it is using (which may be different from
+ * the active screen buffer in some cases), and because, if it actually
+ * uses the active screen buffer, we are going to nullify its pointer to
+ * change it.
+ */
+ TermReleaseScreenBuffer(Console, Buffer);
+
RemoveEntryList(&Buffer->ListEntry);
if (Buffer == Console->ActiveBuffer)
{
/* Delete active buffer; switch to most recently created */
- Console->ActiveBuffer = NULL;
if (!IsListEmpty(&Console->BufferList))
{
NewBuffer = CONTAINING_RECORD(Console->BufferList.Flink,
CONSOLE_SCREEN_BUFFER,
ListEntry);
+
+ /* Tie console to new buffer and signal the change to the frontend */
ConioSetActiveScreenBuffer(NewBuffer);
}
+ else
+ {
+ Console->ActiveBuffer = NULL;
+ // InterlockedExchangePointer(&Console->ActiveBuffer, NULL);
+ }
}
CONSOLE_SCREEN_BUFFER_Destroy(Buffer);
@@ -141,7 +154,7 @@
if (ActiveBuffer)
{
ConioInitRect(&Region, 0, 0, ActiveBuffer->ViewSize.Y - 1,
ActiveBuffer->ViewSize.X - 1);
- ConioDrawRegion(Console, &Region);
+ TermDrawRegion(Console, &Region);
}
}
@@ -150,8 +163,8 @@
{
PCONSOLE Console = Buffer->Header.Console;
Console->ActiveBuffer = Buffer;
- ConioResizeTerminal(Console);
- // ConioDrawConsole(Console);
+ // InterlockedExchangePointer(&Console->ActiveBuffer, Buffer);
+ TermSetActiveScreenBuffer(Console);
}
NTSTATUS NTAPI
@@ -172,7 +185,7 @@
ConioDeleteScreenBuffer(Console->ActiveBuffer);
}
- /* Tie console to new buffer */
+ /* Tie console to new buffer and signal the change to the frontend */
ConioSetActiveScreenBuffer(Buffer);
return STATUS_SUCCESS;
@@ -198,7 +211,7 @@
ASSERT(Console == Buffer->Header.Console);
/* If the output buffer is the current one, redraw the correct portion of the screen
*/
- if (Buffer == Console->ActiveBuffer) ConioDrawRegion(Console, Region);
+ if (Buffer == Console->ActiveBuffer) TermDrawRegion(Console, Region);
return STATUS_SUCCESS;
}
@@ -255,7 +268,7 @@
Buffer->CursorInfo.dwSize = Size;
Buffer->CursorInfo.bVisible = Visible;
- Success = ConioSetCursorInfo(Console, (PCONSOLE_SCREEN_BUFFER)Buffer);
+ Success = TermSetCursorInfo(Console, (PCONSOLE_SCREEN_BUFFER)Buffer);
}
return (Success ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
@@ -286,7 +299,7 @@
// Buffer->CursorPosition.X = Position->X;
// Buffer->CursorPosition.Y = Position->Y;
if ( ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer) &&
- (!ConioSetScreenInfo(Console, (PCONSOLE_SCREEN_BUFFER)Buffer, OldCursorX,
OldCursorY)) )
+ (!TermSetScreenInfo(Console, (PCONSOLE_SCREEN_BUFFER)Buffer, OldCursorX,
OldCursorY)) )
{
return STATUS_UNSUCCESSFUL;
}
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -12,7 +12,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "handle.h"
#include "procinit.h"
#include "alias.h"
@@ -1010,7 +1010,7 @@
RtlCopyMemory(Console->Title.Buffer, Title, Console->Title.Length);
Console->Title.Buffer[Console->Title.Length / sizeof(WCHAR)] = L'\0';
- // ConioChangeTitle(Console);
+ // TermChangeTitle(Console);
return STATUS_SUCCESS;
}
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c [iso-8859-1] Thu Oct
10 01:16:02 2013
@@ -64,6 +64,17 @@
static VOID NTAPI
DummyResizeTerminal(IN OUT PFRONTEND This)
+{
+}
+
+static VOID NTAPI
+DummySetActiveScreenBuffer(IN OUT PFRONTEND This)
+{
+}
+
+static VOID NTAPI
+DummyReleaseScreenBuffer(IN OUT PFRONTEND This,
+ IN PCONSOLE_SCREEN_BUFFER ScreenBuffer)
{
}
@@ -158,6 +169,8 @@
DummySetCursorInfo,
DummySetScreenInfo,
DummyResizeTerminal,
+ DummySetActiveScreenBuffer,
+ DummyReleaseScreenBuffer,
DummyProcessKeyCallback,
DummyRefreshInternalInfo,
DummyChangeTitle,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/graphics.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/graphics.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/graphics.c [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -13,7 +13,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "conoutput.h"
#include "handle.h"
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -11,7 +11,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "conoutput.h"
#include "handle.h"
@@ -584,8 +584,8 @@
if (!ConioIsRectEmpty(&UpdateRect) && (PCONSOLE_SCREEN_BUFFER)Buff ==
Console->ActiveBuffer)
{
- ConioWriteStream(Console, &UpdateRect, CursorStartX, CursorStartY,
- ScrolledLines, Buffer, Length);
+ TermWriteStream(Console, &UpdateRect, CursorStartX, CursorStartY,
+ ScrolledLines, Buffer, Length);
}
return STATUS_SUCCESS;
@@ -731,7 +731,7 @@
}
}
- ConioDrawRegion(Console, &CapturedWriteRegion);
+ TermDrawRegion(Console, &CapturedWriteRegion);
WriteRegion->Left = CapturedWriteRegion.Left;
WriteRegion->Top = CapturedWriteRegion.Top ;
@@ -1053,7 +1053,7 @@
if ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer)
{
ConioComputeUpdateRect(Buffer, &UpdateRect, WriteCoord, NumCodesToWrite);
- ConioDrawRegion(Console, &UpdateRect);
+ TermDrawRegion(Console, &UpdateRect);
}
// EndCoord->X = X;
@@ -1151,7 +1151,7 @@
if ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer)
{
ConioComputeUpdateRect(Buffer, &UpdateRect, WriteCoord, NumCodesToWrite);
- ConioDrawRegion(Console, &UpdateRect);
+ TermDrawRegion(Console, &UpdateRect);
}
// CodesWritten = Written; // NumCodesToWrite;
@@ -1212,7 +1212,7 @@
ASSERT(Console == Buffer->Header.Console);
Status = ConioResizeBuffer(Console, Buffer, *Size);
- if (NT_SUCCESS(Status)) ConioResizeTerminal(Console);
+ if (NT_SUCCESS(Status)) TermResizeTerminal(Console);
return Status;
}
@@ -1292,7 +1292,7 @@
if (ConioGetIntersection(&UpdateRegion, &UpdateRegion,
&CapturedClipRectangle))
{
/* Draw update region */
- ConioDrawRegion(Console, &UpdateRegion);
+ TermDrawRegion(Console, &UpdateRegion);
}
}
Modified: trunk/reactos/win32ss/user/winsrv/consrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] Thu Oct 10 01:16:02
2013
@@ -11,7 +11,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "handle.h"
#include "lineinput.h"
Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] Thu Oct 10 01:16:02
2013
@@ -12,7 +12,7 @@
#include "consrv.h"
#include "console.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "conoutput.h"
#include "handle.h"
Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.h [iso-8859-1] Thu Oct 10 01:16:02
2013
@@ -40,7 +40,7 @@
VOID WINAPI ConioDeleteScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer);
// VOID FASTCALL ConioSetActiveScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer);
-PCONSOLE_SCREEN_BUFFER
-ConDrvGetActiveScreenBuffer(IN PCONSOLE Console);
+// PCONSOLE_SCREEN_BUFFER
+// ConDrvGetActiveScreenBuffer(IN PCONSOLE Console);
/* EOF */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/console.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/console.c [iso-8859-1] Thu Oct 10 01:16:02
2013
@@ -12,7 +12,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "handle.h"
#include "procinit.h"
#include "alias.h"
@@ -545,7 +545,7 @@
TitleRequest->Title,
TitleRequest->Length);
- if (NT_SUCCESS(Status)) ConioChangeTitle(Console);
+ if (NT_SUCCESS(Status)) TermChangeTitle(Console);
ConSrvReleaseConsole(Console, TRUE);
return Status;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -10,7 +10,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "conoutput.h"
#include "console.h"
#include "handle.h"
@@ -132,7 +132,7 @@
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
- GetDisplayModeRequest->DisplayMode = ConioGetDisplayMode(Console);
+ GetDisplayModeRequest->DisplayMode = TermGetDisplayMode(Console);
ConSrvReleaseConsole(Console, TRUE);
return STATUS_SUCCESS;
@@ -154,7 +154,7 @@
Console = Buff->Header.Console;
- if (ConioSetDisplayMode(Console, SetDisplayModeRequest->DisplayMode))
+ if (TermSetDisplayMode(Console, SetDisplayModeRequest->DisplayMode))
{
SetDisplayModeRequest->NewSBDim = Buff->ScreenBufferSize;
Status = STATUS_SUCCESS;
@@ -183,7 +183,7 @@
if (!NT_SUCCESS(Status)) return Status;
Console = Buff->Header.Console;
- ConioGetLargestConsoleWindowSize(Console,
&GetLargestWindowSizeRequest->Size);
+ TermGetLargestConsoleWindowSize(Console, &GetLargestWindowSizeRequest->Size);
ConSrvReleaseScreenBuffer(Buff, TRUE);
return STATUS_SUCCESS;
@@ -205,7 +205,7 @@
Console = Buff->Header.Console;
- ShowCursorRequest->RefCount = ConioShowMouseCursor(Console,
ShowCursorRequest->Show);
+ ShowCursorRequest->RefCount = TermShowMouseCursor(Console,
ShowCursorRequest->Show);
ConSrvReleaseScreenBuffer(Buff, TRUE);
return STATUS_SUCCESS;
@@ -231,7 +231,7 @@
Console = Buff->Header.Console;
- Success = ConioSetMouseCursor(Console, SetCursorRequest->hCursor);
+ Success = TermSetMouseCursor(Console, SetCursorRequest->hCursor);
ConSrvReleaseScreenBuffer(Buff, TRUE);
return (Success ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
@@ -253,9 +253,9 @@
Console = Buff->Header.Console;
- MenuControlRequest->hMenu = ConioMenuControl(Console,
- MenuControlRequest->dwCmdIdLow,
- MenuControlRequest->dwCmdIdHigh);
+ MenuControlRequest->hMenu = TermMenuControl(Console,
+ MenuControlRequest->dwCmdIdLow,
+ MenuControlRequest->dwCmdIdHigh);
ConSrvReleaseScreenBuffer(Buff, TRUE);
return STATUS_SUCCESS;
@@ -272,7 +272,7 @@
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
- Success = ConioSetMenuClose(Console, SetMenuCloseRequest->Enable);
+ Success = TermSetMenuClose(Console, SetMenuCloseRequest->Enable);
ConSrvReleaseConsole(Console, TRUE);
return (Success ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
@@ -287,7 +287,7 @@
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
- GetWindowRequest->WindowHandle = ConioGetConsoleWindowHandle(Console);
+ GetWindowRequest->WindowHandle = TermGetConsoleWindowHandle(Console);
ConSrvReleaseConsole(Console, TRUE);
return STATUS_SUCCESS;
@@ -302,7 +302,7 @@
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
&Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
- Status = (ConioChangeIcon(Console, SetIconRequest->WindowIcon)
+ Status = (TermChangeIcon(Console, SetIconRequest->WindowIcon)
? STATUS_SUCCESS
: STATUS_UNSUCCESSFUL);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] Thu
Oct 10 01:16:02 2013
@@ -227,7 +227,7 @@
{
NTSTATUS Status;
PCONSOLE Console = GuiData->Console;
- PCONSOLE_SCREEN_BUFFER ActiveBuffer = Console->ActiveBuffer;
+ PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer;
PCONSOLE_PROCESS_DATA ProcessData;
HANDLE hSection = NULL, hClientSection = NULL;
LARGE_INTEGER SectionSize;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] Thu
Oct 10 01:16:02 2013
@@ -65,6 +65,7 @@
UINT CharHeight;
PCONSOLE Console; /* Pointer to the owned console */
+ PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to the active screen buffer (then
maybe the previous Console member is redundant?? Or not...) */
GUI_CONSOLE_INFO GuiInfo; /* GUI terminal settings */
} GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] Thu Oct
10 01:16:02 2013
@@ -64,16 +64,18 @@
#define GWLP_CONSOLE_LEADER_PID 0
#define GWLP_CONSOLE_LEADER_TID 4
-#define SetConsoleWndConsoleLeaderCID(GuiData) \
-do { \
- PCONSOLE_PROCESS_DATA ProcessData; \
- CLIENT_ID ConsoleLeaderCID; \
+#define SetConsoleWndConsoleLeaderCID(GuiData) \
+do { \
+ PCONSOLE_PROCESS_DATA ProcessData; \
+ CLIENT_ID ConsoleLeaderCID; \
ProcessData = CONTAINING_RECORD((GuiData)->Console->ProcessList.Blink, \
CONSOLE_PROCESS_DATA, \
ConsoleLink); \
ConsoleLeaderCID = ProcessData->Process->ClientId; \
- SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_PID,
(LONG_PTR)(ConsoleLeaderCID.UniqueProcess)); \
- SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_TID,
(LONG_PTR)(ConsoleLeaderCID.UniqueThread )); \
+ SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_PID, \
+ (LONG_PTR)(ConsoleLeaderCID.UniqueProcess)); \
+ SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_TID, \
+ (LONG_PTR)(ConsoleLeaderCID.UniqueThread )); \
} while (0)
/**************************************************************/
@@ -264,7 +266,8 @@
Ret = FALSE;
goto Quit;
}
- ActiveBuffer = ConDrvGetActiveScreenBuffer(Console);
+ // ActiveBuffer = ConDrvGetActiveScreenBuffer(Console);
+ ActiveBuffer = GuiData->ActiveBuffer;
/*
* In case the selected menu item belongs to the user-reserved menu id range,
@@ -392,8 +395,8 @@
static VOID
GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData)
{
- PCONSOLE Console = GuiData->Console;
- PCONSOLE_SCREEN_BUFFER Buff = ConDrvGetActiveScreenBuffer(Console);
+ // PCONSOLE Console = GuiData->Console;
+ PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; //
ConDrvGetActiveScreenBuffer(Console);
SCROLLINFO sInfo;
DWORD Width, Height;
@@ -471,8 +474,8 @@
memset(&dmScreenSettings, 0, sizeof(dmScreenSettings));
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
dmScreenSettings.dmDisplayFixedOutput = DMDFO_CENTER; // DMDFO_STRETCH //
DMDFO_DEFAULT
- dmScreenSettings.dmPelsWidth = 640; // Console->ActiveBuffer->ViewSize.X *
GuiData->CharWidth;
- dmScreenSettings.dmPelsHeight = 480; // Console->ActiveBuffer->ViewSize.Y *
GuiData->CharHeight;
+ dmScreenSettings.dmPelsWidth = 640; // GuiData->ActiveBuffer->ViewSize.X *
GuiData->CharWidth;
+ dmScreenSettings.dmPelsHeight = 480; // GuiData->ActiveBuffer->ViewSize.Y *
GuiData->CharHeight;
dmScreenSettings.dmBitsPerPel = 32;
dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);
@@ -588,8 +591,8 @@
static VOID
SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect)
{
- PCONSOLE Console = GuiData->Console;
- PCONSOLE_SCREEN_BUFFER Buffer = ConDrvGetActiveScreenBuffer(Console);
+ // PCONSOLE Console = GuiData->Console;
+ PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; //
ConDrvGetActiveScreenBuffer(Console);
UINT WidthUnit, HeightUnit;
GetScreenBufferSizeUnits(Buffer, GuiData, &WidthUnit, &HeightUnit);
@@ -687,7 +690,8 @@
Success = FALSE;
goto Quit;
}
- ActiveBuffer = ConDrvGetActiveScreenBuffer(Console);
+ // ActiveBuffer = ConDrvGetActiveScreenBuffer(Console);
+ ActiveBuffer = GuiData->ActiveBuffer;
hDC = BeginPaint(GuiData->hWindow, &ps);
if (hDC != NULL &&
@@ -768,7 +772,8 @@
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
- ActiveBuffer = ConDrvGetActiveScreenBuffer(Console);
+ // ActiveBuffer = ConDrvGetActiveScreenBuffer(Console);
+ ActiveBuffer = GuiData->ActiveBuffer;
if (Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS)
{
@@ -940,7 +945,7 @@
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
- Buff = ConDrvGetActiveScreenBuffer(Console);
+ Buff = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console);
if (GetType(Buff) == TEXTMODE_BUFFER)
{
@@ -1063,8 +1068,8 @@
static COORD
PointToCoord(PGUI_CONSOLE_DATA GuiData, LPARAM lParam)
{
- PCONSOLE Console = GuiData->Console;
- PCONSOLE_SCREEN_BUFFER Buffer = ConDrvGetActiveScreenBuffer(Console);
+ // PCONSOLE Console = GuiData->Console;
+ PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; //
ConDrvGetActiveScreenBuffer(Console);
COORD Coord;
UINT WidthUnit, HeightUnit;
@@ -1343,7 +1348,7 @@
if (OpenClipboard(GuiData->hWindow) == TRUE)
{
PCONSOLE Console = GuiData->Console;
- PCONSOLE_SCREEN_BUFFER Buffer = ConDrvGetActiveScreenBuffer(Console);
+ PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; //
ConDrvGetActiveScreenBuffer(Console);
if (GetType(Buffer) == TEXTMODE_BUFFER)
{
@@ -1370,8 +1375,8 @@
{
if (OpenClipboard(GuiData->hWindow) == TRUE)
{
- PCONSOLE Console = GuiData->Console;
- PCONSOLE_SCREEN_BUFFER Buffer = ConDrvGetActiveScreenBuffer(Console);
+ // PCONSOLE Console = GuiData->Console;
+ PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; //
ConDrvGetActiveScreenBuffer(Console);
if (GetType(Buffer) == TEXTMODE_BUFFER)
{
@@ -1396,7 +1401,8 @@
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
- ActiveBuffer = ConDrvGetActiveScreenBuffer(Console);
+ // ActiveBuffer = ConDrvGetActiveScreenBuffer(Console);
+ ActiveBuffer = GuiData->ActiveBuffer;
GetScreenBufferSizeUnits(ActiveBuffer, GuiData, &WidthUnit, &HeightUnit);
@@ -1428,7 +1434,7 @@
if ((GuiData->WindowSizeLock == FALSE) &&
(wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED || wParam ==
SIZE_MINIMIZED))
{
- PCONSOLE_SCREEN_BUFFER Buff = ConDrvGetActiveScreenBuffer(Console);
+ PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; //
ConDrvGetActiveScreenBuffer(Console);
DWORD windx, windy, charx, chary;
UINT WidthUnit, HeightUnit;
@@ -1522,7 +1528,7 @@
if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return 0;
- Buff = ConDrvGetActiveScreenBuffer(Console);
+ Buff = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console);
if (uMsg == WM_HSCROLL)
{
@@ -1646,6 +1652,9 @@
*/
GuiData = GuiGetGuiData(hWnd);
if (GuiData == NULL) return DefWindowProcW(hWnd, msg, wParam, lParam);
+
+ // TEMPORARY HACK until all of the functions can deal with a NULL
GuiData->ActiveBuffer ...
+ if (GuiData->ActiveBuffer == NULL) return DefWindowProcW(hWnd, msg, wParam,
lParam);
/*
* Just retrieve a pointer to the console in case somebody needs it.
@@ -1865,14 +1874,16 @@
{
if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE))
{
+ BOOL SetFocus = (msg == WM_SETFOCUS);
INPUT_RECORD er;
+
er.EventType = FOCUS_EVENT;
- er.Event.FocusEvent.bSetFocus = (msg == WM_SETFOCUS);
+ er.Event.FocusEvent.bSetFocus = SetFocus;
ConioProcessInputEvent(Console, &er);
- if (msg == WM_SETFOCUS)
+ if (SetFocus)
DPRINT1("TODO: Create console caret\n");
- else // if (msg == WM_KILLFOCUS)
+ else
DPRINT1("TODO: Destroy console caret\n");
LeaveCriticalSection(&Console->Lock);
@@ -2247,7 +2258,8 @@
return STATUS_UNSUCCESSFUL;
}
/* HACK */ Console->TermIFace.Data = (PVOID)GuiData; /* HACK */
- GuiData->Console = Console;
+ GuiData->Console = Console;
+ GuiData->ActiveBuffer = Console->ActiveBuffer;
GuiData->hWindow = NULL;
/* The console can be resized */
@@ -2441,7 +2453,7 @@
if (NULL == GuiData || NULL == GuiData->hWindow) return;
- Buff = ConDrvGetActiveScreenBuffer(GuiData->Console);
+ Buff = GuiData->ActiveBuffer; //
ConDrvGetActiveScreenBuffer(GuiData->Console);
if (GetType(Buff) != TEXTMODE_BUFFER) return;
if (0 != ScrolledLines)
@@ -2490,7 +2502,7 @@
{
PGUI_CONSOLE_DATA GuiData = This->Data;
- if (ConDrvGetActiveScreenBuffer(GuiData->Console) == Buff)
+ if (/*ConDrvGetActiveScreenBuffer(GuiData->Console)*/GuiData->ActiveBuffer ==
Buff)
{
GuiInvalidateCell(This, Buff->CursorPosition.X, Buff->CursorPosition.Y);
}
@@ -2506,7 +2518,7 @@
{
PGUI_CONSOLE_DATA GuiData = This->Data;
- if (ConDrvGetActiveScreenBuffer(GuiData->Console) == Buff)
+ if (/*ConDrvGetActiveScreenBuffer(GuiData->Console)*/GuiData->ActiveBuffer ==
Buff)
{
/* Redraw char at old position (remove cursor) */
GuiInvalidateCell(This, OldCursorX, OldCursorY);
@@ -2529,6 +2541,62 @@
// NOTE: This code ^^ causes deadlocks...
PostMessageW(GuiData->hWindow, PM_RESIZE_TERMINAL, 0, 0);
+}
+
+static VOID WINAPI
+GuiSetActiveScreenBuffer(IN OUT PFRONTEND This)
+{
+ PGUI_CONSOLE_DATA GuiData = This->Data;
+
+ EnterCriticalSection(&GuiData->Lock);
+ GuiData->WindowSizeLock = TRUE;
+
+ InterlockedExchangePointer(&GuiData->ActiveBuffer,
+ GuiData->Console->ActiveBuffer);
+
+ GuiData->WindowSizeLock = FALSE;
+ LeaveCriticalSection(&GuiData->Lock);
+
+ GuiResizeTerminal(This);
+ // ConioDrawConsole(Console);
+
+ // FIXME: Change the palette.
+}
+
+static VOID WINAPI
+GuiReleaseScreenBuffer(IN OUT PFRONTEND This,
+ IN PCONSOLE_SCREEN_BUFFER ScreenBuffer)
+{
+ PGUI_CONSOLE_DATA GuiData = This->Data;
+
+ /*
+ * If we were notified to release a screen buffer that is not actually
+ * ours, then just ignore the notification...
+ */
+ if (ScreenBuffer != GuiData->ActiveBuffer) return;
+
+ /*
+ * ... else, we must release our active buffer. Two cases are present:
+ * - If ScreenBuffer (== GuiData->ActiveBuffer) IS NOT the console
+ * active screen buffer, then we can safely switch to it.
+ * - If ScreenBuffer IS the console active screen buffer, we must release
+ * it BUT and that's all.
+ */
+
+ if (ScreenBuffer != GuiData->Console->ActiveBuffer)
+ {
+ GuiSetActiveScreenBuffer(This);
+ }
+ else
+ {
+ EnterCriticalSection(&GuiData->Lock);
+ GuiData->WindowSizeLock = TRUE;
+
+ InterlockedExchangePointer(&GuiData->ActiveBuffer, NULL);
+
+ GuiData->WindowSizeLock = FALSE;
+ LeaveCriticalSection(&GuiData->Lock);
+ }
}
static BOOL WINAPI
@@ -2653,7 +2721,8 @@
return;
}
- ActiveBuffer = ConDrvGetActiveScreenBuffer(GuiData->Console);
+ // ActiveBuffer = ConDrvGetActiveScreenBuffer(GuiData->Console);
+ ActiveBuffer = GuiData->ActiveBuffer;
if (ActiveBuffer)
{
GetScreenBufferSizeUnits(ActiveBuffer, GuiData, &WidthUnit,
&HeightUnit);
@@ -2783,6 +2852,8 @@
GuiSetCursorInfo,
GuiSetScreenInfo,
GuiResizeTerminal,
+ GuiSetActiveScreenBuffer,
+ GuiReleaseScreenBuffer,
GuiProcessKeyCallback,
GuiRefreshInternalInfo,
GuiChangeTitle,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -11,7 +11,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "coninput.h"
#define NDEBUG
@@ -104,12 +104,12 @@
UnicodeChar = (1 == RetChars ? Chars[0] : 0);
}
- if (ConioProcessKeyCallback(Console,
- msg,
- KeyState[VK_MENU],
- ShiftState,
- VirtualKeyCode,
- Down))
+ if (TermProcessKeyCallback(Console,
+ msg,
+ KeyState[VK_MENU],
+ ShiftState,
+ VirtualKeyCode,
+ Down))
{
return;
}
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [iso-8859-1] Thu Oct
10 01:16:02 2013
@@ -482,7 +482,7 @@
// /* The console cannot be resized anymore */
// Console->FixedSize = TRUE; // MUST be placed AFTER the call to
ConioResizeBuffer !!
- // // ConioResizeTerminal(Console);
+ // // TermResizeTerminal(Console);
/*
* Contrary to what we do in the GUI front-end, here we create
Modified: trunk/reactos/win32ss/user/winsrv/consrv/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] Thu Oct 10 01:16:02
2013
@@ -12,7 +12,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "handle.h"
#include "include/console.h"
#include "console.h"
@@ -551,7 +551,7 @@
_InterlockedIncrement(&Console->ReferenceCount);
/* Update the internal info of the terminal */
- ConioRefreshInternalInfo(Console);
+ TermRefreshInternalInfo(Console);
return STATUS_SUCCESS;
}
@@ -629,7 +629,7 @@
_InterlockedIncrement(&Console->ReferenceCount);
/* Update the internal info of the terminal */
- ConioRefreshInternalInfo(Console);
+ TermRefreshInternalInfo(Console);
Status = STATUS_SUCCESS;
@@ -666,7 +666,7 @@
RemoveEntryList(&ProcessData->ConsoleLink);
/* Update the internal info of the terminal */
- ConioRefreshInternalInfo(Console);
+ TermRefreshInternalInfo(Console);
/* Release the console */
DPRINT("ConSrvRemoveConsole - Decrement Console->ReferenceCount =
%lu\n", Console->ReferenceCount);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -203,6 +203,9 @@
SHORT OldCursorX,
SHORT OldCursorY);
VOID (WINAPI *ResizeTerminal)(IN OUT PFRONTEND This);
+ VOID (WINAPI *SetActiveScreenBuffer)(IN OUT PFRONTEND This);
+ VOID (WINAPI *ReleaseScreenBuffer)(IN OUT PFRONTEND This,
+ IN PCONSOLE_SCREEN_BUFFER ScreenBuffer);
BOOL (WINAPI *ProcessKeyCallback)(IN OUT PFRONTEND This,
MSG* msg,
BYTE KeyStateMenu,
Removed: trunk/reactos/win32ss/user/winsrv/consrv/include/conio2.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/include/conio2.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio2.h (removed)
@@ -1,50 +0,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS Console Server DLL
- * FILE: win32ss/user/winsrv/consrv/conio.h
- * PURPOSE: Internal Console I/O Interface
- * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
- */
-
-#pragma once
-
-/* Macros used to call functions in the FRONTEND_VTBL virtual table */
-
-#define ConioDrawRegion(Console, Region) \
- (Console)->TermIFace.Vtbl->DrawRegion(&(Console)->TermIFace, (Region))
-#define ConioWriteStream(Console, Block, CurStartX, CurStartY, ScrolledLines, Buffer,
Length) \
- (Console)->TermIFace.Vtbl->WriteStream(&(Console)->TermIFace, (Block),
(CurStartX), (CurStartY), \
- (ScrolledLines), (Buffer), (Length))
-#define ConioSetCursorInfo(Console, Buff) \
- (Console)->TermIFace.Vtbl->SetCursorInfo(&(Console)->TermIFace, (Buff))
-#define ConioSetScreenInfo(Console, Buff, OldCursorX, OldCursorY) \
- (Console)->TermIFace.Vtbl->SetScreenInfo(&(Console)->TermIFace, (Buff),
(OldCursorX), (OldCursorY))
-#define ConioResizeTerminal(Console) \
- (Console)->TermIFace.Vtbl->ResizeTerminal(&(Console)->TermIFace)
-#define ConioProcessKeyCallback(Console, Msg, KeyStateMenu, ShiftState, VirtualKeyCode,
Down) \
- (Console)->TermIFace.Vtbl->ProcessKeyCallback(&(Console)->TermIFace,
(Msg), (KeyStateMenu), (ShiftState), (VirtualKeyCode), (Down))
-#define ConioRefreshInternalInfo(Console) \
- (Console)->TermIFace.Vtbl->RefreshInternalInfo(&(Console)->TermIFace)
-
-#define ConioChangeTitle(Console) \
- (Console)->TermIFace.Vtbl->ChangeTitle(&(Console)->TermIFace)
-#define ConioChangeIcon(Console, hWindowIcon) \
- (Console)->TermIFace.Vtbl->ChangeIcon(&(Console)->TermIFace,
(hWindowIcon))
-#define ConioGetConsoleWindowHandle(Console) \
-
(Console)->TermIFace.Vtbl->GetConsoleWindowHandle(&(Console)->TermIFace)
-#define ConioGetLargestConsoleWindowSize(Console, pSize) \
-
(Console)->TermIFace.Vtbl->GetLargestConsoleWindowSize(&(Console)->TermIFace,
(pSize))
-#define ConioGetDisplayMode(Console) \
- (Console)->TermIFace.Vtbl->GetDisplayMode(&(Console)->TermIFace)
-#define ConioSetDisplayMode(Console, NewMode) \
- (Console)->TermIFace.Vtbl->SetDisplayMode(&(Console)->TermIFace,
(NewMode))
-#define ConioShowMouseCursor(Console, Show) \
- (Console)->TermIFace.Vtbl->ShowMouseCursor(&(Console)->TermIFace,
(Show))
-#define ConioSetMouseCursor(Console, hCursor) \
- (Console)->TermIFace.Vtbl->SetMouseCursor(&(Console)->TermIFace,
(hCursor))
-#define ConioMenuControl(Console, CmdIdLow, CmdIdHigh) \
- (Console)->TermIFace.Vtbl->MenuControl(&(Console)->TermIFace,
(CmdIdLow), (CmdIdHigh))
-#define ConioSetMenuClose(Console, Enable) \
- (Console)->TermIFace.Vtbl->SetMenuClose(&(Console)->TermIFace,
(Enable))
-
-/* EOF */
Copied: trunk/reactos/win32ss/user/winsrv/consrv/include/term.h (from r60589,
trunk/reactos/win32ss/user/winsrv/consrv/include/conio2.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/include/conio2.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/include/term.h [iso-8859-1] Thu Oct 10
01:16:02 2013
@@ -1,8 +1,8 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Console Server DLL
- * FILE: win32ss/user/winsrv/consrv/conio.h
- * PURPOSE: Internal Console I/O Interface
+ * FILE: win32ss/user/winsrv/consrv/include/term.h
+ * PURPOSE: Internal Frontend Interface
* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
*/
@@ -10,41 +10,45 @@
/* Macros used to call functions in the FRONTEND_VTBL virtual table */
-#define ConioDrawRegion(Console, Region) \
+#define TermDrawRegion(Console, Region) \
(Console)->TermIFace.Vtbl->DrawRegion(&(Console)->TermIFace, (Region))
-#define ConioWriteStream(Console, Block, CurStartX, CurStartY, ScrolledLines, Buffer,
Length) \
+#define TermWriteStream(Console, Block, CurStartX, CurStartY, ScrolledLines, Buffer,
Length) \
(Console)->TermIFace.Vtbl->WriteStream(&(Console)->TermIFace, (Block),
(CurStartX), (CurStartY), \
(ScrolledLines), (Buffer), (Length))
-#define ConioSetCursorInfo(Console, Buff) \
- (Console)->TermIFace.Vtbl->SetCursorInfo(&(Console)->TermIFace, (Buff))
-#define ConioSetScreenInfo(Console, Buff, OldCursorX, OldCursorY) \
- (Console)->TermIFace.Vtbl->SetScreenInfo(&(Console)->TermIFace, (Buff),
(OldCursorX), (OldCursorY))
-#define ConioResizeTerminal(Console) \
+#define TermSetCursorInfo(Console, ScreenBuffer) \
+ (Console)->TermIFace.Vtbl->SetCursorInfo(&(Console)->TermIFace,
(ScreenBuffer))
+#define TermSetScreenInfo(Console, ScreenBuffer, OldCursorX, OldCursorY) \
+ (Console)->TermIFace.Vtbl->SetScreenInfo(&(Console)->TermIFace,
(ScreenBuffer), (OldCursorX), (OldCursorY))
+#define TermResizeTerminal(Console) \
(Console)->TermIFace.Vtbl->ResizeTerminal(&(Console)->TermIFace)
-#define ConioProcessKeyCallback(Console, Msg, KeyStateMenu, ShiftState, VirtualKeyCode,
Down) \
+#define TermSetActiveScreenBuffer(Console) \
+ (Console)->TermIFace.Vtbl->SetActiveScreenBuffer(&(Console)->TermIFace)
+#define TermReleaseScreenBuffer(Console, ScreenBuffer) \
+ (Console)->TermIFace.Vtbl->ReleaseScreenBuffer(&(Console)->TermIFace,
(ScreenBuffer))
+#define TermProcessKeyCallback(Console, Msg, KeyStateMenu, ShiftState, VirtualKeyCode,
Down) \
(Console)->TermIFace.Vtbl->ProcessKeyCallback(&(Console)->TermIFace,
(Msg), (KeyStateMenu), (ShiftState), (VirtualKeyCode), (Down))
-#define ConioRefreshInternalInfo(Console) \
+#define TermRefreshInternalInfo(Console) \
(Console)->TermIFace.Vtbl->RefreshInternalInfo(&(Console)->TermIFace)
-#define ConioChangeTitle(Console) \
+#define TermChangeTitle(Console) \
(Console)->TermIFace.Vtbl->ChangeTitle(&(Console)->TermIFace)
-#define ConioChangeIcon(Console, hWindowIcon) \
+#define TermChangeIcon(Console, hWindowIcon) \
(Console)->TermIFace.Vtbl->ChangeIcon(&(Console)->TermIFace,
(hWindowIcon))
-#define ConioGetConsoleWindowHandle(Console) \
+#define TermGetConsoleWindowHandle(Console) \
(Console)->TermIFace.Vtbl->GetConsoleWindowHandle(&(Console)->TermIFace)
-#define ConioGetLargestConsoleWindowSize(Console, pSize) \
+#define TermGetLargestConsoleWindowSize(Console, pSize) \
(Console)->TermIFace.Vtbl->GetLargestConsoleWindowSize(&(Console)->TermIFace,
(pSize))
-#define ConioGetDisplayMode(Console) \
+#define TermGetDisplayMode(Console) \
(Console)->TermIFace.Vtbl->GetDisplayMode(&(Console)->TermIFace)
-#define ConioSetDisplayMode(Console, NewMode) \
+#define TermSetDisplayMode(Console, NewMode) \
(Console)->TermIFace.Vtbl->SetDisplayMode(&(Console)->TermIFace,
(NewMode))
-#define ConioShowMouseCursor(Console, Show) \
+#define TermShowMouseCursor(Console, Show) \
(Console)->TermIFace.Vtbl->ShowMouseCursor(&(Console)->TermIFace,
(Show))
-#define ConioSetMouseCursor(Console, hCursor) \
+#define TermSetMouseCursor(Console, hCursor) \
(Console)->TermIFace.Vtbl->SetMouseCursor(&(Console)->TermIFace,
(hCursor))
-#define ConioMenuControl(Console, CmdIdLow, CmdIdHigh) \
+#define TermMenuControl(Console, CmdIdLow, CmdIdHigh) \
(Console)->TermIFace.Vtbl->MenuControl(&(Console)->TermIFace,
(CmdIdLow), (CmdIdHigh))
-#define ConioSetMenuClose(Console, Enable) \
+#define TermSetMenuClose(Console, Enable) \
(Console)->TermIFace.Vtbl->SetMenuClose(&(Console)->TermIFace,
(Enable))
/* EOF */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/lineinput.c [iso-8859-1] Thu Oct 10 01:16:02
2013
@@ -4,6 +4,8 @@
* FILE: win32ss/user/winsrv/consrv/lineinput.c
* PURPOSE: Console line input functions
* PROGRAMMERS: Jeffrey Morlan
+ *
+ * NOTE: It's something frontend-related... (--> read my mind... ;) )
*/
/* INCLUDES *******************************************************************/
@@ -11,7 +13,7 @@
#include "consrv.h"
#include "console.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#define NDEBUG
#include <debug.h>
@@ -184,7 +186,7 @@
Buffer->CursorPosition.X = XY % Buffer->ScreenBufferSize.X;
Buffer->CursorPosition.Y = XY / Buffer->ScreenBufferSize.X;
- ConioSetScreenInfo(Console, Buffer, OldCursorX, OldCursorY);
+ TermSetScreenInfo(Console, Buffer, OldCursorX, OldCursorY);
}
Console->LinePos = Pos;
@@ -309,7 +311,7 @@
case VK_INSERT:
/* Toggle between insert and overstrike */
Console->LineInsertToggle = !Console->LineInsertToggle;
- ConioSetCursorInfo(Console, Console->ActiveBuffer);
+ TermSetCursorInfo(Console, Console->ActiveBuffer);
return;
case VK_DELETE:
/* Remove character to right of cursor */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/settings.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/settings.c [iso-8859-1] Thu Oct 10 01:16:02
2013
@@ -11,7 +11,7 @@
#include "consrv.h"
#include "include/conio.h"
-#include "include/conio2.h"
+#include "include/term.h"
#include "include/settings.h"
#include <stdio.h> // for swprintf
@@ -440,6 +440,11 @@
}
}
+
+/*
+ * NOTE: This function explicitely references Console->ActiveBuffer.
+ * It is possible that it should go into some frontend...
+ */
VOID
ConSrvApplyUserSettings(IN PCONSOLE Console,
IN PCONSOLE_INFO ConsoleInfo)
@@ -534,7 +539,7 @@
SizeChanged = TRUE;
}
- if (SizeChanged) ConioResizeTerminal(Console);
+ if (SizeChanged) TermResizeTerminal(Console);
}
}
else // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER)