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.

201 lines
5.1 KiB

  1. /*++
  2. Copyright (c) 1992-2001 Microsoft Corporation
  3. Module Name:
  4. dualwin.h
  5. Abstract:
  6. Header for new window architecture functions.
  7. Environment:
  8. Win32, User Mode
  9. --*/
  10. //
  11. // Allow editing of right & left panes
  12. //
  13. #define DL_EDIT_LEFTPANE 0x0001
  14. #define DL_EDIT_SECONDPANE 0x0002
  15. #define DL_EDIT_THIRDPANE 0x0004
  16. #define DL_CUSTOM_ITEMS 0x0008
  17. // Item flags for Get/SetItemFlags.
  18. #define ITEM_CHANGED 0x00000001
  19. #define ITEM_VALUE_CHANGED 0x10000000
  20. class DUALLISTWIN_DATA : public SINGLE_CHILDWIN_DATA
  21. {
  22. public:
  23. DWORD m_wFlags;
  24. // Handle to the list view control.
  25. HWND m_hwndEditControl;
  26. int m_nItem_LastSelected;
  27. int m_nSubItem_LastSelected;
  28. // Item and subitem currently being edited
  29. int m_nItem_CurrentlyEditing;
  30. int m_nSubItem_CurrentlyEditing;
  31. DUALLISTWIN_DATA(ULONG ChangeBy);
  32. virtual void Validate();
  33. virtual void SetFont(ULONG FontIndex);
  34. virtual BOOL OnCreate(void);
  35. virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  36. virtual LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  37. virtual BOOL ClearList(ULONG ClearFrom);
  38. virtual void EditText();
  39. virtual void InvalidateItem(int);
  40. virtual void ItemChanged(int Item, PCSTR Text);
  41. virtual LRESULT OnCustomDraw(LPNMLVCUSTOMDRAW Custom);
  42. virtual LRESULT OnCustomItem(ULONG SubItem, LPNMLVCUSTOMDRAW Custom);
  43. virtual void OnClick(LPNMLISTVIEW);
  44. virtual BOOL CanCopy();
  45. virtual BOOL CanCut();
  46. virtual BOOL CanPaste();
  47. virtual void Copy();
  48. virtual void Cut();
  49. virtual void Paste();
  50. ULONG GetItemFlags(ULONG Item);
  51. void SetItemFlags(ULONG Item, ULONG Flags);
  52. BOOL SetItemFromEdit(ULONG Item, ULONG SubItem);
  53. };
  54. typedef DUALLISTWIN_DATA *PDUALLISTWIN_DATA;
  55. class CPUWIN_DATA : public DUALLISTWIN_DATA
  56. {
  57. public:
  58. BOOL m_NamesValid;
  59. BOOL m_NewSession;
  60. static HMENU s_ContextMenu;
  61. CPUWIN_DATA();
  62. virtual void Validate();
  63. virtual HRESULT ReadState(void);
  64. virtual HMENU GetContextMenu(void);
  65. virtual void OnContextMenuSelection(UINT Item);
  66. virtual BOOL OnCreate(void);
  67. virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  68. virtual void OnSize(void);
  69. virtual void OnUpdate(UpdateType Type);
  70. virtual void ItemChanged(int Item, PCSTR Text);
  71. virtual LRESULT OnCustomItem(ULONG SubItem, LPNMLVCUSTOMDRAW Custom);
  72. void UpdateNames(PSTR Buf);
  73. };
  74. typedef CPUWIN_DATA * PCPUWIN_DATA;
  75. class SYMWIN_DATA : public DUALLISTWIN_DATA
  76. {
  77. public:
  78. SYMWIN_DATA(IDebugSymbolGroup **pDbgSymbolGroup);
  79. ~SYMWIN_DATA();
  80. static HMENU s_ContextMenu;
  81. virtual void Validate();
  82. virtual HRESULT ReadState(void);
  83. virtual HMENU GetContextMenu(void);
  84. virtual void OnContextMenuSelection(UINT Item);
  85. virtual BOOL OnCreate(void);
  86. virtual void OnSize(void);
  87. virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  88. virtual LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  89. virtual void OnUpdate(UpdateType Type);
  90. virtual ULONG GetWorkspaceSize(void);
  91. virtual PUCHAR SetWorkspace(PUCHAR Data);
  92. virtual PUCHAR ApplyWorkspace1(PUCHAR Data, PUCHAR End);
  93. virtual void ItemChanged(int Item, PCSTR Text);
  94. virtual void OnClick(LPNMLISTVIEW);
  95. virtual LRESULT OnOwnerDraw(UINT uMsg, WPARAM wParam, LPARAM lParam);
  96. void UpdateNames();
  97. BOOL AddListItem(ULONG iItem, PSTR ItemText,
  98. ULONG Level, BOOL HasChildren, BOOL Expanded);
  99. HRESULT SetMaxSyms(ULONG nSyms);
  100. ULONG GetMaxSyms() { return m_nWinSyms;}
  101. PDEBUG_SYMBOL_PARAMETERS GetSymParam() { return m_pWinSyms;}
  102. void SetDisplayTypes(LONG Id, BOOL Set);
  103. void DrawTreeItem(HDC hDC, ULONG itemID, RECT ItemRect, PULONG pIndentOffset);
  104. void ExpandSymbol(ULONG Index, BOOL Expand);
  105. void SyncUiWithFlags(ULONG Changed);
  106. private:
  107. ULONG m_LastIndex;
  108. PDEBUG_SYMBOL_PARAMETERS m_pWinSyms;
  109. ULONG m_nWinSyms;
  110. BOOL m_DisplayTypes;
  111. BOOL m_DisplayOffsets;
  112. ULONG m_SplitWindowAtItem;
  113. LONG m_IndentWidth;
  114. ULONG m_NumCols;
  115. UCHAR m_ListItemLines[2048];
  116. protected:
  117. ULONG m_MaxNameWidth;
  118. CHAR m_ChangedName[1024];
  119. ULONG m_RefreshItem;
  120. ULONG m_UpdateItem;
  121. ULONG m_NumSymsDisplayed;
  122. IDebugSymbolGroup **m_pDbgSymbolGroup;
  123. };
  124. class WATCHWIN_DATA : public SYMWIN_DATA
  125. {
  126. public:
  127. WATCHWIN_DATA();
  128. virtual void Validate();
  129. HRESULT ReadState(void);
  130. virtual ULONG GetWorkspaceSize(void);
  131. virtual PUCHAR SetWorkspace(PUCHAR Data);
  132. virtual PUCHAR ApplyWorkspace1(PUCHAR Data, PUCHAR End);
  133. private:
  134. };
  135. typedef WATCHWIN_DATA *PWATCHWIN_DATA;
  136. class LOCALSWIN_DATA : public SYMWIN_DATA
  137. {
  138. public:
  139. LOCALSWIN_DATA();
  140. ~LOCALSWIN_DATA();
  141. virtual BOOL OnCreate(void);
  142. virtual void Validate();
  143. HRESULT ReadState(void);
  144. };
  145. typedef LOCALSWIN_DATA *PLOCALSWIN_DATA;