Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/vncdll/winvnc/VideoDriver.h
Views: 11778
// Copyright (C) 2005-2006 Lev Kazarkin. All Rights Reserved.1//2// TightVNC is free software; you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation; either version 2 of the License, or5// (at your option) any later version.6//7// This program is distributed in the hope that it will be useful,8// but WITHOUT ANY WARRANTY; without even the implied warranty of9// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10// GNU General Public License for more details.11//12// You should have received a copy of the GNU General Public License13// along with this program; if not, write to the Free Software14// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,15// USA.16//17// TightVNC distribution homepage on the Web: http://www.tightvnc.com/1819#ifndef _WINVNC_VIDEODRIVER20#define _WINVNC_VIDEODRIVER2122#include "stdhdrs.h"23#include "vncRegion.h"2425#define ESC_QVI 10262627#define MAP1 103028#define UNMAP1 103129#define TESTMAPPED 10513031#define MAXCHANGES_BUF 200003233typedef enum34{35dmf_dfo_IGNORE = 0,36dmf_dfo_FROM_SCREEN = 1,37dmf_dfo_FROM_DIB = 2,38dmf_dfo_TO_SCREEN = 3,3940dmf_dfo_SCREEN_SCREEN = 11,41dmf_dfo_BLIT = 12,42dmf_dfo_SOLIDFILL = 13,43dmf_dfo_BLEND = 14,44dmf_dfo_TRANS = 15,45dmf_dfo_PLG = 17,46dmf_dfo_TEXTOUT = 18,4748dmf_dfo_Ptr_Engage = 48, // point is used with this record49dmf_dfo_Ptr_Avert = 49,5051// 1.0.9.052// mode-assert notifications to manifest PDEV limbo status53dmf_dfn_assert_on = 64, // DrvAssert(TRUE): PDEV reenabled54dmf_dfn_assert_off = 65, // DrvAssert(FALSE): PDEV disabled5556} dmf_UpdEvent;575859#define CDS_UPDATEREGISTRY 0x0000000160#define CDS_TEST 0x0000000261#define CDS_FULLSCREEN 0x0000000462#define CDS_GLOBAL 0x0000000863#define CDS_SET_PRIMARY 0x0000001064#define CDS_RESET 0x4000000065#define CDS_SETRECT 0x2000000066#define CDS_NORESET 0x100000006768typedef BOOL (WINAPI* pEnumDisplayDevices)(PVOID,DWORD,PVOID,DWORD);69typedef LONG (WINAPI* pChangeDisplaySettingsEx)(LPCTSTR, LPDEVMODE, HWND, DWORD, LPVOID);7071//*********************************************************************7273typedef struct _CHANGES_RECORD74{75ULONG type; //screen_to_screen, blit, newcache,oldcache76RECT rect;77RECT origrect;78POINT point;79ULONG color; //number used in cache array80ULONG refcolor; //slot used to pase btimap data81}CHANGES_RECORD;82typedef CHANGES_RECORD *PCHANGES_RECORD;83typedef struct _CHANGES_BUF84{85ULONG counter;86CHANGES_RECORD pointrect[MAXCHANGES_BUF];87}CHANGES_BUF;88typedef CHANGES_BUF *PCHANGES_BUF;8990typedef struct _GETCHANGESBUF91{92PCHANGES_BUF buffer;93PVOID Userbuffer;94}GETCHANGESBUF;95typedef GETCHANGESBUF *PGETCHANGESBUF;9697#define DMF_VERSION_DEFINE(_ver_0,_ver_1,_ver_2,_ver_3) ((_ver_0<<24) | (_ver_1<<16) | (_ver_2<<8) | _ver_3)9899#define DMF_PROTO_VER_CURRENT DMF_VERSION_DEFINE(1,2,0,0)100#define DMF_PROTO_VER_MINCOMPAT DMF_VERSION_DEFINE(0,9,0,1)101102struct Esc_dmf_Qvi_IN103{104ULONG cbSize;105106ULONG app_actual_version;107ULONG display_minreq_version;108109ULONG connect_options; // reserved. must be 0.110};111112enum113{114esc_qvi_prod_name_max = 16,115};116117#define ESC_QVI_PROD_MIRAGE "MIRAGE"118119struct Esc_dmf_Qvi_OUT120{121ULONG cbSize;122123ULONG display_actual_version;124ULONG miniport_actual_version;125ULONG app_minreq_version;126ULONG display_buildno;127ULONG miniport_buildno;128129char prod_name[esc_qvi_prod_name_max];130};131132class vncDesktop;133134class vncVideoDriver135{136137// Fields138public:139140// Methods141public:142// Make the desktop thread & window proc friends143144vncVideoDriver();145~vncVideoDriver();146BOOL Activate(BOOL fForDirectAccess, const RECT *prcltarget);147void Deactivate();148BOOL Activate_NT50(BOOL fForDirectAccess, const RECT *prcltarget);149void Deactivate_NT50();150BOOL Activate_NT46(BOOL fForDirectAccess);151void Deactivate_NT46();152BOOL CheckVersion();153BOOL MapSharedbuffers(BOOL fForDirectScreenAccess);154void UnMapSharedbuffers();155BOOL TestMapped();156void HandleDriverChanges(157vncDesktop *pDesk,158vncRegion &rgn,159int xoffset,160int yoffset,161BOOL &bPointerShapeChange);162void HandleDriverChangesSeries(163vncDesktop *pDesk,164vncRegion &rgn,165int xoffset,166int yoffset,167const CHANGES_RECORD *first,168const CHANGES_RECORD *last,169BOOL &bPointerShapeChange);170void ResetCounter() { oldCounter = bufdata.buffer->counter; }171172BYTE *GetScreenView(void) { return (BYTE*)bufdata.Userbuffer; }173174BOOL IsActive(void) { return m_fIsActive; }175BOOL IsDirectAccessInEffect(void) { return m_fDirectAccessInEffect; }176BOOL IsHandlingScreen2ScreenBlt(void) { return m_fHandleScreen2ScreenBlt; }177178protected:179180static BOOL LookupVideoDeviceAlt(181LPCTSTR szDevStr,182LPCTSTR szDevStrAlt,183INT &devNum,184DISPLAY_DEVICE *pDd);185static HKEY CreateDeviceKey(LPCTSTR szMpName);186187char m_devname[32];188ULONG m_drv_ver_mj;189ULONG m_drv_ver_mn;190191GETCHANGESBUF bufdata;192ULONG oldCounter;193HDC m_gdc;194195bool m_fIsActive;196bool m_fDirectAccessInEffect;197bool m_fHandleScreen2ScreenBlt;198199static char vncVideoDriver::szDriverString[];200static char vncVideoDriver::szDriverStringAlt[];201static char vncVideoDriver::szMiniportName[];202};203204VOID DebugPrint(PCHAR DebugMessage, ...);205206#ifdef _DEBUG207#define DPF(x) DebugPrint x208#else209#define DPF(x)210#endif211212#endif213214215