ReactOS  0.4.13-dev-79-gcd489d8
RdpClientUI Class Reference
Collaboration diagram for RdpClientUI:

Public Member Functions

HRESULT Initialize (HWND hwndParent)
 
void Display_SetClip (int x, int y, int cx, int cy)
 
void Display_ResetClip ()
 
void Display_PaintBitmap (int x, int y, int cx, int cy, int width, int height, uint8 *data)
 
void Display_DestBlt (uint8 opcode, int x, int y, int cx, int cy)
 
void Display_PatBlt (uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
 
void Display_ScreenBlt (uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
 
void Display_MemBlt (uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy)
 
void Display_TriBlt (uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy, BRUSH *brush, int bgcolour, int fgcolour)
 
void Display_Line (uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
 
void Display_Rect (int x, int y, int cx, int cy, int colour)
 
void Display_Polygon (uint8 opcode, uint8 fillmode, POINT *point, int npoints, BRUSH *brush, int bgcolour, int fgcolour)
 
void Display_Polyline (uint8 opcode, POINT *points, int npoints, PEN *pen)
 
void Display_Ellypse (uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
 
void Display_DrawGlyph (int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy, int bgcolour, int fgcolour)
 
void Display_DoGlyph (uint8 font, uint8 flags, int mixmode, int &x, int &y, int bgcolour, int fgcolour, const uint8 *ttext, int &idx)
 
void Display_DrawText (uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y, int clipx, int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, BRUSH *brush, int bgcolour, int fgcolour, uint8 *text, uint8 length)
 
void Display_SaveDesktop (uint32 offset, int x, int y, int cx, int cy)
 
void Display_RestoreDesktop (uint32 offset, int x, int y, int cx, int cy)
 
void Display_BeginUpdate ()
 
void Display_EndUpdate ()
 
LRESULT InputWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Static Public Member Functions

static BOOL Startup ()
 
static void Shutdown ()
 

Public Attributes

HWND m_inputWindow
 
HCURSOR m_inputCursor
 

Private Member Functions

LRESULT UIWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT ConsoleWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT DisplayWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void Display_RepaintRect (const RECT *lprc)
 
void Display_RepaintArea (int x, int y, int cx, int cy)
 
void Display_RepaintPolygon (POINT *point, int npoints, int linewidth)
 
void Display_RepaintAll ()
 

Private Attributes

HWND m_uiWindow
 
LONG m_scrollHPos
 
LONG m_scrollVPos
 
HWND m_fullScreenBarWindow
 
HWND m_consoleWindow
 
LONG m_consoleX
 
LONG m_consoleY
 
LONG m_consoleWidth
 
LONG m_consoleHeight
 
bool m_smartSizing
 
HWND m_displayWindow
 
LONG m_displayBufferWidth
 
LONG m_displayBufferHeight
 
HDC m_displayBuffer
 
voidm_displayBufferRaw
 
int m_displayBufferSave
 
int m_displayBufferBitDepth
 
int m_displayBufferByteDepth
 
int m_displayBufferStride
 
RECT m_displayBufferClip
 
CRITICAL_SECTION m_displayBufferMutex
 

Detailed Description

Definition at line 300 of file activex.cpp.

Member Function Documentation

◆ ConsoleWindowProc()

LRESULT RdpClientUI::ConsoleWindowProc ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlineprivate

Definition at line 485 of file activex.cpp.

486  {
487  switch(uMsg)
488  {
489  case WM_SIZE:
490  {
491  RECT rcClient;
492  GetClientRect(m_consoleWindow, &rcClient);
493 
494  MoveWindow(m_inputWindow, 0, 0, rcClient.right, rcClient.bottom, TRUE);
495  MoveWindow(m_displayWindow, 0, 0, rcClient.right, rcClient.bottom, TRUE);
496  }
497 
498  return 0;
499 
500  default:
501  break;
502  }
503 
504  return DefWindowProc(m_consoleWindow, uMsg, wParam, lParam);
505  }
#define TRUE
Definition: types.h:120
HWND m_consoleWindow
Definition: activex.cpp:478
LONG right
Definition: windef.h:293
WPARAM wParam
Definition: combotst.c:138
HWND m_displayWindow
Definition: activex.cpp:513
HWND m_inputWindow
Definition: activex.cpp:1163
#define DefWindowProc
Definition: ros2win.h:31
#define WM_SIZE
Definition: winuser.h:1593
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LONG bottom
Definition: windef.h:294
LPARAM lParam
Definition: combotst.c:139

◆ Display_BeginUpdate()

void RdpClientUI::Display_BeginUpdate ( )
inline

Definition at line 1144 of file activex.cpp.

1145  {
1148  }
int m_displayBufferSave
Definition: activex.cpp:518
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
CRITICAL_SECTION m_displayBufferMutex
Definition: activex.cpp:523
HDC m_displayBuffer
Definition: activex.cpp:516
int WINAPI SaveDC(_In_ HDC)

◆ Display_DestBlt()

void RdpClientUI::Display_DestBlt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy 
)
inline

Definition at line 711 of file activex.cpp.

712  {
713  int dcsave = SaveDC(m_displayBuffer);
715  PatBlt(m_displayBuffer, x, y, cx, cy, MAKELONG(0, opcode));
716  RestoreDC(m_displayBuffer, dcsave);
718  }
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
#define MAKELONG(a, b)
Definition: typedefs.h:248
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
#define BLACK_BRUSH
Definition: wingdi.h:895
HDC m_displayBuffer
Definition: activex.cpp:516
int WINAPI SaveDC(_In_ HDC)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)

◆ Display_DoGlyph()

void RdpClientUI::Display_DoGlyph ( uint8  font,
uint8  flags,
int  mixmode,
int x,
int y,
int  bgcolour,
int  fgcolour,
const uint8 ttext,
int idx 
)
inline

Definition at line 938 of file activex.cpp.

939  {
940  FONTGLYPH * glyph;
941 
942  glyph = cache_get_font(/*This*/NULL, font, ttext[idx]);
943 
944  if(!(flags & TEXT2_IMPLICIT_X))
945  {
946  int xyoffset = ttext[++ idx];
947 
948  if((xyoffset & 0x80))
949  {
950  if (flags & TEXT2_VERTICAL)
951  y += ttext[idx + 1] | (ttext[idx + 2] << 8);
952  else
953  x += ttext[idx + 1] | (ttext[idx + 2] << 8);
954 
955  idx += 2;
956  }
957  else
958  {
959  if (flags & TEXT2_VERTICAL)
960  y += xyoffset;
961  else
962  x += xyoffset;
963  }
964  }
965 
966  if(glyph)
967  {
969  (
970  mixmode,
971  x + (short)glyph->offset,
972  y + (short)glyph->baseline,
973  glyph->width,
974  glyph->height,
975  glyph->pixmap,
976  0,
977  0,
978  bgcolour,
979  fgcolour
980  );
981 
982  if(flags & TEXT2_IMPLICIT_X)
983  x += glyph->width;
984  }
985  }
#define TEXT2_IMPLICIT_X
Definition: constants.h:276
Definition: mk_font.cpp:20
uint16 height
Definition: types.h:115
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
sint16 baseline
Definition: types.h:113
FONTGLYPH * cache_get_font(uint8 font, uint16 character)
Definition: cache.c:279
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
void Display_DrawGlyph(int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy, int bgcolour, int fgcolour)
Definition: activex.cpp:892
GLbitfield flags
Definition: glext.h:7161
uint16 width
Definition: types.h:114
sint16 offset
Definition: types.h:112
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define TEXT2_VERTICAL
Definition: constants.h:275
RD_HBITMAP pixmap
Definition: types.h:116

◆ Display_DrawGlyph()

void RdpClientUI::Display_DrawGlyph ( int  mixmode,
int  x,
int  y,
int  cx,
int  cy,
HGLYPH  glyph,
int  srcx,
int  srcy,
int  bgcolour,
int  fgcolour 
)
inline

Definition at line 892 of file activex.cpp.

893  {
894  HBITMAP hbmGlyph = (HBITMAP)glyph;
896  HGDIOBJ hOld = SelectObject(hdcGlyph, hbmGlyph);
897 
898  int dcsave = SaveDC(m_displayBuffer);
899 
900  switch(mixmode)
901  {
902  case MIX_TRANSPARENT:
903  {
904  /*
905  ROP is DSPDxax:
906  - where the glyph (S) is white, D is set to the foreground color (P)
907  - where the glyph (S) is black, D is left untouched
908 
909  This paints a transparent glyph in the specified color
910  */
911  HBRUSH hbr = CreateSolidBrush(fgcolour);
913  BitBlt(m_displayBuffer, x, y, cx, cy, hdcGlyph, srcx, srcy, MAKELONG(0, 0xe2));
914  DeleteObject(hbr);
915  }
916 
917  break;
918 
919  case MIX_OPAQUE:
920  {
921  /* Curiously, glyphs are inverted (white-on-black) */
922  SetBkColor(m_displayBuffer, fgcolour);
923  SetTextColor(m_displayBuffer, bgcolour);
924  BitBlt(m_displayBuffer, x, y, cx, cy, hdcGlyph, srcx, srcy, SRCCOPY);
925  }
926 
927  break;
928  }
929 
930  RestoreDC(m_displayBuffer, dcsave);
931 
932  SelectObject(hdcGlyph, hOld);
933  DeleteDC(hdcGlyph);
934 
936  }
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define MIX_OPAQUE
Definition: constants.h:273
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
#define MAKELONG(a, b)
Definition: typedefs.h:248
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
#define MIX_TRANSPARENT
Definition: constants.h:272
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:884
BOOL WINAPI DeleteDC(_In_ HDC)
HDC m_displayBuffer
Definition: activex.cpp:516
int WINAPI SaveDC(_In_ HDC)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570
static HBITMAP
Definition: button.c:44
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)
#define SRCCOPY
Definition: wingdi.h:332

◆ Display_DrawText()

void RdpClientUI::Display_DrawText ( uint8  font,
uint8  flags,
uint8  opcode,
int  mixmode,
int  x,
int  y,
int  clipx,
int  clipy,
int  clipcx,
int  clipcy,
int  boxx,
int  boxy,
int  boxcx,
int  boxcy,
BRUSH brush,
int  bgcolour,
int  fgcolour,
uint8 text,
uint8  length 
)
inline

Definition at line 988 of file activex.cpp.

1009  {
1010  int i, j;
1011  DATABLOB *entry;
1012 
1013  HBRUSH hbr = CreateSolidBrush(bgcolour);
1014  HGDIOBJ holdbrush = SelectObject(m_displayBuffer, hbr);
1016 
1017  if (boxcx > 1)
1018  Rectangle(m_displayBuffer, boxx, boxy, boxx + boxcx + 1, boxy + boxcy + 1);
1019  else if (mixmode == MIX_OPAQUE)
1020  Rectangle(m_displayBuffer, clipx, clipy, clipx + clipcx + 1, clipy + clipcy + 1);
1021 
1022  SelectObject(m_displayBuffer, holdpen);
1023  SelectObject(m_displayBuffer, holdbrush);
1024 
1025  DeleteObject(hbr);
1026 
1027  if(boxcx > 1)
1028  Display_RepaintArea(boxx, boxy, boxcx, boxcy);
1029  else
1030  Display_RepaintArea(clipx, clipy, clipcx, clipcy);
1031 
1032  /* Paint text, character by character */
1033  for (i = 0; i < length;)
1034  {
1035  switch (text[i])
1036  {
1037  case 0xff:
1038  /* At least two bytes needs to follow */
1039  if (i + 3 > length)
1040  {
1041  warning("Skipping short 0xff command:");
1042  for (j = 0; j < length; j++)
1043  fprintf(stderr, "%02x ", text[j]);
1044  fprintf(stderr, "\n");
1045  i = length = 0;
1046  break;
1047  }
1048  cache_put_text(NULL /* TODO */, text[i + 1], text, text[i + 2]);
1049  i += 3;
1050  length -= i;
1051  /* this will move pointer from start to first character after FF command */
1052  text = &(text[i]);
1053  i = 0;
1054  break;
1055 
1056  case 0xfe:
1057  /* At least one byte needs to follow */
1058  if (i + 2 > length)
1059  {
1060  warning("Skipping short 0xfe command:");
1061  for (j = 0; j < length; j++)
1062  fprintf(stderr, "%02x ", text[j]);
1063  fprintf(stderr, "\n");
1064  i = length = 0;
1065  break;
1066  }
1067  entry = cache_get_text(/*This*/NULL, text[i + 1]);
1068  if (entry->data != NULL)
1069  {
1070  if ((((uint8 *) (entry->data))[1] == 0)
1071  && (!(flags & TEXT2_IMPLICIT_X)) && (i + 2 < length))
1072  {
1073  if (flags & TEXT2_VERTICAL)
1074  y += text[i + 2];
1075  else
1076  x += text[i + 2];
1077  }
1078  for (j = 0; j < entry->size; j++)
1079  Display_DoGlyph(font, flags, mixmode, x, y, bgcolour, fgcolour, ((uint8 *) (entry->data)), j);
1080  }
1081  if (i + 2 < length)
1082  i += 3;
1083  else
1084  i += 2;
1085  length -= i;
1086  /* this will move pointer from start to first character after FE command */
1087  text = &(text[i]);
1088  i = 0;
1089  break;
1090 
1091  default:
1092  Display_DoGlyph(font, flags, mixmode, x, y, bgcolour, fgcolour, text, i);
1093  i++;
1094  break;
1095  }
1096  }
1097  }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TEXT2_IMPLICIT_X
Definition: constants.h:276
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
Definition: mk_font.cpp:20
const WCHAR * text
Definition: package.c:1827
uint8_t entry
Definition: isohybrid.c:63
void Display_DoGlyph(uint8 font, uint8 flags, int mixmode, int &x, int &y, int bgcolour, int fgcolour, const uint8 *ttext, int &idx)
Definition: activex.cpp:938
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define MIX_OPAQUE
Definition: constants.h:273
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define NULL_PEN
Definition: wingdi.h:903
void cache_put_text(uint8 cache_id, void *data, int length)
Definition: cache.c:335
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
smooth NULL
Definition: ftsmooth.c:416
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned char uint8
Definition: types.h:28
GLbitfield flags
Definition: glext.h:7161
HDC m_displayBuffer
Definition: activex.cpp:516
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
FILE * stderr
DATABLOB * cache_get_text(uint8 cache_id)
Definition: cache.c:325
#define TEXT2_VERTICAL
Definition: constants.h:275
#define warning(s)
Definition: debug.h:71

◆ Display_Ellypse()

void RdpClientUI::Display_Ellypse ( uint8  opcode,
uint8  fillmode,
int  x,
int  y,
int  cx,
int  cy,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)
inline

Definition at line 884 of file activex.cpp.

885  {
886  // TODO
887 
889  }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570

◆ Display_EndUpdate()

void RdpClientUI::Display_EndUpdate ( )
inline

Definition at line 1150 of file activex.cpp.

1151  {
1154  }
int m_displayBufferSave
Definition: activex.cpp:518
CRITICAL_SECTION m_displayBufferMutex
Definition: activex.cpp:523
HDC m_displayBuffer
Definition: activex.cpp:516
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)

