Leaked source code of windows server 2003
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.

112 lines
3.9 KiB

  1. #if !defined(LAVA__Spy_h__INCLUDED)
  2. #define LAVA__Spy_h__INCLUDED
  3. #pragma once
  4. #include <commctrl.h>
  5. #if DBG
  6. class Spy : public ListNodeT<Spy>
  7. {
  8. // Construction
  9. public:
  10. Spy();
  11. ~Spy();
  12. // Operations
  13. public:
  14. static BOOL BuildSpy(HWND hwndParent, HGADGET hgadRoot, HGADGET hgadSelect);
  15. // Implementation
  16. protected:
  17. static LRESULT CALLBACK
  18. RawSpyWndProc(HWND hwnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
  19. LRESULT SpyWndProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
  20. static HRESULT CALLBACK
  21. RawEventProc(HGADGET hgadCur, void * pvCur, EventMsg * pmsg);
  22. HRESULT EventProc(EventMsg * pmsg);
  23. struct EnumData
  24. {
  25. Spy * pspy;
  26. HTREEITEM htiParent;
  27. int nLevel;
  28. };
  29. static BOOL CALLBACK
  30. EnumAddList(HGADGET hgad, void * pvData);
  31. static BOOL CALLBACK
  32. EnumRemoveLink(HGADGET hgad, void * pvData);
  33. struct CheckIsChildData
  34. {
  35. HGADGET hgadCheck;
  36. BOOL fChild;
  37. };
  38. static BOOL CALLBACK
  39. EnumCheckIsChild(HGADGET hgad, void * pvData);
  40. enum EImage
  41. {
  42. iGadget = 0,
  43. };
  44. void SelectGadget(HGADGET hgad);
  45. HGADGET GetGadget(HTREEITEM hti);
  46. HTREEITEM InsertTreeItem(HTREEITEM htiParent, HGADGET hgad);
  47. void DisplayContextMenu(BOOL fViaKbd);
  48. void UpdateTitle();
  49. void UpdateDetails();
  50. void UpdateLayout();
  51. void UpdateLayoutDesc(BOOL fForceLayoutDesc);
  52. // Painting
  53. void OnPaint(HDC hdc);
  54. void PaintLine(HDC hdc, POINT * pptOffset, LPCTSTR pszName, LPCTSTR pszText, HFONT hfnt = NULL);
  55. void PaintLine(HDC hdc, POINT * pptOffset, LPCTSTR pszName, LPCWSTR pszText, BOOL fMultiline = FALSE, HFONT hfnt = NULL);
  56. void PaintLine(HDC hdc, POINT * pptOffset, LPCTSTR pszName, int nValue, HFONT hfnt = NULL);
  57. void PaintLine(HDC hdc, POINT * pptOffset, LPCTSTR pszName, void * pvValue, HFONT hfnt = NULL);
  58. int NumLines(int cyPxl) const;
  59. // Data
  60. protected:
  61. HWND m_hwnd;
  62. HWND m_hwndTree;
  63. HIMAGELIST m_hilc;
  64. static HBRUSH s_hbrOutline;
  65. static HFONT s_hfntDesc;
  66. static HFONT s_hfntDescBold;
  67. HGADGET m_hgadMsg; // Common MessageHandler attached to each Gadget
  68. HGADGET m_hgadRoot; // Root of tree
  69. HGADGET m_hgadDetails; // Current Gadget displayed in Details
  70. int m_cItems; // Number of Gadgets in tree
  71. TCHAR m_szRect[128]; // Cached position
  72. WCHAR m_szName[128]; // Cached name
  73. WCHAR m_szType[128]; // Cached type
  74. WCHAR m_szStyle[1024];// Style description
  75. BOOL m_fShowDesc:1; // Whether to show the description area
  76. BOOL m_fValid:1; // Set TRUE when Tree is completely valid
  77. SIZE m_sizeWndPxl; // Size of frame window
  78. static int s_cyLinePxl; // Height of each line in the description area
  79. int m_cLines; // Number of lines
  80. int m_cyDescPxl; // Height of description area in pixels
  81. static DWORD g_tlsSpy; // TLS Slot for Spy
  82. static PRID s_pridLink;
  83. static ATOM s_atom;
  84. static CritLock s_lockList; // Lock for list of Spies
  85. static GList<Spy> s_lstSpys; // List of all open Spies
  86. };
  87. #endif // DBG
  88. #include "Spy.inl"
  89. #endif // LAVA__Spy_h__INCLUDED