Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1251 lines
55 KiB

  1. //
  2. // App Sharing Header
  3. //
  4. // <DCS.H> is included BEFORE the other component headers, it has common
  5. // constants and typedefs.
  6. // <AS.H> is included AFTER the other component headers, it has structure
  7. // definitions that depend on the structures in the component headers.
  8. //
  9. #ifndef _H_AS
  10. #define _H_AS
  11. class ASHost;
  12. class ASPerson;
  13. class ASView;
  14. class ASShare;
  15. //
  16. // This is the data we keep for when we HOST application. When not
  17. // hosting, we don't have this data at all. It's a fair amount of variables,
  18. // hence it's worth allocating/freeing. And when we support multiple
  19. // simultaneous conferences, won't we be glad we don't have globals to
  20. // remove?
  21. //
  22. class ASHost
  23. {
  24. public:
  25. STRUCTURE_STAMP
  26. //
  27. // Pointer back to share
  28. //
  29. ASShare * m_pShare;
  30. //
  31. // Bounds rects
  32. //
  33. UINT m_baNumRects;
  34. RECT m_abaRects[BA_NUM_RECTS];
  35. //
  36. // Active Window Coordinator
  37. //
  38. HWND m_awcLastActiveWindow;
  39. UINT m_awcLastActiveMsg;
  40. //
  41. // Control
  42. //
  43. BOOL m_caRetrySendState;
  44. BOOL m_caAutoAcceptRequests:1;
  45. BOOL m_caTempRejectRequests:1;
  46. //
  47. // Cursor Manager
  48. //
  49. BOOL m_cmfUseColorCursorProtocol:1;
  50. BOOL m_cmfCursorHidden:1;
  51. BOOL m_cmfSyncPos:1;
  52. BOOL m_cmfCursorTransformApplied:1;
  53. POINT m_cmLastCursorPos;
  54. CURSORDESCRIPTION m_cmLastCursorShape;
  55. UINT m_cmNumTxCacheEntries; // CAN GO AWAY IN 4.0
  56. PCHCACHE m_cmTxCacheHandle;
  57. //
  58. // Host Tracker
  59. //
  60. GUIEFFECTS m_hetEffects;
  61. //
  62. // Order Accumulator
  63. //
  64. UINT m_oaFlow;
  65. //
  66. // OE2 OUTGOING encoding
  67. //
  68. PARTYORDERDATA m_oe2Tx;
  69. //
  70. // PM OUTGOING cache, current colors
  71. //
  72. BOOL m_pmMustSendPalette:1;
  73. BOOL m_pmBuggedDriver:1;
  74. PALETTEENTRY m_apmCurrentSystemPaletteEntries[PM_NUM_8BPP_PAL_ENTRIES];
  75. TSHR_RGBQUAD m_apmTxPaletteColors[PM_NUM_8BPP_PAL_ENTRIES];
  76. HPALETTE m_pmTxPalette;
  77. UINT m_pmNumTxCacheEntries; // CAN GO AWAY IN 4.0
  78. PCHCACHE m_pmTxCacheHandle;
  79. PCOLORTABLECACHE m_pmNextTxCacheEntry;
  80. COLORTABLECACHE m_apmTxCache[TSHR_PM_CACHE_ENTRIES];
  81. TSHR_RGBQUAD m_apmDDGreyRGB[PM_GREY_COUNT];
  82. //
  83. // Send bitmap cache
  84. //
  85. SBC_ORDER_INFO m_sbcOrderInfo;
  86. SBC_TILE_WORK_INFO m_asbcWorkInfo[SBC_NUM_TILE_SIZES];
  87. BMC_DIB_CACHE m_asbcBmpCaches[NUM_BMP_CACHES];
  88. SBC_SHM_CACHE_INFO m_asbcCacheInfo[NUM_BMP_CACHES];
  89. LPSBC_FASTPATH m_sbcFastPath;
  90. //
  91. // Screen data
  92. //
  93. RECT m_sdgPendingRect;
  94. BOOL m_sdgRectIsPending:1;
  95. UINT m_sdgcLossy;
  96. RECT m_asdgLossyRect[BA_NUM_RECTS];
  97. //
  98. // Save bits
  99. //
  100. DWORD m_ssiSaveBitmapSize; // Can go away in 4.0
  101. //
  102. // Shared window list
  103. //
  104. UINT m_swlCurrentDesktop;
  105. char m_aswlOurDesktopName[SWL_DESKTOPNAME_MAX];
  106. //
  107. // Updates
  108. //
  109. BOOL m_upBackPressure;
  110. BOOL m_upfUseSmallPackets:1;
  111. BOOL m_upfSyncTokenRequired:1;
  112. DWORD m_upLastSDTime;
  113. DWORD m_upLastOrdersTime;
  114. DWORD m_upLastTrialTime;
  115. DWORD m_upDeltaSD;
  116. DWORD m_upSDAccum;
  117. DWORD m_upDeltaOrders;
  118. DWORD m_upOrdersAccum;
  119. UINT m_usrSendingBPP;
  120. HDC m_usrWorkDC;
  121. public:
  122. //
  123. // Local host starting
  124. //
  125. BOOL HET_HostStarting(ASShare *);
  126. BOOL CM_HostStarting(void);
  127. BOOL OE2_HostStarting(void);
  128. BOOL PM_HostStarting(void);
  129. BOOL SBC_HostStarting(void);
  130. BOOL SSI_HostStarting(void);
  131. BOOL SWL_HostStarting(void);
  132. BOOL VIEW_HostStarting(void);
  133. BOOL USR_HostStarting(void);
  134. //
  135. // Local host ended
  136. //
  137. void HET_HostEnded(void);
  138. void CA_HostEnded(void);
  139. void CM_HostEnded(void);
  140. void OE2_HostEnded(void);
  141. void PM_HostEnded(void);
  142. void SBC_HostEnded(void);
  143. void USR_HostEnded(void);
  144. //
  145. // Syncing, when already hosting and somebody else joins
  146. //
  147. void HET_SyncCommon(void);
  148. void HET_SyncAlreadyHosting(void);
  149. void CA_SyncAlreadyHosting(void);
  150. void AWC_SyncOutgoing(void);
  151. void BA_SyncOutgoing(void);
  152. void CM_SyncOutgoing(void);
  153. void OA_SyncOutgoing(void);
  154. void OE2_SyncOutgoing(void);
  155. void PM_SyncOutgoing(void);
  156. void SBC_SyncOutgoing(void);
  157. void SSI_SyncOutgoing(void);
  158. //
  159. // Periodic
  160. //
  161. void AWC_Periodic(void);
  162. void CA_Periodic(void);
  163. void CM_Periodic(void);
  164. void SWL_Periodic(void);
  165. void UP_Periodic(UINT currentTime);
  166. //
  167. // Component routines - public
  168. //
  169. void AWC_ActivateWindow(HWND hwnd);
  170. void BA_AddRect(LPRECT pRect);
  171. void BA_CopyBounds(LPRECT pRects, LPUINT pNumRects, BOOL fReset);
  172. void BA_FetchBounds(void);
  173. UINT BA_QueryAccumulation(void);
  174. void BA_ReturnBounds(void);
  175. UINT CH_CacheData(PCHCACHE pCache, LPBYTE pData,
  176. UINT cbSize, UINT evictionCategory);
  177. void CH_ClearCache(PCHCACHE pCache );
  178. BOOL CH_CreateCache(PCHCACHE * ppCache, UINT cEntries,
  179. UINT cEvictionCategories, UINT cbNotHashed,
  180. PFNCACHEDEL pfnCacheDel);
  181. void CH_DestroyCache(PCHCACHE hCache);
  182. void CH_RemoveCacheEntry(PCHCACHE pCache, UINT iCacheEntry);
  183. BOOL CH_SearchAndCacheData(PCHCACHE pCache, LPBYTE pData,
  184. UINT cbData, UINT evictionCategory, UINT* piEntry);
  185. BOOL CH_SearchCache(PCHCACHE pCache, LPBYTE pData,
  186. UINT cbData, UINT evictionCategory, UINT* piEntry);
  187. void CH_TouchCacheEntry(PCHCACHE pCache, UINT iCacheEntry);
  188. void CM_ApplicationMovedCursor(void);
  189. void CM_Controlled(ASPerson * pasControlledBy);
  190. void CM_MaybeSendCursorMovedPacket(void);
  191. void HET_RepaintAll(void);
  192. void OA_FlowControl(UINT newBufferSize);
  193. LPINT_ORDER OA_GetFirstListOrder(void);
  194. UINT OA_GetTotalOrderListBytes(void);
  195. void OA_LocalHostReset(void);
  196. UINT OA_QueryOrderAccum(void);
  197. LPINT_ORDER OA_RemoveListOrder(LPINT_ORDER pCondemnedOrder);
  198. void OA_ResetOrderList(void);
  199. BOOL OE_RectIntersectsSDA(LPRECT lpRect);
  200. TSHR_UINT16 OE2_EncodeOrder(LPINT_ORDER pIntOrder,
  201. LPVOID pBuffer, TSHR_UINT16 cbBufferSize);
  202. BOOL OE2_UseFont(LPSTR pName, TSHR_UINT16 facelength,
  203. TSHR_UINT16 CodePage, TSHR_UINT16 MaxHeight,
  204. TSHR_UINT16 Height, TSHR_UINT16 Width,
  205. TSHR_UINT16 Weight, TSHR_UINT16 flags);
  206. void PM_AdjustColorsForBuggedDisplayDrivers(LPTSHR_RGBQUAD pColors,
  207. UINT cColors);
  208. BOOL PM_CacheTxColorTable(LPUINT pIndex, LPBOOL pNewEntry,
  209. UINT cColors, LPTSHR_RGBQUAD pColors);
  210. HPALETTE PM_GetLocalPalette(void);
  211. void PM_GetSystemPaletteEntries(LPTSHR_RGBQUAD pColors);
  212. BOOL PM_MaybeSendPalettePacket(void);
  213. void SBC_CacheCleared(void);
  214. void SBC_CacheEntryRemoved(UINT cache, UINT cacheIndex);
  215. UINT SBC_CopyPrivateOrderData(LPBYTE pDst,
  216. LPCOM_ORDER pOrder, UINT cbFree);
  217. void SBC_OrderSentNotification(LPINT_ORDER pOrder);
  218. void SBC_PMCacheEntryRemoved(UINT cacheIndex);
  219. void SBC_ProcessInternalOrder(LPINT_ORDER pOrder);
  220. BOOL SBC_ProcessMemBltOrder(LPINT_ORDER pOrder,
  221. LPINT_ORDER * ppNextOrder);
  222. void SBC_RecreateSendCache(UINT cache, UINT newEntries,
  223. UINT newCellSize);
  224. void SDG_SendScreenDataArea(LPBOOL pBackPressure, UINT * pcPackets);
  225. BOOL SWL_IsOurDesktopActive(void);
  226. void SWL_UpdateCurrentDesktop(void);
  227. void UP_FlowControl(UINT newSize);
  228. BOOL UP_MaybeSendSyncToken(void);
  229. protected:
  230. void CHAvlBalanceTree(PCHCACHE, PCHENTRY);
  231. void CHAvlDelete(PCHCACHE, PCHENTRY, UINT);
  232. PCHENTRY CHAvlFind(PCHCACHE, UINT, UINT);
  233. PCHENTRY CHAvlFindEqual(PCHCACHE, PCHENTRY);
  234. void CHAvlInsert(PCHCACHE, PCHENTRY);
  235. LPBYTE CHAvlNext(PCHENTRY);
  236. LPBYTE CHAvlPrev(PCHENTRY);
  237. void CHAvlRebalance(PCHENTRY *);
  238. void CHAvlRotateLeft(PCHENTRY *);
  239. void CHAvlRotateRight(PCHENTRY *);
  240. void CHAvlSwapLeftmost(PCHCACHE, PCHENTRY, PCHENTRY);
  241. void CHAvlSwapRightmost(PCHCACHE, PCHENTRY, PCHENTRY);
  242. UINT CHCheckSum(LPBYTE pData, UINT cbDataSize);
  243. int CHCompare(UINT key, UINT cbSize, PCHENTRY pEntry);
  244. UINT CHEvictCacheEntry(PCHCACHE pCache, UINT iEntry, UINT evictionCategory);
  245. UINT CHEvictLRUCacheEntry(PCHCACHE pCache, UINT evictionCategory, UINT evictionCount);
  246. BOOL CHFindFreeCacheEntry(PCHCACHE pCache, UINT* piEntry, UINT* pEvictionCount);
  247. void CHInitEntry(PCHENTRY);
  248. void CHRemoveEntry(PCHCACHE pCache, UINT iCacheEntry);
  249. UINT CHTreeSearch(PCHCACHE pCache, UINT checksum, UINT cbDataSize, LPBYTE pData);
  250. void CHUpdateMRUList(PCHCACHE pCache, UINT iEntry, UINT evictionCategory);
  251. BOOL CMGetColorCursorDetails( LPCM_SHAPE pCursor,
  252. LPTSHR_UINT16 pcxWidth, LPTSHR_UINT16 pcyHeight,
  253. LPTSHR_UINT16 pxHotSpot, LPTSHR_UINT16 pyHotSpot,
  254. LPBYTE pANDMask, LPTSHR_UINT16 pcbANDMask,
  255. LPBYTE pXORBitmap, LPTSHR_UINT16 pcbXORBitmap );
  256. BOOL CMGetCursorTagInfo(LPCSTR szTagName);
  257. void CMRemoveCursorTransform(void);
  258. BOOL CMSetCursorTransform(LPBYTE pANDMask, LPBITMAPINFO pXORDIB);
  259. BOOL CMSendBitmapCursor(void);
  260. BOOL CMSendCachedCursor(UINT iCacheEntry);
  261. BOOL CMSendColorBitmapCursor(LPCM_SHAPE pCursor,
  262. UINT iCacheEntry);
  263. BOOL CMSendCursorShape(LPCM_SHAPE lpCursorShape,
  264. UINT cbCursorDataSize);
  265. BOOL CMSendMonoBitmapCursor(LPCM_SHAPE pCursor);
  266. BOOL CMSendSystemCursor(UINT cursorIDC);
  267. void OAFreeAllOrders(LPOA_SHARED_DATA);
  268. void OE2EncodeBounds(LPBYTE * ppNextFreeSpace,
  269. LPTSHR_RECT16 pRect);
  270. void PMGetGrays(void);
  271. BOOL PMSendPalettePacket(LPTSHR_RGBQUAD pColorTable,
  272. UINT numColors);
  273. BOOL PMUpdateSystemPaletteColors(void);
  274. BOOL PMUpdateTxPaletteColors(void);
  275. void SBCAddToFastPath(UINT_PTR majorInfo, UINT minorInfo,
  276. UINT_PTR majorPalette, UINT minorPalette, int srcX,
  277. int srcY, UINT width, UINT height, UINT cache,
  278. UINT cacheIndex, UINT colorCacheIndex);
  279. BOOL SBCCacheBits(LPINT_ORDER pOrder, UINT cbDst,
  280. LPBYTE pDIBits, UINT bitmapWidth,
  281. UINT fixedBitmapWidth, UINT bitmapHeight,
  282. UINT numBytes, UINT * pCache, UINT * pCacheIndex,
  283. LPBOOL pIsNewEntry);
  284. BOOL SBCCacheColorTable(LPINT_ORDER pColorTableOrder,
  285. LPTSHR_RGBQUAD pColorTable, UINT numColors,
  286. UINT * pCacheIndex, LPBOOL pIsNewEntry);
  287. BOOL SBCFindInFastPath(UINT_PTR majorInfo, UINT minorInfo,
  288. UINT_PTR majorPalette, UINT minorPalette, int srcX,
  289. int srcY, UINT width, UINT height, UINT * pCache,
  290. UINT * pCacheIndex, UINT * pColorCacheIndex);
  291. void SBCFreeInternalOrders(void);
  292. BOOL SBCGetTileData(UINT tileId, LPSBC_TILE_DATA * ppTileData,
  293. UINT * pTileType);
  294. void SBCInitCacheStructures(void);
  295. BOOL SBCInitFastPath(void);
  296. BOOL SBCInitInternalOrders(void);
  297. BOOL SBCSelectCache(UINT bitsSize, UINT * pCacheIndex);
  298. BOOL SDGSmallBltToNetwork(LPRECT pRect);
  299. BOOL SDGSplitBltToNetwork(LPRECT pRect, UINT * pcPacket);
  300. UINT UPFetchOrdersIntoBuffer(LPBYTE pBuffer,
  301. LPTSHR_UINT16 pcOrders, LPUINT pcbBufferSize);
  302. BOOL UPSendOrders(UINT *);
  303. UINT UPSendUpdates(void);
  304. };
  305. void PMCacheCallback(ASHost* pHost, PCHCACHE pCache, UINT iEntry, LPBYTE pData);
  306. void SBCCacheCallback(ASHost* pHost, PCHCACHE pCache, UINT iEntry, LPBYTE pData);
  307. //
  308. // This is the per-person data we keep to VIEW a host. When this person
  309. // starts to host, we allocate this structure, and then subblocks as
  310. // necessary like caches. When this person stops hosting, we free it
  311. // after freeing the objects contained within.
  312. //
  313. // NOTE that for some whacky 2.x compatibility, some things that should
  314. // be in the ASView structure are actually kept in ASPerson because
  315. // the information contained within has to stay around when that person
  316. // isn't hosting. With 3.0 hosts that's not the case. So when 2.x
  317. // compatibility goes away, move OD2 PM RBC fields here also.
  318. //
  319. class ASView
  320. {
  321. public:
  322. STRUCTURE_STAMP
  323. // DS vars
  324. // For NM 2.x machines only, the offset if their desktop is scrolled over
  325. POINT m_dsScreenOrigin;
  326. // OD vars, for playback of orders from this remote host
  327. HRGN m_odInvalRgnOrder;
  328. HRGN m_odInvalRgnTotal;
  329. UINT m_odInvalTotal;
  330. COLORREF m_odLastBkColor;
  331. COLORREF m_odLastTextColor;
  332. int m_odLastBkMode;
  333. int m_odLastROP2;
  334. UINT m_odLastFillMode;
  335. UINT m_odLastArcDirection;
  336. UINT m_odLastPenStyle;
  337. UINT m_odLastPenWidth;
  338. COLORREF m_odLastPenColor;
  339. COLORREF m_odLastForeColor;
  340. int m_odLastBrushOrgX;
  341. int m_odLastBrushOrgY;
  342. COLORREF m_odLastBrushBkColor;
  343. COLORREF m_odLastBrushTextColor;
  344. HBITMAP m_odLastBrushPattern;
  345. UINT m_odLastLogBrushStyle;
  346. UINT m_odLastLogBrushHatch;
  347. TSHR_COLOR m_odLastLogBrushColor;
  348. BYTE m_odLastLogBrushExtra[7];
  349. int m_odLastCharExtra;
  350. int m_odLastJustExtra;
  351. int m_odLastJustCount;
  352. HFONT m_odLastFontID;
  353. UINT m_odLastFontCodePage;
  354. UINT m_odLastFontWidth;
  355. UINT m_odLastFontHeight;
  356. UINT m_odLastFontWeight;
  357. UINT m_odLastFontFlags;
  358. UINT m_odLastFontFaceLen;
  359. BYTE m_odLastFaceName[FH_FACESIZE];
  360. UINT m_odLastBaselineOffset;
  361. COLORREF m_odLastVGAColor[OD_NUM_COLORS];
  362. TSHR_COLOR m_odLastVGAResult[OD_NUM_COLORS];
  363. BOOL m_odRectReset;
  364. int m_odLastLeft;
  365. int m_odLastTop;
  366. int m_odLastRight;
  367. int m_odLastBottom;
  368. // SSI vars
  369. HDC m_ssiDC;
  370. HBITMAP m_ssiBitmap; // Bitmap handle
  371. HBITMAP m_ssiOldBitmap;
  372. int m_ssiBitmapHeight;
  373. // USR vars
  374. HDC m_usrDC;
  375. HDC m_usrWorkDC;
  376. HBITMAP m_usrBitmap;
  377. HBITMAP m_usrOldBitmap;
  378. // VIEW vars
  379. HWND m_viewFrame; // Frame
  380. HWND m_viewClient; // Host view
  381. HWND m_viewStatusBar; // Status bar
  382. UINT m_viewStatus; // Current status
  383. HMENU m_viewMenuBar; // Menu bar
  384. RECT m_viewSavedWindowRect; // When full screen, old pos
  385. HWND m_viewInformDlg; // Notification message up
  386. UINT m_viewInformMsg; // Informational message
  387. BOOL m_viewFocus:1; // Key strokes are going to this
  388. BOOL m_viewInMenuMode:1; // In menu mode
  389. BOOL m_viewFullScreen:1; // Full screen UI
  390. BOOL m_viewStatusBarOn:1;
  391. BOOL m_viewSavedStatusBarOn:1;
  392. BOOL m_viewFullScreenExitTrack:1;
  393. BOOL m_viewFullScreenExitMove:1;
  394. POINT m_viewSavedPos;
  395. POINT m_viewFullScreenExitStart;
  396. UINT m_viewMouseFlags; // For capture
  397. POINT m_viewMouse; // Mouse pos
  398. BOOL m_viewMouseOutside; // Mouse is down, outside client
  399. int m_viewMouseWheelDelta; // Intellimouse wheel insanity
  400. //
  401. // These are kept always in the view's client coords. When the view
  402. // scrolls over, the shared and obscured regions are adjusted too.
  403. // When a new SWL packet for the host comes in, these regions are
  404. // saved accounting for scrolling too.
  405. //
  406. HRGN m_viewSharedRgn; // Shared area, not obscured
  407. HRGN m_viewObscuredRgn; // Shared area, obscured
  408. HRGN m_viewExtentRgn;
  409. HRGN m_viewScreenRgn;
  410. HRGN m_viewPaintRgn;
  411. HRGN m_viewScratchRgn;
  412. POINT m_viewPos; // View scroll pos
  413. POINT m_viewPage; // View page size
  414. POINT m_viewPgSize; // Page scroll inc
  415. POINT m_viewLnSize; // Line scroll inc
  416. };
  417. //
  418. // This is the per-person data we keep for each person in a conference.
  419. // We dynamically allocate everybody but ourself (the local dude).
  420. //
  421. class ASPerson
  422. {
  423. public:
  424. STRUCTURE_STAMP
  425. ASPerson * pasNext;
  426. // VIEW vars (allocated when this person is hosting that we use to VIEW them)
  427. ASView * m_pView;
  428. // SC vars
  429. UINT mcsID; // MCS user_id
  430. char scName[TSHR_MAX_PERSON_NAME_LEN]; // Name
  431. BYTE scSyncSendStatus[SC_STREAM_COUNT];
  432. BYTE scSyncRecStatus[SC_STREAM_COUNT];
  433. //
  434. // AWC vars
  435. // When 2.x compat goes away, move these to AS_VIEW
  436. //
  437. TSHR_UINT32 awcActiveWinID;
  438. // CA vars
  439. BOOL m_caAllowControl;
  440. UINT m_caControlID; // ONLY NODE WE ARE CONTROLLING/CONTROLLED BY
  441. ASPerson * m_caControlledBy;
  442. ASPerson * m_caInControlOf;
  443. //
  444. // CM vars
  445. // When 2.x compat goes away, move most of these to AS_VIEW
  446. //
  447. POINT cmPos; // Position of the remote cursor, in his screen coords
  448. POINT cmHotSpot; // The remote cursor hotspot
  449. BOOL cmShadowOff;
  450. HCURSOR cmhRemoteCursor;
  451. UINT ccmRxCache; // # of entries in cache
  452. PCACHEDCURSOR acmRxCache; // Cached cursor array
  453. // CPC vars
  454. CPCALLCAPS cpcCaps;
  455. // DCS vars
  456. PGDC_DICTIONARY adcsDict; // POINTER
  457. // HET vars
  458. int hetCount;
  459. // OE vars
  460. UINT oecFonts;
  461. POEREMOTEFONT poeFontInfo;
  462. //
  463. // NOTE:
  464. // These are here and not in the HOST data for 2.x compat. 2.x systems
  465. // don't reset outgoing info if they stay in a share while stopping/
  466. // restarting hosting. 3.0 systems do (look in HET_HostStarting()).
  467. // So we must keep the old gunky cache/decode data around for backlevel
  468. // systems. Therefore we allocate it dynamically still.
  469. //
  470. // OD2 vars
  471. PPARTYORDERDATA od2Party;
  472. // PM vars
  473. HPALETTE pmPalette;
  474. UINT pmcColorTable;
  475. PCOLORTABLECACHE apmColorTable;
  476. // RBC vars
  477. PRBC_HOST_INFO prbcHost;
  478. // VIEW vars
  479. // NOTE: because of bugs in 2.x VD calcs, this is kept around while
  480. // the person is in the share, whether they are hosting or not.
  481. POINT viewExtent; // View extent (may be > usrScreenSize for 2.x dudes)
  482. };
  483. //
  484. // Allocated when in a share
  485. //
  486. class ASShare
  487. {
  488. public:
  489. STRUCTURE_STAMP
  490. ASHost * m_pHost;
  491. ASPerson * m_pasLocal; // People list, starting with local person
  492. //
  493. // Bitmap Compressor/Decompressor
  494. //
  495. MATCH * m_amatch;
  496. LPBYTE m_abNormal;
  497. LPBYTE m_abXor;
  498. //
  499. // Control Arbitrator
  500. //
  501. char m_caToggle;
  502. char m_caPad1;
  503. short m_caPad2;
  504. BASEDLIST m_caQueuedMsgs;
  505. ASPerson * m_caWaitingForReplyFrom;
  506. UINT m_caWaitingForReplyMsg;
  507. HWND m_caQueryDlg;
  508. CA30PENDING m_caQuery;
  509. //
  510. // Cursor
  511. //
  512. UINT m_cmCursorWidth;
  513. UINT m_cmCursorHeight;
  514. HCURSOR m_cmArrowCursor;
  515. POINT m_cmArrowCursorHotSpot;
  516. HBRUSH m_cmHatchBrush;
  517. HFONT m_cmCursorTagFont;
  518. DWORD m_dcsLastScheduleTime;
  519. DWORD m_dcsLastFastMiscTime;
  520. DWORD m_dcsLastIMTime;
  521. BOOL m_dcsLargePacketCompressionOnly;
  522. //
  523. // PKZIP
  524. //
  525. BYTE m_agdcWorkBuf[GDC_WORKBUF_SIZE];
  526. //
  527. // Fonts
  528. //
  529. BOOL m_fhLocalInfoSent;
  530. //
  531. // Hosting
  532. //
  533. UINT m_hetHostCount;
  534. BOOL m_hetRetrySendState;
  535. BOOL m_hetViewers;
  536. //
  537. // Input Manager
  538. //
  539. // GLOBAL (or costly to calc/load and undo repeatedly)
  540. WORD m_imScanVKLShift;
  541. WORD m_imScanVKRShift;
  542. HINSTANCE m_imImmLib;
  543. IMMGVK m_imImmGVK;
  544. // IN CONTROL
  545. BOOL m_imfInControlEventIsPending:1;
  546. BOOL m_imfInControlCtrlDown:1;
  547. BOOL m_imfInControlShiftDown:1;
  548. BOOL m_imfInControlMenuDown:1;
  549. BOOL m_imfInControlCapsLock:1;
  550. BOOL m_imfInControlNumLock:1;
  551. BOOL m_imfInControlScrollLock:1;
  552. BOOL m_imfInControlConsumeMenuUp:1;
  553. BOOL m_imfInControlConsumeEscapeUp:1;
  554. BOOL m_imfInControlNewEvent:1;
  555. IMEVENT m_imInControlPendingEvent;
  556. IMEVENTQ m_imInControlEventQ;
  557. BYTE m_aimInControlKeyStates[256];
  558. int m_imInControlMouseDownCount;
  559. DWORD m_imInControlMouseDownTime;
  560. UINT m_imInControlMouseWithhold;
  561. DWORD m_imInControlMouseSpoilRate;
  562. UINT m_imInControlNumEventsPending;
  563. UINT m_imInControlNumEventsReturned;
  564. UINT m_aimInControlEventsToReturn[15];
  565. UINT m_imInControlNextHotKeyEntry;
  566. BYTE m_aimInControlHotKeyArray[4];
  567. UINT m_imInControlNumDeadKeysDown;
  568. UINT m_imInControlNumDeadKeys;
  569. BYTE m_aimInControlDeadKeys[IM_MAX_DEAD_KEYS];
  570. // CONTROLLED (only when hosting!)
  571. BOOL m_imfControlledMouseButtonsReversed:1;
  572. BOOL m_imfControlledMouseClipped:1;
  573. BOOL m_imfControlledPaceInjection:1;
  574. BOOL m_imfControlledNewEvent:1;
  575. UINT m_imControlledNumEventsPending;
  576. UINT m_imControlledNumEventsReturned;
  577. UINT m_aimControlledEventsToReturn[15];
  578. UINT m_imControlledVKToReplay;
  579. IMEVENTQ m_imControlledEventQ;
  580. IMOSQ m_imControlledOSQ;
  581. BYTE m_aimControlledControllerKeyStates[256];
  582. BYTE m_aimControlledKeyStates[256];
  583. BYTE m_aimControlledSavedKeyStates[256];
  584. DWORD m_imControlledLastLowLevelMouseEventTime;
  585. DWORD m_imControlledLastMouseRemoteTime;
  586. DWORD m_imControlledLastMouseLocalTime;
  587. DWORD m_imControlledLastIncompleteConversion;
  588. DWORD m_imControlledMouseBacklog;
  589. POINT m_imControlledLastMousePos;
  590. //
  591. // Order Encoder
  592. //
  593. BOOL m_oefSendOrders:1;
  594. BOOL m_oefTextEnabled:1;
  595. BOOL m_oefOE2EncodingOn:1;
  596. BOOL m_oefOE2Negotiable:1;
  597. BOOL m_oefBaseOE:1;
  598. BOOL m_oefAlignedOE:1;
  599. BYTE m_aoeOrderSupported[ORD_NUM_INTERNAL_ORDERS];
  600. PROTCAPS_ORDERS m_oeCombinedOrderCaps;
  601. UINT m_oeOE2Flag;
  602. //
  603. // Share Controller
  604. //
  605. BOOL m_scfViewSelf:1;
  606. #ifdef _DEBUG
  607. BOOL m_scfInSync:1;
  608. #endif // _DEBUG
  609. UINT m_scShareVersion;
  610. int m_ascSynced[SC_STREAM_COUNT];
  611. LPBYTE m_ascTmpBuffer;
  612. POINT m_viewVDSize;
  613. int m_viewEdgeCX;
  614. int m_viewEdgeCY;
  615. HBRUSH m_viewObscuredBrush;
  616. HICON m_viewFullScreenExitIcon;
  617. int m_viewFullScreenCX;
  618. int m_viewFullScreenCY;
  619. int m_viewItemCX;
  620. int m_viewItemCY;
  621. int m_viewItemScrollCX;
  622. int m_viewItemScrollCY;
  623. int m_viewStatusBarCY;
  624. HCURSOR m_viewNotInControl;
  625. UINT m_viewMouseWheelScrollLines;
  626. HBITMAP m_usrBmp16;
  627. HBITMAP m_usrBmp32;
  628. HBITMAP m_usrBmp48;
  629. HBITMAP m_usrBmp64;
  630. HBITMAP m_usrBmp80;
  631. HBITMAP m_usrBmp96;
  632. HBITMAP m_usrBmp112;
  633. HBITMAP m_usrBmp128;
  634. HBITMAP m_usrBmp256;
  635. HBITMAP m_usrBmp1024;
  636. LPBYTE m_usrPBitmapBuffer;
  637. BOOL m_usrHatchBitmaps;
  638. BOOL m_usrHatchScreenData;
  639. int m_usrHatchColor;
  640. public:
  641. #ifdef _DEBUG
  642. void ValidatePerson(ASPerson * pasPerson);
  643. void ValidateView(ASPerson * pasPerson);
  644. #else
  645. __inline void ValidatePerson(ASPerson * pasPerson) {}
  646. __inline void ValidateView(ASPerson * pasPerson) {}
  647. #endif // _DEBUG
  648. //
  649. // Share init
  650. //
  651. BOOL SC_ShareStarting(void);
  652. BOOL BCD_ShareStarting(void);
  653. BOOL CM_ShareStarting(void);
  654. BOOL IM_ShareStarting(void);
  655. BOOL VIEW_ShareStarting(void);
  656. BOOL USR_ShareStarting(void);
  657. //
  658. // Share term
  659. //
  660. void SC_ShareEnded(void);
  661. void BCD_ShareEnded(void);
  662. void CM_ShareEnded(void);
  663. void IM_ShareEnded(void);
  664. void VIEW_ShareEnded(void);
  665. void USR_ShareEnded(void);
  666. //
  667. // Member joining share
  668. //
  669. BOOL SC_PartyAdded(UINT mcsID, LPSTR szName, UINT cbCaps, LPVOID pCaps);
  670. ASPerson * SC_PartyJoiningShare(UINT mcsID, LPSTR szName, UINT cbCaps, LPVOID pCaps);
  671. BOOL CM_PartyJoiningShare(ASPerson * pasPerson);
  672. BOOL CPC_PartyJoiningShare(ASPerson * pasPerson, UINT cbCaps, void* pCapsData);
  673. BOOL DCS_PartyJoiningShare(ASPerson * pasPerson);
  674. BOOL HET_PartyJoiningShare(ASPerson * pasPerson);
  675. //
  676. // Member leaving share
  677. //
  678. void SC_PartyDeleted(UINT mcsID);
  679. void SC_PartyLeftShare(UINT mcsID);
  680. void CA_PartyLeftShare(ASPerson * pasPerson);
  681. void CM_PartyLeftShare(ASPerson * pasPerson);
  682. void DCS_PartyLeftShare(ASPerson * pasPerson);
  683. void HET_PartyLeftShare(ASPerson * pasPerson);
  684. void OD2_PartyLeftShare(ASPerson * pasPerson);
  685. void OE_PartyLeftShare(ASPerson * pasPerson);
  686. void PM_PartyLeftShare(ASPerson * pasPerson);
  687. void RBC_PartyLeftShare(ASPerson * pasPerson);
  688. void VIEW_PartyLeftShare(ASPerson * pasPerson);
  689. //
  690. // Recalc caps after somebody joined or left
  691. //
  692. void SC_RecalcCaps(BOOL fJoiner);
  693. void CM_RecalcCaps(BOOL fJoiner);
  694. void DCS_RecalcCaps(BOOL fJoiner);
  695. void OE_RecalcCaps(BOOL fJoiner);
  696. void PM_RecalcCaps(BOOL fJoiner);
  697. void SBC_RecalcCaps(BOOL fJoiner);
  698. void SSI_RecalcCaps(BOOL fJoiner);
  699. void USR_RecalcCaps(BOOL fJoiner);
  700. //
  701. // Syncing due to new member joined or reset
  702. //
  703. void DCS_SyncOutgoing(void);
  704. void IM_SyncOutgoing(void);
  705. void OD2_SyncIncoming(ASPerson * pasPerson);
  706. void OE_SyncOutgoing(void);
  707. //
  708. // Starting host view
  709. //
  710. BOOL HET_ViewStarting(ASPerson * pasPerson);
  711. BOOL CA_ViewStarting(ASPerson * pasPerson);
  712. BOOL CM_ViewStarting(ASPerson * pasPerson);
  713. BOOL OD_ViewStarting(ASPerson * pasPerson);
  714. BOOL OD2_ViewStarting(ASPerson * pasPerson);
  715. BOOL PM_ViewStarting(ASPerson * pasPErson);
  716. BOOL RBC_ViewStarting(ASPerson * pasPerson);
  717. BOOL SSI_ViewStarting(ASPerson * pasPerson);
  718. BOOL VIEW_ViewStarting(ASPerson * pasPerson);
  719. BOOL USR_ViewStarting(ASPerson * pasPerson);
  720. //
  721. // Stopped host view
  722. //
  723. void HET_ViewEnded(ASPerson * pasPerson);
  724. void CA_ViewEnded(ASPerson * pasPerson);
  725. void CM_ViewEnded(ASPerson * pasPerson);
  726. void OD_ViewEnded(ASPerson * pasPerson);
  727. void OD2_ViewEnded(ASPerson * pasPerson);
  728. void PM_ViewEnded(ASPerson * pasPerson);
  729. void RBC_ViewEnded(ASPerson * pasPerson);
  730. void SSI_ViewEnded(ASPerson * pasPerson);
  731. void VIEW_ViewEnded(ASPerson * pasPerson);
  732. void USR_ViewEnded(ASPerson * pasPerson);
  733. //
  734. // Periodic processing when in share, mostly for when hosting
  735. //
  736. void SC_Periodic(void);
  737. void CA_Periodic(void);
  738. void HET_Periodic(void);
  739. void IM_Periodic(void);
  740. void OE_Periodic(void);
  741. //
  742. // Incoming packet handling
  743. //
  744. void SC_ReceivedPacket(PS20DATAPACKET pPacket);
  745. void AWC_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  746. void CA_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  747. void CA30_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  748. void CM_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  749. void CPC_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  750. void FH_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  751. void HET_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  752. void PM_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  753. void OD_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  754. void SDP_ReceivedPacket(ASPerson * pasPerson, PS20DATAPACKET pPacket);
  755. void SWL_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  756. void UP_ReceivedPacket(ASPerson * pasFrom, PS20DATAPACKET pPacket);
  757. //
  758. // Random component routines
  759. //
  760. BOOL AWC_SendMsg(UINT userTo, UINT msg, UINT data1, UINT data2);
  761. BOOL BC_CompressBitmap( LPBYTE pSrcBitmap,
  762. LPBYTE pDstBuffer,
  763. LPUINT pDstBufferSize,
  764. UINT bitmapWidth,
  765. UINT bitmapHeight,
  766. UINT bitmapBitsPerPel,
  767. LPBOOL pLossy);
  768. BOOL BD_DecompressBitmap( LPBYTE pCompressedData,
  769. LPBYTE pDstBitmap,
  770. UINT srcDataSize,
  771. UINT bitmapWidth,
  772. UINT bitmapHeight,
  773. UINT bitmapBitsPerPel );
  774. void CA_TakeControl(ASPerson * pasHost);
  775. void CA_CancelTakeControl(ASPerson * pasHost, BOOL fPacket);
  776. void CA_ReleaseControl(ASPerson * pasFrom, BOOL fPacket);
  777. void CA_PassControl(ASPerson * pasHost, ASPerson * pasViewer);
  778. void CA_AllowControl(BOOL fAllow);
  779. void CA_GiveControl(ASPerson * pasInvite);
  780. void CA_CancelGiveControl(ASPerson * pasViewer, BOOL fPacket);
  781. void CA_RevokeControl(ASPerson * pasController, BOOL fPacket);
  782. void CA_ClearLocalState(UINT clearFlags, ASPerson * pasRemote, BOOL fPacket);
  783. BOOL CA_QueryDlgProc(HWND, UINT, WPARAM, LPARAM);
  784. void CM_DrawShadowCursor(ASPerson * pasPerson, HDC hdc );
  785. void CM_UpdateShadowCursor(ASPerson * pasPerson, BOOL fOff,
  786. int xPosNew, int yPosNew, int xHotNew, int yHotNew);
  787. void CPC_UpdatedCaps(PPROTCAPS pCaps);
  788. #ifdef _DEBUG
  789. UINT DCS_CompressAndSendPacket(UINT streamID, UINT nodeID, PS20DATAPACKET pPacket, UINT packetLength);
  790. #else
  791. void DCS_CompressAndSendPacket(UINT streamID, UINT nodeID, PS20DATAPACKET pPacket, UINT packetLength);
  792. #endif // _DEBUG
  793. void DCS_FlowControl(UINT newBufferSize);
  794. void DCS_TakeControl(UINT gccOf);
  795. void DCS_CancelTakeControl(UINT gccOf);
  796. void DCS_ReleaseControl(UINT gccOf);
  797. void DCS_PassControl(UINT gccOf, UINT gccTo);
  798. void DCS_GiveControl(UINT gccTo);
  799. void DCS_CancelGiveControl(UINT gccTo);
  800. void DCS_RevokeControl(UINT gccTo);
  801. void FH_ConvertAnyFontIDToLocal(LPCOM_ORDER pOrder, ASPerson * pasPerson);
  802. void FH_DetermineFontSupport(void);
  803. void FH_SendLocalFontInfo(void);
  804. void HET_CalcViewers(ASPerson * pasLeaving);
  805. void HET_HandleNewTopLevel(BOOL fShowing);
  806. void HET_HandleRecountTopLevel(UINT newCount);
  807. void HET_ShareApp(WPARAM, LPARAM);
  808. void HET_ShareDesktop(void);
  809. void HET_UnshareAll(void);
  810. void HET_UnshareApp(WPARAM, LPARAM);
  811. BOOL HET_WindowIsHosted(HWND winid);
  812. BOOL IM_Controlled(ASPerson * pasControlledBy);
  813. void IM_InControl(ASPerson * pasInControlOf);
  814. void IM_OutgoingKeyboardInput(ASPerson * pasHost,
  815. UINT vkCode, UINT keyData);
  816. void IM_OutgoingMouseInput(ASPerson * pasHost,
  817. LPPOINT pMousePos, UINT message, UINT extra);
  818. void IM_ReceivedPacket(ASPerson * pasPerson, PS20DATAPACKET pPacket);
  819. void IM_SyncOutgoingKeyboard(void);
  820. void OD_ReplayOrder(ASPerson * pasFrom, LPCOM_ORDER pOrder, BOOL fPalRGB);
  821. void OD_ResetRectRegion(ASPerson * pasPerson);
  822. void OD_UpdateView(ASPerson * pasHost);
  823. void OD2_CalculateBounds(LPCOM_ORDER pOrder, LPRECT pRect,
  824. BOOL fDecoding, ASPerson * pasPerson);
  825. void OD2_CalculateTextOutBounds(LPTEXTOUT_ORDER pTextOut,
  826. LPRECT pRect, BOOL fDecoding, ASPerson * pasPerson);
  827. LPCOM_ORDER OD2_DecodeOrder(void * pEOrder, LPUINT LengthDecoded,
  828. ASPerson * pasPerson);
  829. void OE_EnableText(BOOL enable);
  830. BOOL OE_SendAsOrder(DWORD order);
  831. BOOL PM_CacheRxColorTable(ASPerson * pasPerson,
  832. UINT index, UINT cColors, LPTSHR_RGBQUAD pColors);
  833. BOOL PM_CreatePalette(UINT cEntries, LPTSHR_COLOR pNewEntries,
  834. HPALETTE* phPal );
  835. void PM_DeletePalette(HPALETTE palette);
  836. void PM_GetColorTable(ASPerson * pasPerson, UINT index,
  837. UINT * pcColors, LPTSHR_RGBQUAD pColors);
  838. HBITMAP RBC_MapCacheIDToBitmapHandle(ASPerson * pasPerson,
  839. UINT cacheIndex, UINT entry, UINT colorTable);
  840. void RBC_ProcessCacheOrder(ASPerson * pasPerson, LPCOM_ORDER_UA pOrder);
  841. PS20DATAPACKET SC_AllocPkt(UINT streamID, UINT nodeID, UINT len);
  842. ASPerson * SC_PersonAllocate(UINT mcsID, LPSTR szName);
  843. ASPerson * SC_PersonFromNetID(MCSID mcsID);
  844. ASPerson * SC_PersonFromGccID(UINT gccID);
  845. void SC_PersonFree(ASPerson * pasFree);
  846. BOOL SC_ValidateNetID(MCSID mcsID, ASPerson** pLocal);
  847. void SDP_DrawHatchedRect( HDC surface, int x, int y, int width, int height, UINT color);
  848. void SSI_SaveBitmap(ASPerson * pasPerson, LPSAVEBITMAP_ORDER pSaveBitmap);
  849. BOOL VIEW_DlgProc(HWND, UINT, WPARAM, LPARAM);
  850. LRESULT VIEW_FrameWindowProc(HWND, UINT, WPARAM, LPARAM);
  851. LRESULT VIEW_FullScreenExitProc(HWND, UINT, WPARAM, LPARAM);
  852. void VIEW_HostStateChange(ASPerson * pasHost);
  853. void VIEW_InControl(ASPerson * pasRemote, BOOL fStart);
  854. void VIEW_InvalidateRect(ASPerson * pasHost, LPRECT lprc);
  855. void VIEW_InvalidateRgn(ASPerson * pasHost, HRGN rgnUpdated);
  856. BOOL VIEW_IsPointShared(ASPerson * pasHost, POINT pt);
  857. void VIEW_Message(ASPerson * pasHost, UINT ids);
  858. void VIEW_RecalcExtent(ASPerson * pasHost);
  859. void VIEW_RecalcVD(void);
  860. void VIEW_ScreenChanged(ASPerson * pasPerson);
  861. void VIEW_SetHostRegions(ASPerson * pasHost, HRGN rgnShared, HRGN rgnObscured);
  862. void VIEW_SyncCursorPos(ASPerson * pasHost, int x, int y);
  863. void VIEW_UpdateStatus(ASPerson * pasHost, UINT idsStatus);
  864. LRESULT VIEW_ViewWindowProc(HWND, UINT, WPARAM, LPARAM);
  865. void USR_InitDIBitmapHeader(BITMAPINFOHEADER * pbh, UINT bpp);
  866. void USR_ScreenChanged(ASPerson * pasPerson);
  867. void USR_ScrollDesktop(ASPerson * pasPerson, int xNew, int yNew);
  868. BOOL USR_UseFont(HDC hdc, HFONT* pHFONT,
  869. LPTEXTMETRIC pMetrics, LPSTR pName, UINT charSet,
  870. UINT maxHeight, UINT height, UINT width,
  871. UINT weight, UINT flags);
  872. protected:
  873. void CAClearRemoteState(ASPerson * pasClear);
  874. BOOL CAClearHostState(ASPerson * pasHost, ASPerson * pasController);
  875. void CAStartWaiting(ASPerson * pasWait, UINT msgWait);
  876. BOOL CAStartQuery(ASPerson * pasFrom, UINT msg, PCA30P pReq);
  877. void CAFinishQuery(UINT result);
  878. void CACancelQuery(ASPerson * pasFrom, BOOL fPacket);
  879. void CAHandleRequestTakeControl(ASPerson * pasViewer, PCA_RTC_PACKET pPacket);
  880. void CACompleteRequestTakeControl(ASPerson * pasFrom, PCA_RTC_PACKET pPacket, UINT result);
  881. void CAHandleReplyRequestTakeControl(ASPerson * pasHost, PCA_REPLY_RTC_PACKET pPacket);
  882. void CAHandleRequestGiveControl(ASPerson * pasHost, PCA_RGC_PACKET pPacket);
  883. void CACompleteRequestGiveControl(ASPerson * pasFrom, PCA_RGC_PACKET pPacket, UINT result);
  884. void CAHandleReplyRequestGiveControl(ASPerson * pasViewer, PCA_REPLY_RGC_PACKET pPacket);
  885. void CAHandlePreferPassControl(ASPerson * pasController, PCA_PPC_PACKET pPacket);
  886. void CACompletePreferPassControl(ASPerson * pasViewer, UINT mcsOrg, PCA_PPC_PACKET pPacket, UINT result);
  887. void CAHandleInformReleasedControl(ASPerson * pasController, PCA_INFORM_PACKET pPacket);
  888. void CAHandleInformRevokedControl(ASPerson * pasHost, PCA_INFORM_PACKET pPacket);
  889. void CAHandleNewState(ASPerson * pasHost, PCANOTPACKET pPacket);
  890. void CAStartControlled(ASPerson * pasInControl, UINT controlID);
  891. void CAStopControlled(void);
  892. void CAStartInControl(ASPerson * pasControlled, UINT controlID);
  893. void CAStopInControl(void);
  894. BOOL CAFlushOutgoingPackets();
  895. void CALangToggle(BOOL);
  896. UINT CANewRequestID(void);
  897. BOOL CAQueueSendPacket(UINT destID, UINT msg, PCA30P pPacket);
  898. BOOL CASendPacket(UINT destID, UINT msg, PCA30P pPacket);
  899. BOOL CMCreateAbbreviatedName(LPCSTR szTagName, LPSTR szBuf, UINT cbBuf);
  900. HCURSOR CMCreateColorCursor(UINT xHotSpot, UINT yHotSpot,
  901. UINT cxWidth, UINT cyHeight, LPBYTE pANDMask,
  902. LPBYTE pXORBitmap, UINT cbANDMask, UINT cbXORBitmap);
  903. BOOL CMCreateIncoming(ASPerson * pasPerson);
  904. HCURSOR CMCreateMonoCursor(UINT xHotSpot, UINT yHotSpot,
  905. UINT cxWidth, UINT cyHeight, LPBYTE pANDMask,
  906. LPBYTE pXORBitmap);
  907. void CMDrawCursorTag(ASPerson * pasPerson, HDC hdc);
  908. void CMFreeIncoming(ASPerson * pasPerson);
  909. UINT CMProcessColorCursorPacket( PCMPACKETCOLORBITMAP pCMPacket,
  910. HCURSOR * phNewCursor, LPPOINT pNewHotSpot );
  911. void CMProcessCursorIDPacket(PCMPACKETID pCMPacket,
  912. HCURSOR * phNewCursor, LPPOINT pNewHotSpot);
  913. UINT CMProcessMonoCursorPacket(PCMPACKETMONOBITMAP pCMPacket,
  914. HCURSOR * phNewCursor, LPPOINT pNewHotSpot );
  915. void CMReceivedCursorMovedPacket(ASPerson * pasPerson, PCMPACKETHEADER pCMPacket );
  916. void CMReceivedCursorShapePacket(ASPerson * pasPerson, PCMPACKETHEADER pCMPacket );
  917. BOOL CPCCapabilitiesChange(ASPerson * pasPerson, PPROTCAPS pCaps);
  918. ASPerson * DCSGetPerson(UINT gccID, BOOL fNull);
  919. UINT FHConsiderRemoteFonts(UINT cCommonFonts, ASPerson * pasPerson);
  920. UINT FHGetLocalFontHandle(UINT remoteFont, ASPerson * pasPerson);
  921. void FHMaybeEnableText(void);
  922. void HETCheckSharing(BOOL fStartHost);
  923. BOOL HETStartHosting(BOOL fDesktop);
  924. void HETStopHosting(BOOL fDesktop);
  925. void HETSendLocalCount(void);
  926. void HETUpdateLocalCount(UINT newCount);
  927. void HETUpdateRemoteCount(ASPerson * pasPerson, UINT newCount);
  928. BOOL IMConvertAndSendEvent(ASPerson * pasFor, LPIMEVENT pIMEvent);
  929. UINT IMConvertIMEventToOSEvent(LPIMEVENT pEvent, LPIMOSEVENT pOSEvent);
  930. void IMDiscardUnreplayableOSEvents(void);
  931. void IMGenerateFakeKeyPress(TSHR_UINT16 type,
  932. TSHR_UINT16 key, TSHR_UINT16 flags);
  933. BYTE IMGetHighLevelKeyState(UINT vk);
  934. void IMSendKeyboardState(void);
  935. BOOL IMTranslateIncoming(LPIMEVENT pIMIn, LPIMEVENT pIMOut);
  936. BOOL IMTranslateOutgoing(LPIMEVENT pIMIn, LPIMEVENT pIMOut);
  937. void IMAppendNetEvent(LPIMEVENT pIMEvent);
  938. void IMFlushOutgoingEvents(void);
  939. void IMInject(BOOL fStart);
  940. BOOL IMInjectEvent(LPIMOSEVENT pEvent);
  941. BOOL IMInjectingEvents(void);
  942. UINT IMInsertModifierKeystrokes(BYTE curKBState, BYTE targetKBState,
  943. LPUINT pEventQueue);
  944. void IMMaybeAddDeadKey(BYTE vk);
  945. void IMMaybeInjectEvents(void);
  946. void IMSpoilEvents(void);
  947. void IMUpdateAsyncArray(LPBYTE pimKeyStates, LPIMOSEVENT pEvent);
  948. void ODAdjustColor(ASPerson * pasPerson, const TSHR_COLOR * pColorIn, LPTSHR_COLOR pColorOut, int type);
  949. void ODDrawTextOrder(ASPerson * pasPerson, BOOL fExtText, BOOL fPalRGB,
  950. LPCOMMON_TEXTORDER pCommon, LPSTR pText, UINT cchText,
  951. LPRECT pExtRect, UINT extOptions, LPINT pExtDx);
  952. void ODReplayARC(ASPerson * pasFrom, LPARC_ORDER pArc, BOOL fPalRGB);
  953. void ODReplayCHORD(ASPerson * pasFrom, LPCHORD_ORDER pChord, BOOL fPalRGB);
  954. void ODReplayDSTBLT(ASPerson * pasFrom, LPDSTBLT_ORDER pDstBlt, BOOL fPalRGB);
  955. void ODReplayELLIPSE(ASPerson * pasFrom, LPELLIPSE_ORDER pEllipse, BOOL fPalRGB);
  956. void ODReplayEXTTEXTOUT(ASPerson * pasFrom, LPEXTTEXTOUT_ORDER pExtTextOut, BOOL fPalRGB);
  957. void ODReplayLINETO(ASPerson * pasFrom, LPLINETO_ORDER pLineTo, BOOL fPalRGB);
  958. void ODReplayMEM3BLT(ASPerson * pasFrom, LPMEM3BLT_ORDER pMem3Blt, BOOL fPalRGB);
  959. void ODReplayMEMBLT(ASPerson * pasFrom, LPMEMBLT_ORDER pMemBlt, BOOL fPalRGB);
  960. void ODReplayOPAQUERECT(ASPerson * pasFrom, LPOPAQUERECT_ORDER pOpaqeRect, BOOL fPalRGB);
  961. void ODReplayPATBLT(ASPerson * pasFrom, LPPATBLT_ORDER pPatBlt, BOOL fPalRGB);
  962. void ODReplayPIE(ASPerson * pasFrom, LPPIE_ORDER pPie, BOOL fPalRGB);
  963. void ODReplayPOLYBEZIER(ASPerson * pasFrom, LPPOLYBEZIER_ORDER pPolyBezier, BOOL fPalRGB);
  964. void ODReplayPOLYGON(ASPerson * pasFrom, LPPOLYGON_ORDER pPolygon, BOOL fPalRGB);
  965. void ODReplayRECTANGLE(ASPerson * pasFrom, LPRECTANGLE_ORDER pRectangle, BOOL fPalRGB);
  966. void ODReplayROUNDRECT(ASPerson * pasFrom, LPROUNDRECT_ORDER pRoundRect, BOOL fPalRGB);
  967. void ODReplaySCRBLT(ASPerson * pasFrom, LPSCRBLT_ORDER pScrBlt, BOOL fPalRGB);
  968. void ODReplayTEXTOUT(ASPerson * pasFrom, LPTEXTOUT_ORDER pTextOut, BOOL fPalRGB);
  969. void ODUseArcDirection(ASPerson * pasPerson, UINT dir);
  970. void ODUseBkColor(ASPerson * pasPerson, BOOL fPalRGB, TSHR_COLOR color);
  971. void ODUseBkMode(ASPerson * pasPerson, int mode);
  972. void ODUseBrush(ASPerson * pasPerson, BOOL fPalRGB,
  973. int x, int y, UINT Style, UINT Hatch,
  974. TSHR_COLOR Color, BYTE Extra[7]);
  975. void ODUseFillMode(ASPerson * pasPerson, UINT mode);
  976. void ODUseFont(ASPerson * pasPerson, LPSTR pName, UINT cchName,
  977. UINT codePage, UINT maxHeight, UINT Height,
  978. UINT Width, UINT Weight, UINT flags);
  979. void ODUsePen(ASPerson * pasPerson, BOOL fPalRGB,
  980. UINT style, UINT width, TSHR_COLOR color);
  981. void ODUseRectRegion(ASPerson * pasPerson, int left,
  982. int top, int right, int bottom);
  983. void ODUseROP2(ASPerson * pasPerson, int rop);
  984. void ODUseTextBkColor(ASPerson * pasPerson, BOOL fPalRGB, TSHR_COLOR color);
  985. void ODUseTextCharacterExtra(ASPerson * pasPerson, int extra);
  986. void ODUseTextColor(ASPerson * pasPerson, BOOL fPalRGB, TSHR_COLOR color);
  987. void ODUseTextJustification(ASPerson * pasPerson, int extra, int count);
  988. void OD2CopyFromDeltaCoords(LPTSHR_INT8* ppSrc, LPVOID pDst,
  989. UINT cbDstField, BOOL fSigned, UINT numElements);
  990. void OD2DecodeBounds(LPBYTE *ppNextDataToCopy,
  991. LPTSHR_RECT16 pRect, ASPerson * pasPerson);
  992. void OD2DecodeField(LPBYTE* ppSrc, LPVOID pDest,
  993. UINT cbSrcField, UINT cbDstField, BOOL fSigned,
  994. UINT numElements);
  995. void OD2FreeIncoming(ASPerson * pasPerson);
  996. BOOL OD2UseFont(ASPerson * pasPerson, LPSTR pName,
  997. UINT facelength, UINT codePage, UINT MaxHeight,
  998. UINT Height, UINT Width, UINT Weight, UINT flags);
  999. void OECapabilitiesChanged(void);
  1000. void PMFreeIncoming(ASPerson * pasPerson);
  1001. void RBCFreeIncoming(ASPerson * pasPerson);
  1002. void RBCStoreBitsInCacheBitmap(ASPerson * pasPerson,
  1003. UINT cacheID, UINT iCacheEntry, UINT cxSubWidth,
  1004. UINT cxFixedWidth, UINT cySubHeight, UINT bpp,
  1005. LPBYTE pBitmapBits, UINT cbBitmapBits, BOOL fCompressed);
  1006. BOOL SCSyncStream(UINT streamID);
  1007. void SDPDrawHatchedRegion(HDC hdc, HRGN region, UINT hatchColor);
  1008. void SDPPlayScreenDataToRDB(ASPerson * pasPerson,
  1009. PSDPACKET pUpdates, LPBYTE pBits, LPRECT pPosition);
  1010. void VIEWClientAutoScroll(ASPerson *);
  1011. void VIEWClientCaptureStolen(ASPerson *);
  1012. void VIEWClientExtentChange(ASPerson * pasHost, BOOL fRedraw);
  1013. void VIEWClientGetSize(ASPerson * pasHost, LPRECT lprc);
  1014. void VIEWClientMouseDown(ASPerson *, UINT, WPARAM, LPARAM);
  1015. void VIEWClientMouseMove(ASPerson *, UINT, WPARAM, LPARAM);
  1016. void VIEWClientMouseMsg(ASPerson *, UINT, WPARAM, LPARAM);
  1017. void VIEWClientMouseUp(ASPerson *, UINT, WPARAM, LPARAM, BOOL);
  1018. void VIEWClientMouseWheel(ASPerson *, WPARAM, LPARAM);
  1019. void VIEWClientPaint(ASPerson * pasHost);
  1020. BOOL VIEWClientScroll(ASPerson * pasHost, int xNew, int yNew);
  1021. void VIEWFrameAbout(ASPerson * pasHost);
  1022. void VIEWFrameCommand(ASPerson * pasHost, WPARAM wParam, LPARAM lParam);
  1023. BOOL VIEWFrameCreate(ASPerson * pasHost);
  1024. void VIEWFrameFullScreen(ASPerson * pasHost, BOOL fFull);
  1025. void VIEWFrameGetSize(ASPerson * pasHost, LPRECT lprc);
  1026. void VIEWFrameHelp(ASPerson * pasHost);
  1027. void VIEWFrameInitMenuBar(ASPerson * pasHost);
  1028. void VIEWFrameOnMenuSelect(ASPerson * pasHost, WPARAM wParam, LPARAM lParam);
  1029. void VIEWFrameResize(ASPerson * pasHost);
  1030. void VIEWFrameResizeChanged(ASPerson * pasHost);
  1031. void VIEWFrameSetStatus(ASPerson * pasHost, UINT idsStatus);
  1032. void VIEWFullScreenExitPaint(ASPerson * pasHost, HWND hwnd);
  1033. void VIEWStartControlled(BOOL fControlled);
  1034. BOOL USRCreateRemoteDesktop(ASPerson * pasPerson);
  1035. void USRDeleteRemoteDesktop(ASPerson * pasPerson);
  1036. };
  1037. typedef struct tagASSession
  1038. {
  1039. // pasNext someday!
  1040. UINT scState;
  1041. UINT callID; // ID of call
  1042. MCSID gccID; // GCC node_id
  1043. BOOL fShareCreator;
  1044. UINT cchLocalName;
  1045. char achLocalName[TSHR_MAX_PERSON_NAME_LEN];
  1046. ASShare * pShare;
  1047. #ifdef _DEBUG
  1048. DWORD scShareTime;
  1049. #endif
  1050. }
  1051. ASSession;
  1052. #endif // _H_AS
  1053.