◆ Display_Line()

void RdpClientUI::Display_Line ( uint8  opcode,
int  startx,
int  starty,
int  endx,
int  endy,
PEN pen 
)
inline

Definition at line 777 of file activex.cpp.

778  {
779  HPEN hpen = CreatePen(pen->style, pen->width, pen->colour);
780 
781  int dcsave = SaveDC(m_displayBuffer);
782 
783  SetROP2(m_displayBuffer, opcode);
785  MoveToEx(m_displayBuffer, startx, starty, NULL);
786 
787  LineTo(m_displayBuffer, endx, endy);
788 
789  RestoreDC(m_displayBuffer, dcsave);
790 
792 
793  RECT rcDamage;
794 
795  if(startx < endx)
796  {
797  rcDamage.left = startx;
798  rcDamage.right = endx;
799  }
800  else
801  {
802  rcDamage.left = endx;
803  rcDamage.right = startx;
804  }
805 
806  if(starty < endy)
807  {
808  rcDamage.top = starty;
809  rcDamage.bottom = endy;
810  }
811  else
812  {
813  rcDamage.top = endy;
814  rcDamage.bottom = starty;
815  }
816 
817  InflateRect(&rcDamage, pen->width, pen->width);
818  Display_RepaintRect(&rcDamage);
819  }
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
LONG top
Definition: windef.h:292
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
static HPEN hpen
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
int WINAPI SetROP2(_In_ HDC, _In_ int)
Definition: dc.c:1083
uint8 width
Definition: types.h:85
smooth NULL
Definition: ftsmooth.c:416
uint32 colour
Definition: types.h:86
void Display_RepaintRect(const RECT *lprc)
Definition: activex.cpp:606
HDC m_displayBuffer
Definition: activex.cpp:516
uint8 style
Definition: types.h:84
int WINAPI SaveDC(_In_ HDC)
LONG bottom
Definition: windef.h:294
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)

