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.

229 lines
6.1 KiB

  1. /*++
  2. Copyright (c) 1992-2002 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_FLOATING_POINT 0x00000002
  20. #define ITEM_USER_FLAGS 0xffff0000
  21. #define ITEM_VALUE_CHANGED 0x10000000
  22. class DUALLISTWIN_DATA : public SINGLE_CHILDWIN_DATA
  23. {
  24. public:
  25. DWORD m_wFlags;
  26. // Handle to the list view control.
  27. HWND m_hwndEditControl;
  28. int m_nItem_LastSelected;
  29. int m_nSubItem_LastSelected;
  30. // Item and subitem currently being edited
  31. int m_nItem_CurrentlyEditing;
  32. int m_nSubItem_CurrentlyEditing;
  33. DUALLISTWIN_DATA(ULONG ChangeBy);
  34. virtual void Validate();
  35. virtual void SetFont(ULONG FontIndex);
  36. virtual BOOL OnCreate(void);
  37. virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  38. virtual LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  39. virtual BOOL ClearList(ULONG ClearFrom);
  40. virtual void EditText();
  41. virtual void InvalidateItem(int);
  42. virtual void ItemChanged(int Item, PCSTR Text);
  43. virtual LRESULT OnCustomDraw(LPNMLVCUSTOMDRAW Custom);
  44. virtual LRESULT OnCustomItem(ULONG SubItem, LPNMLVCUSTOMDRAW Custom);
  45. virtual void OnClick(LPNMLISTVIEW);
  46. virtual BOOL CanCopy();
  47. virtual BOOL CanCut();
  48. virtual BOOL CanPaste();
  49. virtual void Copy();
  50. virtual void Cut();
  51. virtual void Paste();
  52. virtual void UpdateColors(void);
  53. ULONG GetItemFlags(ULONG Item);
  54. void SetItemFlags(ULONG Item, ULONG Flags);
  55. BOOL SetItemFromEdit(ULONG Item, ULONG SubItem);
  56. };
  57. typedef DUALLISTWIN_DATA *PDUALLISTWIN_DATA;
  58. class CPUWIN_DATA : public DUALLISTWIN_DATA
  59. {
  60. public:
  61. ULONG m_ProcType;
  62. ULONG m_NamesProcType;
  63. ULONG m_NumRegisters;
  64. BOOL m_CheckChanged;
  65. static HMENU s_ContextMenu;
  66. CPUWIN_DATA();
  67. virtual void Validate();
  68. virtual HRESULT ReadState(void);
  69. virtual HMENU GetContextMenu(void);
  70. virtual void OnContextMenuSelection(UINT Item);
  71. virtual BOOL OnCreate(void);
  72. virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  73. virtual void OnSize(void);
  74. virtual void OnUpdate(UpdateType Type);
  75. virtual void ItemChanged(int Item, PCSTR Text);
  76. virtual LRESULT OnCustomItem(ULONG SubItem, LPNMLVCUSTOMDRAW Custom);
  77. ULONG SetRegVals(HRESULT LockStatus,
  78. PDEBUG_VALUE Vals,
  79. PBOOL Changed,
  80. RegisterNamesStateBuffer* NameBuf,
  81. PULONG RegTypes,
  82. PTSTR RegNames,
  83. ULONG EntryIdx,
  84. BOOL MatchChanged,
  85. BOOL MatchChangedVal);
  86. void UpdateNames(BOOL FullUpdate);
  87. // Keep engine register index in the
  88. // user item flags.
  89. ULONG RegToFlags(USHORT Reg)
  90. {
  91. return (ULONG)Reg << 16;
  92. }
  93. USHORT FlagsToReg(ULONG Flags)
  94. {
  95. return (USHORT)(Flags >> 16);
  96. }
  97. };
  98. typedef CPUWIN_DATA * PCPUWIN_DATA;
  99. class SYMWIN_DATA : public DUALLISTWIN_DATA
  100. {
  101. public:
  102. SYMWIN_DATA(IDebugSymbolGroup **pDbgSymbolGroup);
  103. ~SYMWIN_DATA();
  104. static HMENU s_ContextMenu;
  105. virtual void Validate();
  106. virtual HRESULT ReadState(void);
  107. virtual HMENU GetContextMenu(void);
  108. virtual void OnContextMenuSelection(UINT Item);
  109. virtual BOOL OnCreate(void);
  110. virtual void OnSize(void);
  111. virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  112. virtual LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  113. virtual void OnUpdate(UpdateType Type);
  114. virtual ULONG GetWorkspaceSize(void);
  115. virtual PUCHAR SetWorkspace(PUCHAR Data);
  116. virtual PUCHAR ApplyWorkspace1(PUCHAR Data, PUCHAR End);
  117. virtual void ItemChanged(int Item, PCSTR Text);
  118. virtual void OnClick(LPNMLISTVIEW);
  119. virtual LRESULT OnOwnerDraw(UINT uMsg, WPARAM wParam, LPARAM lParam);
  120. void UpdateNames();
  121. BOOL AddListItem(ULONG iItem, PSTR ItemText,
  122. ULONG Level, BOOL HasChildren, BOOL Expanded);
  123. HRESULT SetMaxSyms(ULONG nSyms);
  124. ULONG GetMaxSyms() { return m_nWinSyms;}
  125. PDEBUG_SYMBOL_PARAMETERS GetSymParam() { return m_pWinSyms;}
  126. void SetDisplayTypes(LONG Id, BOOL Set);
  127. void DrawTreeItem(HDC hDC, ULONG itemID, RECT ItemRect, PULONG pIndentOffset);
  128. void ExpandSymbol(ULONG Index, BOOL Expand);
  129. void SyncUiWithFlags(ULONG Changed);
  130. private:
  131. ULONG m_LastIndex;
  132. PDEBUG_SYMBOL_PARAMETERS m_pWinSyms;
  133. ULONG m_nWinSyms;
  134. BOOL m_DisplayTypes;
  135. BOOL m_DisplayOffsets;
  136. ULONG m_SplitWindowAtItem;
  137. LONG m_IndentWidth;
  138. ULONG m_NumCols;
  139. UCHAR m_ListItemLines[2048];
  140. protected:
  141. BOOL m_RefreshValues;
  142. ULONG m_MaxNameWidth;
  143. CHAR m_ChangedName[1024];
  144. ULONG m_RefreshItem;
  145. ULONG m_UpdateItem;
  146. ULONG m_NumSymsDisplayed;
  147. IDebugSymbolGroup **m_pDbgSymbolGroup;
  148. };
  149. class WATCHWIN_DATA : public SYMWIN_DATA
  150. {
  151. public:
  152. WATCHWIN_DATA();
  153. virtual void Validate();
  154. HRESULT ReadState(void);
  155. virtual ULONG GetWorkspaceSize(void);
  156. virtual PUCHAR SetWorkspace(PUCHAR Data);
  157. virtual PUCHAR ApplyWorkspace1(PUCHAR Data, PUCHAR End);
  158. private:
  159. };
  160. typedef WATCHWIN_DATA *PWATCHWIN_DATA;
  161. extern BOOL g_ScopeChanged;
  162. class LOCALSWIN_DATA : public SYMWIN_DATA
  163. {
  164. public:
  165. LOCALSWIN_DATA();
  166. ~LOCALSWIN_DATA();
  167. virtual BOOL OnCreate(void);
  168. virtual void Validate();
  169. HRESULT ReadState(void);
  170. };
  171. typedef LOCALSWIN_DATA *PLOCALSWIN_DATA;