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.

167 lines
4.4 KiB

  1. #pragma once
  2. //********************************************************************************
  3. // MAKE NOTE:
  4. // =========
  5. // This file is included by parser\comptree
  6. // If you modify this file, please make sure that parser\comptree still builds.
  7. //
  8. // You have been warned.
  9. //********************************************************************************
  10. #define XML_FILE_FORMAT_CURRENT_VERSION 0x3
  11. const CHAR g_szMMFCookie[] = "PCH_MMF";
  12. #define MMF_FILE_COOKIELEN ARRAYSIZE(g_szMMFCookie)
  13. typedef enum
  14. {
  15. PANEL_LEFT,
  16. PANEL_RIGHT,
  17. PANEL_TOP,
  18. PANEL_BOTTOM,
  19. PANEL_WINDOW,
  20. PANEL_POPUP,
  21. PANEL_INVALID = -1
  22. }
  23. PANEL_POSITION;
  24. const int PANEL_FLAG_VISIBLE = 0x00000001; // Do we start out visible?
  25. const int PANEL_FLAG_WEBBROWSER = 0x00000002; // Do we host shdocvw?
  26. const int PANEL_FLAG_ONDEMAND = 0x00000004; // We wait for first vis to show?
  27. const int PANEL_FLAG_TRUSTED = 0x00000008; // Is this a trusted panel?
  28. const int PANEL_FLAG_AUTOPERSIST = 0x00000010; // Does this panel persist in the travel log?
  29. const int PANEL_FLAG_AUTOSIZE = 0x00000020; // Should this panel autosize?
  30. const int PANEL_FLAG_CUSTOMCONTROL = 0x00001000; // Are we a "marsdoc" panel?
  31. const int PANEL_FLAG_ALL = 0x0000103f; // All the above flags. Used for validation.
  32. const int DEFAULT_PANEL_FLAGS = PANEL_FLAG_ONDEMAND; // default flags
  33. const int PANEL_NAME_MAXLEN = 63;
  34. const int PANEL_NAME_MAXSIZE = PANEL_NAME_MAXLEN + 1;
  35. typedef enum
  36. {
  37. PANEL_PERSIST_VISIBLE_NEVER , // When transitioning to a place, always show the place panel.
  38. PANEL_PERSIST_VISIBLE_DONTTOUCH, // If the place was in the previous place, don't touch its state.
  39. PANEL_PERSIST_VISIBLE_ALWAYS , // Restore the persisted state every time the place is reached.
  40. } PANEL_PERSIST_VISIBLE;
  41. ////////////////////////////////////////////////////////////////////////////////
  42. struct MarsAppDef_PlacePanel
  43. {
  44. WCHAR szName[PANEL_NAME_MAXSIZE];
  45. BOOL fDefaultFocusPanel;
  46. BOOL fStartVisible; // only used when persistence is not "NEVER"
  47. PANEL_PERSIST_VISIBLE persistVisible;
  48. MarsAppDef_PlacePanel()
  49. {
  50. ::ZeroMemory( szName, sizeof( szName ) );
  51. fDefaultFocusPanel = FALSE;
  52. fStartVisible = TRUE;
  53. persistVisible = PANEL_PERSIST_VISIBLE_NEVER;
  54. }
  55. };
  56. struct MarsAppDef_Place
  57. {
  58. WCHAR szName[PANEL_NAME_MAXSIZE];
  59. DWORD dwPlacePanelCount;
  60. MarsAppDef_Place()
  61. {
  62. ::ZeroMemory( szName, sizeof( szName ) );
  63. dwPlacePanelCount = 0;
  64. }
  65. };
  66. struct MarsAppDef_Places
  67. {
  68. DWORD dwPlacesCount;
  69. MarsAppDef_Places()
  70. {
  71. dwPlacesCount = 0;
  72. }
  73. };
  74. struct MarsAppDef_Panel
  75. {
  76. WCHAR szName[PANEL_NAME_MAXSIZE];
  77. WCHAR szUrl [MAX_PATH ];
  78. PANEL_POSITION Position;
  79. long lWidth; // Used for "left", "right", or "popup"
  80. long lWidthMax;
  81. long lWidthMin;
  82. long lHeight; // Used for "top", "bottom", or "popup"
  83. long lHeightMax;
  84. long lHeightMin;
  85. long lX; // Used for "popup"
  86. long lY; // Used for "popup"
  87. DWORD dwFlags; // PANEL_FLAG_*
  88. MarsAppDef_Panel()
  89. {
  90. ::ZeroMemory( szName, sizeof( szName ) );
  91. ::ZeroMemory( szUrl , sizeof( szUrl ) );
  92. Position = PANEL_TOP;
  93. lWidth = 0;
  94. lWidthMax = -1;
  95. lWidthMin = -1;
  96. lHeight = 0;
  97. lHeightMax = -1;
  98. lHeightMin = -1;
  99. lX = 0;
  100. lY = 0;
  101. dwFlags = DEFAULT_PANEL_FLAGS;
  102. }
  103. };
  104. struct MarsAppDef_Panels
  105. {
  106. DWORD dwPanelsCount;
  107. MarsAppDef_Panels()
  108. {
  109. dwPanelsCount = 0;
  110. }
  111. };
  112. struct MarsAppDef
  113. {
  114. DWORD dwVersion;
  115. BOOL fTitleBar;
  116. MarsAppDef()
  117. {
  118. dwVersion = XML_FILE_FORMAT_CURRENT_VERSION;
  119. fTitleBar = TRUE;
  120. }
  121. };
  122. ////////////////////////////////////////////////////////////////////////////////
  123. struct tagPositionMap
  124. {
  125. LPCWSTR pwszName;
  126. PANEL_POSITION Position;
  127. };
  128. extern const struct tagPositionMap s_PositionMap[];
  129. extern const int c_iPositionMapSize;
  130. HRESULT StringToPanelPosition(LPCWSTR pwszPosition, PANEL_POSITION *pPosition);
  131. void StringToPanelFlags(LPCWSTR pwsz, DWORD &dwFlags, long lLen =-1);
  132. void StringToPersistVisibility(LPCWSTR pwsz, PANEL_PERSIST_VISIBLE &persistVis);