◆ Display_MemBlt()

void RdpClientUI::Display_MemBlt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
HBITMAP  src,
int  srcx,
int  srcy 
)
inline

Definition at line 746 of file activex.cpp.

747  {
749  HGDIOBJ hOld = SelectObject(hdcSrc, src);
750 
751  BitBlt(m_displayBuffer, x, y, cx, cy, hdcSrc, srcx, srcy, MAKELONG(0, opcode));
752 
753  SelectObject(hdcSrc, hOld);
754  DeleteDC(hdcSrc);
755 
757  }
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static HDC hdcSrc
Definition: xlate.c:32
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
#define MAKELONG(a, b)
Definition: typedefs.h:248
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
GLenum src
Definition: glext.h:6340
BOOL WINAPI DeleteDC(_In_ HDC)
HDC m_displayBuffer
Definition: activex.cpp:516
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570

◆ Display_PaintBitmap()

void RdpClientUI::Display_PaintBitmap ( int  x,
int  y,
int  cx,
int  cy,
int  width,
int  height,
uint8 data 
)
inline

Definition at line 687 of file activex.cpp.

688  {
689  GdiFlush();
690 
691  int fromstride = alignup(width * m_displayBufferByteDepth, 4);
692  int sizex = cx * m_displayBufferByteDepth;
693 
694  const uint8 * src = data;
695 
696  uint8 * dst =
700 
701  for(int i = 0; i < cy; ++ i)
702  {
703  memcpy(dst, src, sizex);
704  src += fromstride;
706  }
707 
709  }
GLint GLint GLsizei width
Definition: gl.h:1546
void * m_displayBufferRaw
Definition: activex.cpp:517
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
T alignup(const T &X, const U &align)
Definition: activex.cpp:135
int m_displayBufferStride
Definition: activex.cpp:521
int m_displayBufferByteDepth
Definition: activex.cpp:520
unsigned char uint8
Definition: types.h:28
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum src
Definition: glext.h:6340
LONG m_displayBufferHeight
Definition: activex.cpp:515
BOOL WINAPI GdiFlush(void)
Definition: misc.c:44
GLenum GLenum dst
Definition: glext.h:6340
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570

