Author: hbelusca
Date: Wed Jan 30 22:59:47 2013
New Revision: 58253
URL:
http://svn.reactos.org/svn/reactos?rev=58253&view=rev
Log:
[CONSRV]
- Add a macro which specifies how much space chars a TAB is.
- Implement BELL ANSI character handling (basic) and add temporary DPRINTs to see who is
called (by the way, Beep() functions seems not to work correctly).
Modified:
branches/ros-csrss/win32ss/user/consrv/conio.h
branches/ros-csrss/win32ss/user/consrv/conoutput.c
branches/ros-csrss/win32ss/user/consrv/guiconsole.c
branches/ros-csrss/win32ss/user/consrv/tuiconsole.c
Modified: branches/ros-csrss/win32ss/user/consrv/conio.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/conio.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/conio.h [iso-8859-1] Wed Jan 30 22:59:47 2013
@@ -9,6 +9,16 @@
#pragma once
#define CSR_DEFAULT_CURSOR_SIZE 25
+#define CURSOR_BLINK_TIME 500
+#define DEFAULT_ATTRIB (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
+
+#ifndef WM_APP
+#define WM_APP 0x8000
+#endif
+#define PM_CREATE_CONSOLE (WM_APP + 1)
+#define PM_DESTROY_CONSOLE (WM_APP + 2)
+#define PM_CONSOLE_BEEP (WM_APP + 3)
+
/************************************************************************
* Screen buffer structure represents the win32 screen buffer object. *
Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Wed Jan 30 22:59:47
2013
@@ -16,6 +16,8 @@
/* GLOBALS ********************************************************************/
+
+#define TAB_WIDTH 8
#define ConioInitRect(Rect, top, left, bottom, right) \
do { \
@@ -131,10 +133,22 @@
for (i = 0; i < Length; i++)
{
+ /*
+ * If we are in processed mode, interpret special characters and
+ * display them correctly. Otherwise, just put them into the buffer.
+ */
if (Buff->Mode & ENABLE_PROCESSED_OUTPUT)
{
+ /* --- CR --- */
+ if (Buffer[i] == '\r')
+ {
+ Buff->CurrentX = 0;
+ UpdateRect.Left = min(UpdateRect.Left, (LONG)Buff->CurrentX);
+ UpdateRect.Right = max(UpdateRect.Right, (LONG)Buff->CurrentX);
+ continue;
+ }
/* --- LF --- */
- if (Buffer[i] == '\n')
+ else if (Buffer[i] == '\n')
{
Buff->CurrentX = 0;
ConioNextLine(Buff, &UpdateRect, &ScrolledLines);
@@ -160,30 +174,19 @@
Ptr = ConioCoordToPointer(Buff, Buff->CurrentX,
Buff->CurrentY);
Ptr[0] = ' ';
Ptr[1] = Buff->DefaultAttrib;
- UpdateRect.Left = min(UpdateRect.Left, (LONG) Buff->CurrentX);
- UpdateRect.Right = max(UpdateRect.Right, (LONG) Buff->CurrentX);
+ UpdateRect.Left = min(UpdateRect.Left, (LONG)Buff->CurrentX);
+ UpdateRect.Right = max(UpdateRect.Right, (LONG)Buff->CurrentX);
}
continue;
}
- /* --- CR --- */
- else if (Buffer[i] == '\r')
- {
- Buff->CurrentX = 0;
- UpdateRect.Left = min(UpdateRect.Left, (LONG) Buff->CurrentX);
- UpdateRect.Right = max(UpdateRect.Right, (LONG) Buff->CurrentX);
- continue;
- }
/* --- TAB --- */
else if (Buffer[i] == '\t')
{
UINT EndX;
UpdateRect.Left = min(UpdateRect.Left, (LONG)Buff->CurrentX);
- EndX = (Buff->CurrentX + 8) & ~7;
- if (EndX > Buff->MaxX)
- {
- EndX = Buff->MaxX;
- }
+ EndX = (Buff->CurrentX + TAB_WIDTH) & ~(TAB_WIDTH - 1);
+ EndX = min(EndX, Buff->MaxX);
Ptr = ConioCoordToPointer(Buff, Buff->CurrentX, Buff->CurrentY);
while (Buff->CurrentX < EndX)
{
@@ -191,7 +194,7 @@
*Ptr++ = Buff->DefaultAttrib;
Buff->CurrentX++;
}
- UpdateRect.Right = max(UpdateRect.Right, (LONG) Buff->CurrentX - 1);
+ UpdateRect.Right = max(UpdateRect.Right, (LONG)Buff->CurrentX - 1);
if (Buff->CurrentX == Buff->MaxX)
{
if (Buff->Mode & ENABLE_WRAP_AT_EOL_OUTPUT)
@@ -206,9 +209,16 @@
}
continue;
}
+ /* --- BEL ---*/
+ else if (Buffer[i] == '\a')
+ {
+ DPRINT1("Bell\n");
+ SendNotifyMessage(Console->hWindow, PM_CONSOLE_BEEP, 0, 0);
+ continue;
+ }
}
UpdateRect.Left = min(UpdateRect.Left, (LONG)Buff->CurrentX);
- UpdateRect.Right = max(UpdateRect.Right, (LONG) Buff->CurrentX);
+ UpdateRect.Right = max(UpdateRect.Right, (LONG)Buff->CurrentX);
Ptr = ConioCoordToPointer(Buff, Buff->CurrentX, Buff->CurrentY);
Ptr[0] = Buffer[i];
if (Attrib)
Modified: branches/ros-csrss/win32ss/user/consrv/guiconsole.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] Wed Jan 30 22:59:47
2013
@@ -65,15 +65,6 @@
POINT OldCursor;
} GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA;
-#ifndef WM_APP
-#define WM_APP 0x8000
-#endif
-#define PM_CREATE_CONSOLE (WM_APP + 1)
-#define PM_DESTROY_CONSOLE (WM_APP + 2)
-
-#define CURSOR_BLINK_TIME 500
-#define DEFAULT_ATTRIB (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
-
static BOOL ConsInitialized = FALSE;
static HWND NotifyWnd;
@@ -2065,6 +2056,11 @@
}
break;
+ case PM_CONSOLE_BEEP:
+ DPRINT1("Beep !!\n");
+ Beep(800, 200);
+ break;
+
default:
Result = DefWindowProcW(hWnd, msg, wParam, lParam);
break;
Modified: branches/ros-csrss/win32ss/user/consrv/tuiconsole.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/t…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/tuiconsole.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/tuiconsole.c [iso-8859-1] Wed Jan 30 22:59:47
2013
@@ -296,7 +296,7 @@
return;
}
- if (! WriteFile(ConsoleDeviceHandle, Buffer, Length, &BytesWritten, NULL))
+ if (!WriteFile(ConsoleDeviceHandle, Buffer, Length, &BytesWritten, NULL))
{
DPRINT1("Error writing to BlueScreen\n");
}