reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h
Katayama Hirofumi MZ b41299470b
[WIN32SS][WINSRV] Fullwidth character handling Part 2 (#2240)
Follow-up of #2231. Also fix FillConsoleOutputAttribute, WriteConsoleOutputCharacterW and WriteConsoleOutputAttribute functions.
CORE-12451
2020-01-12 22:04:57 +09:00

124 lines
3.3 KiB
C

/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Console Server DLL
* FILE: win32ss/user/winsrv/consrv/frontends/gui/guiterm.h
* PURPOSE: GUI Terminal Front-End
* PROGRAMMERS: Gé van Geldorp
* Johannes Anderwald
* Jeffrey Morlan
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
*/
#pragma once
#include "guisettings.h"
#include "conwnd.h"
/* HELPER FUNCTIONS ***********************************************************/
FORCEINLINE
VOID
GetScreenBufferSizeUnits(IN PCONSOLE_SCREEN_BUFFER Buffer,
IN PGUI_CONSOLE_DATA GuiData,
OUT PUINT WidthUnit,
OUT PUINT HeightUnit)
{
ASSERT(Buffer && GuiData && WidthUnit && HeightUnit);
if (GetType(Buffer) == TEXTMODE_BUFFER)
{
*WidthUnit = GuiData->CharWidth ;
*HeightUnit = GuiData->CharHeight;
}
else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */
{
*WidthUnit = 1;
*HeightUnit = 1;
}
}
FORCEINLINE
VOID
SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect)
{
PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer;
UINT WidthUnit, HeightUnit;
GetScreenBufferSizeUnits(Buffer, GuiData, &WidthUnit, &HeightUnit);
Rect->left = (SmallRect->Left - Buffer->ViewOrigin.X) * WidthUnit ;
Rect->top = (SmallRect->Top - Buffer->ViewOrigin.Y) * HeightUnit;
Rect->right = (SmallRect->Right + 1 - Buffer->ViewOrigin.X) * WidthUnit ;
Rect->bottom = (SmallRect->Bottom + 1 - Buffer->ViewOrigin.Y) * HeightUnit;
}
/* FUNCTIONS ******************************************************************/
/* guiterm.c */
VOID
GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData);
/* conwnd.c */
BOOL
InitFonts(PGUI_CONSOLE_DATA GuiData,
LPWSTR FaceName, // Points to a WCHAR array of LF_FACESIZE elements.
ULONG FontFamily,
COORD FontSize,
ULONG FontWeight);
VOID
DeleteFonts(PGUI_CONSOLE_DATA GuiData);
/* fullscreen.c */
BOOL
EnterFullScreen(PGUI_CONSOLE_DATA GuiData);
VOID
LeaveFullScreen(PGUI_CONSOLE_DATA GuiData);
VOID
SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen);
VOID
GuiConsoleSwitchFullScreen(PGUI_CONSOLE_DATA GuiData);
/* graphics.c */
VOID
GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer,
PGUI_CONSOLE_DATA GuiData);
VOID
GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer,
PGUI_CONSOLE_DATA GuiData);
VOID
GuiPaintGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer,
PGUI_CONSOLE_DATA GuiData,
PRECT rcView,
PRECT rcFramebuffer);
/* text.c */
VOID
PasteText(
IN PCONSRV_CONSOLE Console,
IN PWCHAR Buffer,
IN SIZE_T cchSize);
VOID
GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
PGUI_CONSOLE_DATA GuiData);
VOID
GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
PGUI_CONSOLE_DATA GuiData);
VOID
GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer,
PGUI_CONSOLE_DATA GuiData,
PRECT rcView,
PRECT rcFramebuffer);
/* EOF */