◆ Display_PatBlt()

void RdpClientUI::Display_PatBlt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)
inline

Definition at line 720 of file activex.cpp.

721  {
722  HBRUSH hbr = win32_create_brush(brush, fgcolour);
723 
724  int dcsave = SaveDC(m_displayBuffer);
725 
726  SetBkColor(m_displayBuffer, bgcolour);
727  SetTextColor(m_displayBuffer, fgcolour);
728  SetBrushOrgEx(m_displayBuffer, brush->xorigin, brush->yorigin, NULL);
730 
731  PatBlt(m_displayBuffer, x, y, cx, cy, MAKELONG(0, opcode));
732 
733  RestoreDC(m_displayBuffer, dcsave);
734 
735  DeleteObject(hbr);
736 
738  }
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
#define MAKELONG(a, b)
Definition: typedefs.h:248
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI SetBrushOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HBRUSH win32_create_brush(BRUSH *brush, COLORREF fgcolour)
Definition: activex.cpp:240
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:884
HDC m_displayBuffer
Definition: activex.cpp:516
int WINAPI SaveDC(_In_ HDC)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)

◆ Display_Polygon()

void RdpClientUI::Display_Polygon ( uint8  opcode,
uint8  fillmode,
POINT point,
int  npoints,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)
inline

Definition at line 839 of file activex.cpp.

840  {
841  HBRUSH hbr = win32_create_brush(brush, fgcolour);
842 
843  int dcsave = SaveDC(m_displayBuffer);
844 
845  SetBkColor(m_displayBuffer, bgcolour);
846  SetTextColor(m_displayBuffer, fgcolour);
847  SetPolyFillMode(m_displayBuffer, fillmode);
849 
850  Polygon(m_displayBuffer, point, npoints);
851 
852  RestoreDC(m_displayBuffer, dcsave);
853 
854  Display_RepaintPolygon(point, npoints, 0);
855  }
BOOL Polygon(CONST PPOINT UnsafePoints, int Count, int polyFillMode)
Definition: polytest.cpp:730
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
POINTL point
Definition: edittest.c:50
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
int WINAPI SetPolyFillMode(_In_ HDC, _In_ int)
Definition: dc.c:1143
HBRUSH win32_create_brush(BRUSH *brush, COLORREF fgcolour)
Definition: activex.cpp:240
void Display_RepaintPolygon(POINT *point, int npoints, int linewidth)
Definition: activex.cpp:629
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:884
HDC m_displayBuffer
Definition: activex.cpp:516
int WINAPI SaveDC(_In_ HDC)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)

◆ Display_Polyline()

void RdpClientUI::Display_Polyline ( uint8  opcode,
POINT points,
int  npoints,
PEN pen 
)
inline

Definition at line 857 of file activex.cpp.

858  {
859  POINT last = points[0];
860 
861  for(int i = 1; i < npoints; ++ i)
862  {
863  points[i].x += last.x;
864  points[i].y += last.y;
865  last = points[i];
866  }
867 
868  HPEN hpen = CreatePen(pen->style, pen->width, pen->colour);
869 
870  int dcsave = SaveDC(m_displayBuffer);
871 
872  SetROP2(m_displayBuffer, opcode);
874 
875  Polyline(m_displayBuffer, points, npoints);
876 
877  RestoreDC(m_displayBuffer, dcsave);
878 
880 
881  Display_RepaintPolygon(points, npoints, pen->width);
882  }
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
POINT last
Definition: font.c:46
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static HPEN hpen
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int WINAPI SetROP2(_In_ HDC, _In_ int)
Definition: dc.c:1083
uint8 width
Definition: types.h:85
uint32 colour
Definition: types.h:86
GLsizei const GLfloat * points
Definition: glext.h:8112
void Display_RepaintPolygon(POINT *point, int npoints, int linewidth)
Definition: activex.cpp:629
HDC m_displayBuffer
Definition: activex.cpp:516
uint8 style
Definition: types.h:84
int WINAPI SaveDC(_In_ HDC)
BOOL WINAPI Polyline(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ int cpt)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)

◆ Display_Rect()

void RdpClientUI::Display_Rect ( int  x,
int  y,
int  cx,
int  cy,
int  colour 
)
inline

Definition at line 821 of file activex.cpp.

822  {
823  HBRUSH hbr = CreateSolidBrush(colour);
824 
825  int dcsave = SaveDC(m_displayBuffer);
826 
829 
830  Rectangle(m_displayBuffer, x, y, x + cx + 1, y + cy + 1);
831 
832  RestoreDC(m_displayBuffer, dcsave);
833 
834  DeleteObject(hbr);
835 
837  }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define NULL_PEN
Definition: wingdi.h:903
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
HDC m_displayBuffer
Definition: activex.cpp:516
int WINAPI SaveDC(_In_ HDC)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)

◆ Display_RepaintAll()

void RdpClientUI::Display_RepaintAll ( )
inlineprivate

Definition at line 660 of file activex.cpp.

661  {
663  }
HWND m_displayWindow
Definition: activex.cpp:513
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI InvalidateRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)

◆ Display_RepaintArea()

void RdpClientUI::Display_RepaintArea ( int  x,
int  y,
int  cx,
int  cy 
)
inlineprivate

Definition at line 616 of file activex.cpp.

617  {
618  if(m_smartSizing)
619  return Display_RepaintAll();
620 
621  RECT rcDamage;
622  rcDamage.left = x;
623  rcDamage.top = y;
624  rcDamage.right = x + cx;
625  rcDamage.bottom = y + cy;
626  Display_RepaintRect(&rcDamage);
627  }
LONG top
Definition: windef.h:292
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
bool m_smartSizing
Definition: activex.cpp:483
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
void Display_RepaintAll()
Definition: activex.cpp:660
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
void Display_RepaintRect(const RECT *lprc)
Definition: activex.cpp:606
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570
LONG bottom
Definition: windef.h:294

Referenced by Display_DestBlt(), Display_MemBlt(), Display_PaintBitmap(), Display_PatBlt(), Display_Rect(), Display_RestoreDesktop(), Display_ScreenBlt(), and Display_TriBlt().

◆ Display_RepaintPolygon()

void RdpClientUI::Display_RepaintPolygon ( POINT point,
int  npoints,
int  linewidth 
)
inlineprivate

Definition at line 629 of file activex.cpp.

