23#define IS_WHITESPACE(c) ((c) == L'\0' || (c) == L' ' || (c) == L'\t')
30 HPALETTE hPalette =
Console->ActiveBuffer->PaletteHandle;
52 ULONG selWidth, selHeight;
56 DPRINT(
"CopyBlock(%u, %u, %u, %u)\n",
75 size += (selWidth + (!InlineCopyMode ? 2 : 0)) * (selHeight - 1);
79 DPRINT1(
"This case must never happen, because selHeight is at least == 1\n");
87 if (hData ==
NULL)
return;
96 DPRINT(
"Copying %dx%d selection\n", selWidth, selHeight);
99 for (yPos = 0; yPos < selHeight; yPos++)
105 Selection->
Top + yPos);
117 for (xPos = 0; xPos <
length; xPos++)
127 *dstPos++ = (
ptr[xPos].Char.UnicodeChar ?
ptr[xPos].Char.UnicodeChar :
L' ');
134 if (yPos != (selHeight - 1))
142 DPRINT(
"Setting data <%S> to clipboard\n",
data);
158 ULONG xPos, yPos, xBeg, xEnd;
160 DPRINT(
"CopyLines((%u, %u) ; (%u, %u))\n",
171 NumChars = End->
X -
Begin->X + 1;
177 if (End->
Y >=
Begin->Y + 2)
179 NumChars += (End->
Y -
Begin->Y - 1) *
Buffer->ScreenBufferSize.X;
182 NumChars += End->
X + 1;
189 if (hData ==
NULL)
return;
198 DPRINT(
"Copying %d characters\n", NumChars);
206 for (yPos =
Begin->Y; (yPos <= (
ULONG)End->
Y) && (NumChars > 0); yPos++)
209 xEnd = (yPos == End->
Y ? End->
X :
Buffer->ScreenBufferSize.X - 1);
214 for (xPos = xBeg; (xPos <= xEnd) && (NumChars-- > 0); xPos++)
224 *dstPos++ = (
ptr[xPos].Char.UnicodeChar ?
ptr[xPos].Char.UnicodeChar :
L' ');
229 DPRINT(
"Setting data <%S> to clipboard\n",
data);
248 if (!
Buffer || (cchSize <= 0))
256 if (CurChar ==
L'\r' && *
Buffer ==
L'\n')
267 DPRINT1(
"FIXME: TODO: VkKeyScanW failed - Should simulate the key!\n");
315 DPRINT(
"Selection is (%d|%d) to (%d|%d) in %s mode\n",
320 (LineSelection ?
"line" :
"block"));
352 if (hData ==
NULL)
return;
355 if (pszText ==
NULL)
return;
357 DPRINT(
"Got data <%S> from clipboard\n", pszText);
374 ULONG CursorX, CursorY, CursorHeight;
375 HBRUSH CursorBrush, OldBrush;
382 CursorX =
Buffer->CursorPosition.X;
383 CursorY =
Buffer->CursorPosition.Y;
384 if (LeftColumn <= CursorX && CursorX <= RightColumn &&
385 TopLine <= CursorY && CursorY <= BottomLine)
391 Attribute =
Buffer->ScreenDefaultAttrib;
439 ULONG TopLine, BottomLine, LeftColumn, RightColumn;
443 WORD LastAttribute, Attribute;
465 if (RightColumn >= (
ULONG)
Buffer->ScreenBufferSize.X)
466 RightColumn =
Buffer->ScreenBufferSize.X - 1;
470 if (BottomLine >= (
ULONG)
Buffer->ScreenBufferSize.Y)
471 BottomLine =
Buffer->ScreenBufferSize.Y - 1;
488 for (Char = LeftColumn; Char <= RightColumn; Char++)
491 Attribute = From->Attributes;
511 &From->Char.UnicodeChar, 1);
519 WCHAR LineBuffer[80];
524 for (Char = LeftColumn; Char <= RightColumn; Char++)
530 if (From->Attributes != LastAttribute || (Char -
Start ==
sizeof(LineBuffer) /
sizeof(
WCHAR)))
539 Attribute = From->Attributes;
540 if (Attribute != LastAttribute)
542 LastAttribute = Attribute;
557 *(To++) = (From++)->Char.UnicodeChar;
564 RightColumn -
Start + 1);
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN Begin
struct _CONSRV_CONSOLE * PCONSRV_CONSOLE
#define ConioRectWidth(Rect)
#define ConioRectHeight(Rect)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLuint GLsizei GLsizei * length
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
CONSOLE_SELECTION_INFO Selection
union _KEY_EVENT_RECORD::@3281 uChar
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
COLORREF WINAPI SetTextColor(_In_ HDC hdc, _In_ COLORREF crColor)
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ INT nXStart, _In_ INT nYStart, _In_reads_(cchString) LPCWSTR lpString, _In_ INT cchString)
#define DEFAULT_SCREEN_ATTRIB
#define RGBFromAttrib(Console, Attribute)
#define TextAttribFromAttrib(Attribute)
#define BkgdAttribFromAttrib(Attribute)
BOOLEAN NTAPI ConDrvValidateConsoleUnsafe(IN PCONSOLE Console, IN CONSOLE_STATE ExpectedState, IN BOOLEAN LockConsole)
PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y)
VOID GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData)
static VOID CopyBlock(PTEXTMODE_SCREEN_BUFFER Buffer, PSMALL_RECT Selection)
static VOID GuiPaintCaret(PTEXTMODE_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData, ULONG TopLine, ULONG BottomLine, ULONG LeftColumn, ULONG RightColumn)
VOID PasteText(IN PCONSRV_CONSOLE Console, IN PWCHAR Buffer, IN SIZE_T cchSize)
static VOID CopyLines(PTEXTMODE_SCREEN_BUFFER Buffer, PCOORD Begin, PCOORD End)
static COLORREF PaletteRGBFromAttrib(PCONSRV_CONSOLE Console, WORD Attribute)
VOID GetSelectionBeginEnd(PCOORD Begin, PCOORD End, PCOORD SelectionAnchor, PSMALL_RECT SmallRect)
VOID GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData)
VOID GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData, PRECT rcView, PRECT rcFramebuffer)
#define ConioIsRectEmpty(Rect)
#define ConioInitLongRect(Rect, Top, Left, Bottom, Right)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define COMMON_LVB_TRAILING_BYTE
#define LEFT_CTRL_PRESSED
#define COMMON_LVB_UNDERSCORE
#define COMMON_LVB_LEADING_BYTE
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define PALETTERGB(r, g, b)
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
HANDLE WINAPI GetClipboardData(_In_ UINT)
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
BOOL WINAPI EmptyClipboard(void)
SHORT WINAPI VkKeyScanW(_In_ WCHAR)
SHORT WINAPI GetKeyState(_In_ int)