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;
54 rcFramebuffer
->left
= Buffer
->ViewOrigin
.X
* 1 + rcView
->left
;
55 rcFramebuffer
->top
= Buffer
->ViewOrigin
.Y
* 1 + rcView
->top
;
56 rcFramebuffer
->right
= Buffer
->ViewOrigin
.X
* 1 + rcView
->right
;
57 rcFramebuffer
->bottom
= Buffer
->ViewOrigin
.Y
* 1 + rcView
->bottom
;
60 NtWaitForSingleObject(Buffer
->Mutex
, FALSE
, NULL
);
63 * The seventh parameter (YSrc) of SetDIBitsToDevice always designates
64 * the Y-coordinate of the "lower-left corner" of the image, be the DIB
65 * in bottom-up or top-down mode.
67 SetDIBitsToDevice(GuiData
->hMemDC
,
68 /* Coordinates / size of the repainted rectangle, in the framebuffer's frame */
71 rcFramebuffer
->right
- rcFramebuffer
->left
,
72 rcFramebuffer
->bottom
- rcFramebuffer
->top
,
73 /* Coordinates / size of the corresponding image portion, in the graphics screen-buffer's frame */
77 Buffer
->ScreenBufferSize
.Y
, // == Buffer->BitMapInfo->bmiHeader.biHeight
82 /* Release the mutex */
83 NtReleaseMutant(Buffer
->Mutex
, NULL
);