630  {
631  if(m_smartSizing)
632  return Display_RepaintAll();
633 
634  RECT rcDamage;
635 
636  rcDamage.left = MAXLONG;
637  rcDamage.top = MAXLONG;
638  rcDamage.right = 0;
639  rcDamage.bottom = 0;
640 
641  for(int i = 0; i < npoints; ++ i)
642  {
643  if(point[i].x < rcDamage.left)
644  rcDamage.left = point[i].x;
645 
646  if(point[i].y < rcDamage.top)
647  rcDamage.top = point[i].y;
648 
649  if(point[i].x > rcDamage.right)
650  rcDamage.right = point[i].x;
651 
652  if(point[i].y > rcDamage.bottom)
653  rcDamage.bottom = point[i].y;
654  }
655 
656  InflateRect(&rcDamage, linewidth, linewidth);
657  Display_RepaintRect(&rcDamage);
658  }
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define MAXLONG
Definition: umtypes.h:116
LONG top
Definition: windef.h:292
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
bool m_smartSizing
Definition: activex.cpp:483
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
POINTL point
Definition: edittest.c:50
LONG y
Definition: windef.h:315
void Display_RepaintAll()
Definition: activex.cpp:660
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG x
Definition: windef.h:314
void Display_RepaintRect(const RECT *lprc)
Definition: activex.cpp:606
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
LONG bottom
Definition: windef.h:294

◆ Display_RepaintRect()

void RdpClientUI::Display_RepaintRect ( const RECT lprc)
inlineprivate

Definition at line 606 of file activex.cpp.

607  {
608  if(m_smartSizing)
609  return Display_RepaintAll();
610 
611  RECT rcDamage;
612  IntersectRect(&rcDamage, lprc, &m_displayBufferClip);
613  InvalidateRect(m_displayWindow, &rcDamage, FALSE);
614  }
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4334
bool m_smartSizing
Definition: activex.cpp:483
HWND m_displayWindow
Definition: activex.cpp:513
void Display_RepaintAll()
Definition: activex.cpp:660
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
RECT m_displayBufferClip
Definition: activex.cpp:522

◆ Display_ResetClip()

void RdpClientUI::Display_ResetClip ( )
inline

Definition at line 678 of file activex.cpp.

679  {
685  }
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
smooth NULL
Definition: ftsmooth.c:416
LONG m_displayBufferWidth
Definition: activex.cpp:514
LONG m_displayBufferHeight
Definition: activex.cpp:515
HDC m_displayBuffer
Definition: activex.cpp:516
LONG bottom
Definition: windef.h:294
RECT m_displayBufferClip
Definition: activex.cpp:522

◆ Display_RestoreDesktop()

void RdpClientUI::Display_RestoreDesktop ( uint32  offset,
int  x,
int  y,
int  cx,
int  cy 
)
inline

Definition at line 1120 of file activex.cpp.

1121  {
1122  int fromstride = cx * m_displayBufferByteDepth;
1123 
1125 
1126  uint8 * dst =
1130 
1131  GdiFlush();
1132 
1133  for(int i = 0; i < cy; ++ i)
1134  {
1135  memcpy(dst, src, fromstride);
1136  src += fromstride;
1138  }
1139 
1140  Display_RepaintArea(x, y, cx, cy);
1141  }
void * m_displayBufferRaw
Definition: activex.cpp:517
GLintptr offset
Definition: glext.h:5920
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
uint8 * cache_get_desktop(uint32 offset, int cx, int cy, int bytes_per_pixel)
Definition: cache.c:353
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
smooth NULL
Definition: ftsmooth.c:416
int m_displayBufferStride
Definition: activex.cpp:521
int m_displayBufferByteDepth
Definition: activex.cpp:520
unsigned char uint8
Definition: types.h:28
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum src
Definition: glext.h:6340
LONG m_displayBufferHeight
Definition: activex.cpp:515
BOOL WINAPI GdiFlush(void)
Definition: misc.c:44
GLenum GLenum dst
Definition: glext.h:6340
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570

◆ Display_SaveDesktop()

void RdpClientUI::Display_SaveDesktop ( uint32  offset,
int  x,
int  y,
int  cx,
int  cy 
)
inline

Definition at line 1099 of file activex.cpp.

1100  {
1101  GdiFlush();
1102 
1103  uint8 * data =
1107 
1109  (
1110  /*This*/NULL,
1112  cx,
1113  cy,
1116  data
1117  );
1118  }
void * m_displayBufferRaw
Definition: activex.cpp:517
GLintptr offset
Definition: glext.h:5920
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel, uint8 *data)
Definition: cache.c:371
smooth NULL
Definition: ftsmooth.c:416
int m_displayBufferStride
Definition: activex.cpp:521
int m_displayBufferByteDepth
Definition: activex.cpp:520
unsigned char uint8
Definition: types.h:28
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LONG m_displayBufferHeight
Definition: activex.cpp:515
BOOL WINAPI GdiFlush(void)
Definition: misc.c:44
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570

◆ Display_ScreenBlt()

void RdpClientUI::Display_ScreenBlt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
int  srcx,
int  srcy 
)
inline

Definition at line 740 of file activex.cpp.

741  {
742  BitBlt(m_displayBuffer, x, y, cx, cy, m_displayBuffer, srcx, srcy, MAKELONG(0, opcode));
744  }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
#define MAKELONG(a, b)
Definition: typedefs.h:248
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
HDC m_displayBuffer
Definition: activex.cpp:516
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570

◆ Display_SetClip()

void RdpClientUI::Display_SetClip ( int  x,
int  y,
int  cx,
int  cy 
)
inline

Definition at line 666 of file activex.cpp.

667  {
670  m_displayBufferClip.right = x + cx + 1;
671  m_displayBufferClip.bottom = y + cy + 1;
672 
676  }
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
LONG top
Definition: windef.h:292
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
static HRGN hrgn
Definition: win.c:55
HDC m_displayBuffer
Definition: activex.cpp:516
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570
LONG bottom
Definition: windef.h:294
RECT m_displayBufferClip
Definition: activex.cpp:522

◆ Display_TriBlt()

void RdpClientUI::Display_TriBlt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
HBITMAP  src,
int  srcx,
int  srcy,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)
inline

Definition at line 759 of file activex.cpp.

