2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Console Server DLL
4 * FILE: win32ss/user/winsrv/consrv/frontends/gui/graphics.c
5 * PURPOSE: GUI Terminal Front-End - Support for graphics-mode screen-buffers
6 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
9 /* INCLUDES *******************************************************************/
12 #include "include/conio.h"
13 #include "include/settings.h"
14 #include "guisettings.h"
20 /* FUNCTIONS ******************************************************************/
23 GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer
)
26 * This function supposes that the system clipboard was opened.
29 // PCONSOLE Console = Buffer->Header.Console;
35 GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer
)
38 * This function supposes that the system clipboard was opened.
41 // PCONSOLE Console = Buffer->Header.Console;
47 GuiPaintGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer
,
48 PGUI_CONSOLE_DATA GuiData
,
52 if (Buffer
->BitMap
== NULL
) return;
55 NtWaitForSingleObject(Buffer
->Mutex
, FALSE
, NULL
);
58 * The seventh parameter (YSrc) of SetDIBitsToDevice always designates
59 * the Y-coordinate of the "lower-left corner" of the image, be the DIB
60 * in bottom-up or top-down mode.
62 SetDIBitsToDevice(hDC
,
63 /* Coordinates / size of the repainted rectangle, in the view's frame */
68 /* Coordinates / size of the corresponding image portion, in the graphics screen-buffer's frame */
69 Buffer
->ViewOrigin
.X
+ rc
->left
,
70 Buffer
->ViewOrigin
.Y
+ rc
->top
,
72 Buffer
->ScreenBufferSize
.Y
, // == Buffer->BitMapInfo->bmiHeader.biHeight
77 /* Release the mutex */
78 NtReleaseMutant(Buffer
->Mutex
, NULL
);