760  {
761  // TODO
763  HGDIOBJ hOld = SelectObject(hdcSrc, src);
764 
765  //SELECT_BRUSH(brush, bgcolour, fgcolour);
766 
767  BitBlt(m_displayBuffer, x, y, cx, cy, hdcSrc, srcx, srcy, MAKELONG(0, opcode));
768 
769  //RESET_BRUSH();
770 
771  SelectObject(hdcSrc, hOld);
772  DeleteDC(hdcSrc);
773 
775  }
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static HDC hdcSrc
Definition: xlate.c:32
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
#define MAKELONG(a, b)
Definition: typedefs.h:248
void Display_RepaintArea(int x, int y, int cx, int cy)
Definition: activex.cpp:616
GLenum src
Definition: glext.h:6340
BOOL WINAPI DeleteDC(_In_ HDC)
HDC m_displayBuffer
Definition: activex.cpp:516
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:570

◆ DisplayWindowProc()

LRESULT RdpClientUI::DisplayWindowProc ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlineprivate

Definition at line 525 of file activex.cpp.

526  {
527  switch(uMsg)
528  {
529  case WM_DESTROY:
530  PostQuitMessage(0);
531  return 0;
532 
533  case WM_PRINTCLIENT:
534  if(wParam == 0)
535  break;
536 
537  case WM_PAINT:
538  {
539  HDC hdc = (HDC)wParam;
540 
542 
543  if(hdc)
544  {
545  RECT rc;
547  BitBlt(hdc, 0, 0, rc.right, rc.bottom, m_displayBuffer, 0, 0, SRCCOPY);
548  }
549  else
550  {
551  PAINTSTRUCT ps;
553 
554  if(!m_smartSizing)
555  {
556  BitBlt
557  (
558  hdc,
559  ps.rcPaint.left,
560  ps.rcPaint.top,
561  ps.rcPaint.right - ps.rcPaint.left,
562  ps.rcPaint.bottom - ps.rcPaint.top,
564  ps.rcPaint.left,
565  ps.rcPaint.top,
566  SRCCOPY
567  );
568  }
569  else
570  {
571  // bleh. There has to be a better way
573 
574  StretchBlt
575  (
576  hdc,
577  0,
578  0,
582  0,
583  0,
586  SRCCOPY
587  );
588  }
589 
591  }
592 
594  }
595 
596  return 0;
597 
598  default:
599  break;
600  }
601 
602  return DefWindowProc(m_displayWindow, uMsg, wParam, lParam);
603  }
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:292
#define HALFTONE
Definition: wingdi.h:954
bool m_smartSizing
Definition: activex.cpp:483
LONG left
Definition: windef.h:291
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
LONG right
Definition: windef.h:293
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
WPARAM wParam
Definition: combotst.c:138
#define WM_PRINTCLIENT
Definition: richedit.h:70
HWND m_displayWindow
Definition: activex.cpp:513
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
LONG m_displayBufferWidth
Definition: activex.cpp:514
LONG m_consoleHeight
Definition: activex.cpp:482
#define WM_PAINT
Definition: winuser.h:1602
CRITICAL_SECTION m_displayBufferMutex
Definition: activex.cpp:523
HDC hdc
Definition: main.c:9
LONG m_displayBufferHeight
Definition: activex.cpp:515
int WINAPI SetStretchBltMode(_In_ HDC, _In_ int)
Definition: dc.c:1324
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HDC m_displayBuffer
Definition: activex.cpp:516
LONG bottom
Definition: windef.h:294
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
LONG m_consoleWidth
Definition: activex.cpp:481
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define SRCCOPY
Definition: wingdi.h:332

◆ Initialize()

HRESULT RdpClientUI::Initialize ( HWND  hwndParent)
inline

Definition at line 304 of file activex.cpp.

305  {
306  // TODO: create the various windows
307  // TODO: create display window thread
308  // TODO: create input thread
309  return E_FAIL;
310  }
#define E_FAIL
Definition: ddrawi.h:102

◆ InputWindowProc()

LRESULT RdpClientUI::InputWindowProc ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inline

Definition at line 1166 of file activex.cpp.

1167  {
1168  switch(uMsg)
1169  {
1170  case WM_DESTROY:
1171  PostQuitMessage(0);
1172  return 0;
1173 
1174  /* Keyboard stuff */
1175  // TODO: we need a good way to post output cross-thread
1176  case WM_SYSKEYDOWN:
1177  case WM_KEYDOWN:
1178  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_SCANCODE, RDP_KEYPRESS | (lparam & 0x1000000 ? KBD_FLAG_EXT : 0), LOBYTE(HIWORD(lparam)), 0);
1179  break;
1180 
1181  case WM_SYSKEYUP:
1182  case WM_KEYUP:
1183  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_SCANCODE, RDP_KEYRELEASE | (lparam & 0x1000000 ? KBD_FLAG_EXT : 0), LOBYTE(HIWORD(lparam)), 0);
1184  break;
1185 
1186  /* Mouse stuff */
1187  // Cursor shape
1188  case WM_SETCURSOR:
1189  if(LOWORD(lParam) == HTCLIENT)
1190  {
1192  return TRUE;
1193  }
1194 
1195  break;
1196 
1197  // Movement
1198  case WM_MOUSEMOVE:
1199  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE, LOWORD(lparam), HIWORD(lparam));
1200  break;
1201 
1202  // Buttons
1203  // TODO: X buttons
1204  case WM_LBUTTONDOWN:
1205  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
1206  break;
1207 
1208  case WM_RBUTTONDOWN:
1209  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
1210  break;
1211 
1212  case WM_MBUTTONDOWN:
1213  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3 | MOUSE_FLAG_DOWN, LOWORD(lparam), HIWORD(lparam));
1214  break;
1215 
1216  case WM_LBUTTONUP:
1217  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON1, LOWORD(lparam), HIWORD(lparam));
1218  break;
1219 
1220  case WM_RBUTTONUP:
1221  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON2, LOWORD(lparam), HIWORD(lparam));
1222  break;
1223 
1224  case WM_MBUTTONUP:
1225  //rdp_send_input(This, GetMessageTime(), RDP_INPUT_MOUSE, MOUSE_FLAG_BUTTON3, LOWORD(lparam), HIWORD(lparam));
1226  break;
1227 
1228  // Wheel
1229  case WM_MOUSEWHEEL:
1230  //mstsc_mousewheel(This, (SHORT)HIWORD(wparam), lparam);
1231  break;
1232  }
1233 
1234  return DefWindowProc(m_inputWindow, uMsg, wParam, lParam);
1235  }
#define WM_MBUTTONUP
Definition: winuser.h:1759
#define TRUE
Definition: types.h:120
HCURSOR m_inputCursor
Definition: activex.cpp:1164
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define WM_MOUSEWHEEL
Definition: treelist.c:96
WPARAM wParam
Definition: combotst.c:138
HWND m_inputWindow
Definition: activex.cpp:1163
#define WM_SETCURSOR
Definition: winuser.h:1618
#define WM_KEYDOWN
Definition: winuser.h:1691
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_RBUTTONDOWN
Definition: winuser.h:1755
#define WM_KEYUP
Definition: winuser.h:1692
#define WM_RBUTTONUP
Definition: winuser.h:1756
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_SYSKEYUP
Definition: winuser.h:1696
#define WM_LBUTTONUP
Definition: winuser.h:1753
#define WM_MBUTTONDOWN
Definition: winuser.h:1758
#define WM_MOUSEMOVE
Definition: winuser.h:1751
#define WM_SYSKEYDOWN
Definition: winuser.h:1695
#define HTCLIENT
Definition: winuser.h:2429
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

◆ Shutdown()

static void RdpClientUI::Shutdown ( )
inlinestatic

Definition at line 356 of file activex.cpp.

357  {
358  // TODO
359  }

◆ Startup()

static BOOL RdpClientUI::Startup ( )
inlinestatic

Definition at line 313 of file activex.cpp.

314  {
315  WNDCLASSEX wcexUI = { sizeof(wcexUI) };
316  WNDCLASSEX wcexConsole = { sizeof(wcexConsole) };
317  WNDCLASSEX wcexDisplay = { sizeof(wcexDisplay) };
318  WNDCLASSEX wcexInput = { sizeof(wcexInput) };
319 
320  HBRUSH nullBrush = (HBRUSH)GetStockObject(HOLLOW_BRUSH);
321 
322  wcexUI.lpfnWndProc = NULL; // TODO
323  wcexUI.hInstance = GetCurrentModule();
324  wcexUI.hCursor = LoadCursor(NULL, IDC_ARROW);
325  wcexUI.hbrBackground = nullBrush;
326  wcexUI.lpszClassName = TEXT("MissTosca_UI");
327 
328  wcexConsole.style = CS_VREDRAW | CS_HREDRAW;
329  wcexConsole.lpfnWndProc = NULL; // TODO
330  wcexConsole.hInstance = GetCurrentModule();
331  wcexConsole.hCursor = LoadCursor(NULL, IDC_ARROW);
332  wcexConsole.hbrBackground = nullBrush;
333  wcexConsole.lpszClassName = TEXT("MissTosca_Console");
334 
335  wcexDisplay.style = CS_VREDRAW | CS_HREDRAW;
336  wcexDisplay.lpfnWndProc = NULL; // TODO
337  wcexDisplay.hInstance = GetCurrentModule();
338  wcexDisplay.hCursor = LoadCursor(NULL, IDC_ARROW);
339  wcexDisplay.hbrBackground = nullBrush;
340  wcexDisplay.lpszClassName = TEXT("MissTosca_Display");
341 
342  wcexInput.style = CS_VREDRAW | CS_HREDRAW;
343  wcexInput.lpfnWndProc = NULL; // TODO
344  wcexInput.hInstance = GetCurrentModule();
345  wcexInput.hCursor = NULL;
346  wcexInput.hbrBackground = nullBrush;
347  wcexInput.lpszClassName = TEXT("MissTosca_Input");
348 
349  return
350  RegisterClassEx(&wcexUI) &&
351  RegisterClassEx(&wcexConsole) &&
352  RegisterClassEx(&wcexDisplay) &&
353  RegisterClassEx(&wcexInput);
354  }
HGDIOBJ WINAPI GetStockObject(_In_ int)
UINT style
Definition: winuser.h:3155
#define RegisterClassEx
Definition: winuser.h:5703
HCURSOR hCursor
Definition: winuser.h:3161
WNDPROC lpfnWndProc
Definition: winuser.h:3156
LPCSTR lpszClassName
Definition: winuser.h:3164
#define CS_HREDRAW
Definition: winuser.h:648
HINSTANCE hInstance
Definition: winuser.h:3159
smooth NULL
Definition: ftsmooth.c:416
HBRUSH hbrBackground
Definition: winuser.h:3162
#define CS_VREDRAW
Definition: winuser.h:653
#define HOLLOW_BRUSH
Definition: wingdi.h:898
#define LoadCursor
Definition: winuser.h:5678
#define TEXT(s)
Definition: k32.h:26
#define IDC_ARROW
Definition: winuser.h:682

◆ UIWindowProc()

LRESULT RdpClientUI::UIWindowProc ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
inlineprivate

Definition at line 371 of file activex.cpp.

372  {
373  switch(uMsg)
374  {
375  // Keep the keyboard focus on the input window
376  case WM_ACTIVATE:
377  switch(LOWORD(wParam))
378  {
379  case WA_INACTIVE:
380  break;
381 
382  case WA_ACTIVE:
383  case WA_CLICKACTIVE:
384  if(!HIWORD(wParam))
386  }
387 
388  return 0;
389 
390  // Resized: rearrange children windows, adjust scrollbars
391  case WM_SIZE:
392  {
393  if(IsIconic(m_uiWindow))
394  break;
395 
396  RECT rcClient;
397  GetWindowRect(m_uiWindow, &rcClient);
398 
399  if(m_smartSizing)
400  {
401  // we are not supposed to maintain aspect ratio. Container has to do that
402  m_consoleX = 0;
403  m_consoleY = 0;
404  m_consoleWidth = rcClient.right;
405  m_consoleHeight = rcClient.bottom;
406  }
407  else
408  {
409  // center horizontally, no horizontal scrollbar
410  if(rcClient.right >= m_consoleWidth)
411  m_consoleX = (m_consoleWidth - rcClient.right) / 2;
412 
413  // center vertically, no vertical scrollbar
414  if(rcClient.bottom >= m_consoleHeight)
415  m_consoleY = (m_consoleHeight - rcClient.right) / 2;
416  }
417 
418  SCROLLINFO scroll = { sizeof(scroll), SIF_ALL, 0 };
419 
420  // update the horizontal scrollbar
421  scroll.nMax = m_consoleWidth;
422  scroll.nPage = rcClient.right;
423  scroll.nPos = 0 - m_consoleX;
424  SetScrollInfo(m_uiWindow, SB_HORZ, &scroll, TRUE);
425 
426  // update the vertical scrollbar
427  scroll.nMax = m_consoleHeight;
428  scroll.nPage = rcClient.bottom;
429  scroll.nPos = 0 - m_consoleY;
430  SetScrollInfo(m_uiWindow, SB_VERT, &scroll, TRUE);
431 
432  // move/resize the console window
434  }
435 
436  return 0;
437 
438  case WM_HSCROLL:
439  {
440  SCROLLINFO scroll = { sizeof(scroll), SIF_TRACKPOS };
441  GetScrollInfo(m_uiWindow, SB_HORZ, &scroll);
442  m_consoleX = - scroll.nTrackPos;
444  }
445 
446  return 0;
447 
448  case WM_VSCROLL:
449  {
450  SCROLLINFO scroll = { sizeof(scroll), SIF_TRACKPOS };
451  GetScrollInfo(m_uiWindow, SB_VERT, &scroll);
452  m_consoleY = - scroll.nTrackPos;
454  }
455 
456  return 0;
457 
458  default:
459  break;
460  }
461 
462  return DefWindowProc(m_uiWindow, uMsg, wParam, lParam);
463  }
LONG m_consoleY
Definition: activex.cpp:480
#define TRUE
Definition: types.h:120
#define SB_VERT
Definition: winuser.h:553
#define SB_HORZ
Definition: winuser.h:552
HWND m_consoleWindow
Definition: activex.cpp:478
HWND WINAPI SetFocus(_In_opt_ HWND)
bool m_smartSizing
Definition: activex.cpp:483
LONG right
Definition: windef.h:293
BOOL WINAPI IsIconic(_In_ HWND)
WPARAM wParam
Definition: combotst.c:138
HWND m_inputWindow
Definition: activex.cpp:1163
#define DefWindowProc
Definition: ros2win.h:31
#define WM_SIZE
Definition: winuser.h:1593
#define WA_ACTIVE
Definition: winuser.h:2577
#define WA_CLICKACTIVE
Definition: winuser.h:2578
LONG m_consoleHeight
Definition: activex.cpp:482
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LONG m_consoleX
Definition: activex.cpp:479
#define WM_ACTIVATE
Definition: winuser.h:1594
HWND m_uiWindow
Definition: activex.cpp:367
#define SIF_TRACKPOS
Definition: winuser.h:1223
#define WM_HSCROLL
Definition: winuser.h:1719
#define HIWORD(l)
Definition: typedefs.h:246
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WA_INACTIVE
Definition: winuser.h:2576
LONG m_consoleWidth
Definition: activex.cpp:481
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define WM_VSCROLL
Definition: winuser.h:1720
#define SIF_ALL
Definition: winuser.h:1218

Member Data Documentation

◆ m_consoleHeight

LONG RdpClientUI::m_consoleHeight
private

Definition at line 482 of file activex.cpp.

◆ m_consoleWidth

LONG RdpClientUI::m_consoleWidth
private

Definition at line 481 of file activex.cpp.

◆ m_consoleWindow

HWND RdpClientUI::m_consoleWindow
private

Definition at line 478 of file activex.cpp.

Referenced by ConsoleWindowProc().

◆ m_consoleX

LONG RdpClientUI::m_consoleX
private

Definition at line 479 of file activex.cpp.

◆ m_consoleY

LONG RdpClientUI::m_consoleY
private

Definition at line 480 of file activex.cpp.

◆ m_displayBuffer

◆ m_displayBufferBitDepth

int RdpClientUI::m_displayBufferBitDepth
private

Definition at line 519 of file activex.cpp.

◆ m_displayBufferByteDepth

int RdpClientUI::m_displayBufferByteDepth
private

Definition at line 520 of file activex.cpp.

Referenced by Display_PaintBitmap(), Display_RestoreDesktop(), and Display_SaveDesktop().

◆ m_displayBufferClip

RECT RdpClientUI::m_displayBufferClip
private

Definition at line 522 of file activex.cpp.

Referenced by Display_ResetClip(), and Display_SetClip().

◆ m_displayBufferHeight

LONG RdpClientUI::m_displayBufferHeight
private

◆ m_displayBufferMutex

CRITICAL_SECTION RdpClientUI::m_displayBufferMutex
private

Definition at line 523 of file activex.cpp.

Referenced by Display_BeginUpdate(), and Display_EndUpdate().

◆ m_displayBufferRaw

void* RdpClientUI::m_displayBufferRaw
private

Definition at line 517 of file activex.cpp.

Referenced by Display_PaintBitmap(), Display_RestoreDesktop(), and Display_SaveDesktop().

◆ m_displayBufferSave

int RdpClientUI::m_displayBufferSave
private

Definition at line 518 of file activex.cpp.

Referenced by Display_BeginUpdate(), and Display_EndUpdate().

◆ m_displayBufferStride

int RdpClientUI::m_displayBufferStride
private

Definition at line 521 of file activex.cpp.

Referenced by Display_PaintBitmap(), Display_RestoreDesktop(), and Display_SaveDesktop().

◆ m_displayBufferWidth

LONG RdpClientUI::m_displayBufferWidth
private

Definition at line 514 of file activex.cpp.

Referenced by Display_ResetClip().

◆ m_displayWindow

HWND RdpClientUI::m_displayWindow
private

Definition at line 513 of file activex.cpp.

Referenced by ConsoleWindowProc(), and Display_RepaintAll().

◆ m_fullScreenBarWindow

HWND RdpClientUI::m_fullScreenBarWindow
private

Definition at line 470 of file activex.cpp.

◆ m_inputCursor

HCURSOR RdpClientUI::m_inputCursor

Definition at line 1164 of file activex.cpp.

Referenced by InputWindowProc().

◆ m_inputWindow

HWND RdpClientUI::m_inputWindow

Definition at line 1163 of file activex.cpp.

Referenced by ConsoleWindowProc(), and UIWindowProc().

◆ m_scrollHPos

LONG RdpClientUI::m_scrollHPos
private

Definition at line 368 of file activex.cpp.

◆ m_scrollVPos

LONG RdpClientUI::m_scrollVPos
private

Definition at line 369 of file activex.cpp.

◆ m_smartSizing

bool RdpClientUI::m_smartSizing
private

Definition at line 483 of file activex.cpp.

Referenced by Display_RepaintPolygon().

◆ m_uiWindow

HWND RdpClientUI::m_uiWindow
private

Definition at line 367 of file activex.cpp.

Referenced by UIWindowProc().


The documentation for this class was generated from the following file: