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.

516 lines
19 KiB

  1. #ifndef DOCKBAR_H_
  2. #define DOCKBAR_H_
  3. #include "basebar.h"
  4. // local macros
  5. //
  6. // configurable constants
  7. #define XXX_NEW 0 // 1=turn on work-in-progress
  8. #define XXX_BROWSEROWNED 0 // 1:browser deskbar is owned (proto)
  9. #define XXX_CHEEDESK 0 // 1:chee's desktop (vs. _fDesktop)
  10. #define XXX_BTMFLOAT 0 // 0=allow dragging from non-desk-btm->float
  11. #define XXX_HIDE 1 // 1=turn on autohide (work-in-progress)
  12. #define XXX_HIDEALL 1 // 1=enable autohide in browsers (non-topmost)
  13. #define XXX_CANCEL 0 // 1=use experimental CANCEL code
  14. #define XXX_NEWSLIDE 0 // 1=use new SlideWindow code
  15. #ifndef UNREFERENCED_PARM
  16. #define UNREFERENCED_PARM(p) (p) // ARGUSED
  17. #endif
  18. //*** _PM, _PX -- lazy shorthands
  19. // DESCRIPTION
  20. // _PM check for p==NULL before doing p->m
  21. // _PX check for p==NULL before doing EXPR(p)
  22. //
  23. #define _PM(p, m) ((p) ? (p)->m : (-1))
  24. #define _PX(p, x) ((p) ? (x) : (-1))
  25. #define BITS_SET(v, m) (((v) & (m)) == (m))
  26. //*** IN, OUT, INOUT --
  27. //
  28. #define IN
  29. #define OUT
  30. #define INOUT
  31. #ifndef NOCDESKBAR
  32. #include "dhuihand.h"
  33. //========================================================================
  34. // class CDeskBar (CDeskBar* pwbar)
  35. // NOTES
  36. // we don't use CObjectWithSite because we want _ptbSite not _punkSite.
  37. //========================================================================
  38. class CDockingBar : public CBaseBar
  39. ,public IDockingWindow
  40. ,public IObjectWithSite // n.b. *not* CObjectWithSite
  41. ,public IPersistStreamInit
  42. ,public IPersistPropertyBag
  43. ,public CDocHostUIHandler
  44. {
  45. public:
  46. // *** IUnknown -- disambiguate ***
  47. virtual STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  48. virtual STDMETHODIMP_(ULONG) AddRef(void)
  49. { return CBaseBar::AddRef(); }
  50. virtual STDMETHODIMP_(ULONG) Release(void)
  51. { return CBaseBar::Release(); }
  52. // *** IOleWindow -- disambiguate ***
  53. virtual STDMETHODIMP GetWindow(HWND * lphwnd)
  54. { return CBaseBar::GetWindow(lphwnd); }
  55. virtual STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode)
  56. { return CBaseBar::ContextSensitiveHelp(fEnterMode); }
  57. // *** IOleCommandTarget methods ***
  58. virtual STDMETHODIMP Exec(const GUID *pguidCmdGroup,
  59. DWORD nCmdID, DWORD nCmdexecopt,
  60. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  61. // *** IDockingWindow methods ***
  62. virtual STDMETHODIMP ShowDW(BOOL fShow);
  63. virtual STDMETHODIMP CloseDW(DWORD dwReserved) { return CBaseBar::CloseDW(dwReserved); }
  64. virtual STDMETHODIMP ResizeBorderDW(LPCRECT prcBorder,
  65. IUnknown* punkToolbarSite, BOOL fReserved);
  66. // *** IObjectWithSite methods ***
  67. virtual STDMETHODIMP SetSite(IUnknown* punkSite);
  68. // NOTE: I sure hope E_NOTIMPL is ok?
  69. virtual STDMETHODIMP GetSite(REFIID riid, void** ppvSite) { ASSERT(0); *ppvSite = NULL; return E_NOTIMPL; };
  70. // *** IServiceProvider methods ***
  71. virtual STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, LPVOID* ppvObj);
  72. // *** IPersistStreamInit ***
  73. //virtual STDMETHODIMP GetClassID(CLSID *pClassID);
  74. virtual STDMETHODIMP IsDirty(void);
  75. virtual STDMETHODIMP Load(IStream *pStm);
  76. virtual STDMETHODIMP Save(IStream *pStm, BOOL fClearDirty);
  77. virtual STDMETHODIMP GetSizeMax(ULARGE_INTEGER *pcbSize);
  78. virtual STDMETHODIMP InitNew(void);
  79. // *** IPersistPropertyBag ***
  80. virtual STDMETHODIMP Load(IPropertyBag *pPropBag,
  81. IErrorLog *pErrorLog);
  82. virtual STDMETHODIMP Save(IPropertyBag *pPropBag,
  83. BOOL fClearDirty, BOOL fSaveAllProperties);
  84. // *** IInputObjectSite methods ***
  85. virtual STDMETHODIMP OnFocusChangeIS(IUnknown *punk, BOOL fSetFocus);
  86. // *** IDocHostUIHandler methods ***
  87. virtual STDMETHODIMP ShowContextMenu(DWORD dwID,
  88. POINT* ppt, IUnknown* cmdtReserved, IDispatch* pdispReserved);
  89. protected:
  90. // Constructor & Destructor
  91. CDockingBar();
  92. virtual ~CDockingBar();
  93. void _Initialize(); // 2nd-phase ctor
  94. virtual void _SetModeSide(UINT eMode, UINT uSide, HMONITOR hMon, BOOL fNoMerge);
  95. virtual void _OnPostedPosRectChange();
  96. virtual void _GetChildPos(LPRECT prc);
  97. virtual void _GetStyleForMode(UINT eMode, LONG* plStyle, LONG* plExStyle, HWND* phwndParent);
  98. friend HRESULT CDeskBar_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  99. friend HRESULT CDeskBar_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  100. friend HRESULT BrowserBar_Create(IUnknown** ppunk, IUnknown** ppbs);
  101. // Private members
  102. HMENU _GetContextMenu();
  103. virtual LRESULT _OnCommand(UINT msg, WPARAM wparam, LPARAM lparam);
  104. void _ChangeTopMost(UINT eModeNew);
  105. void _ChangeWindowStateAndParent(UINT eModeNew);
  106. void _ChangeZorder();
  107. void _ResetZorder();
  108. virtual void _OnRaise(UINT flags);
  109. #if XXX_BTMFLOAT && 0
  110. void _MayReWindow(BOOL fToFloat);
  111. #endif
  112. virtual void _NotifyModeChange(DWORD dwMode);
  113. void _GetBorderRect(HMONITOR hMon, RECT* prc);
  114. HRESULT _NegotiateBorderRect(RECT* prcOut, RECT* prcReq, BOOL fCommit);
  115. virtual void _OnSize(void);
  116. void _InitPos4(BOOL fCtor);
  117. void _ProtoRect(RECT* prcOut, UINT eModeNew, UINT uSideNew, HMONITOR hMonNew, POINT* ptXY);
  118. void _NegotiateRect(UINT eModeNew, UINT uSideNew, HMONITOR hMonNew, RECT* rcReq, BOOL fCommit);
  119. void _MoveSizeHelper(UINT eModeNew, UINT eSideNew, HMONITOR hMonNew,
  120. POINT* ptTrans, RECT* rcFeed, BOOL fCommit, BOOL fMove);
  121. void _SetVRect(RECT* rcNew);
  122. void _Recalc(void);
  123. LRESULT _CalcHitTest(WPARAM wParam, LPARAM lParam);
  124. void _DragEnter(UINT uMsg, int xCursor, int yCursor, RECT* rcFeed);
  125. void _DragTrack(UINT uMsg, int xCursor, int yCursor, RECT* rcFeed, int eState);
  126. void _DragLeave(int x, int y, BOOL fCommit);
  127. void _ExecDrag(int eDragging);
  128. void _TrackSliding(int x, int y, RECT* rcFeed,
  129. BOOL fCommit, BOOL fMove);
  130. UINT _CalcDragPlace(POINT& pt, HMONITOR * hMon);
  131. void _SmoothDragPlace(UINT eModeNew, UINT eSideNew, HMONITOR hMonNew, INOUT POINT* pt, RECT* rcFeed);
  132. void _RemoveToolbar(DWORD dwFlags);
  133. HRESULT _TrackPopupMenu(const POINT* ppt);
  134. HMONITOR _SetNewMonitor(HMONITOR hMonNew);
  135. void _HideRegister(BOOL fToHide);
  136. void _DoHide(UINT uOpMask);
  137. virtual void _HandleWindowPosChanging(LPWINDOWPOS pwp);
  138. virtual void _GrowShrinkBar(DWORD dwDirection);
  139. #if 0
  140. void _DoManHide(UINT uOpMask);
  141. #endif
  142. // for _DoHide and _DoManHide
  143. enum aho {
  144. AHO_KILLDO = 0x01,
  145. AHO_SETDO = 0x02,
  146. AHO_KILLUN = 0x04,
  147. AHO_SETUN = 0x08,
  148. AHO_REG = 0x10,
  149. AHO_UNREG = 0x20,
  150. AHO_MOVEDO = 0x40,
  151. AHO_MOVEUN = 0x80
  152. };
  153. #define AHO_MNE TEXT("ksKSrRmM")
  154. void _AppBarRegister(BOOL fRegister);
  155. void _AppBarOnSize();
  156. void _AppBarOnCommand(UINT idCmd);
  157. void _AppBarOnWM(UINT uMsg, WPARAM wParam, LPARAM lParam);
  158. void _AppBarOnPosChanged(PAPPBARDATA pabd);
  159. void _AppBarCallback(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  160. int AppBarQueryPos(RECT* prcOut, UINT uEdge, HMONITOR hMon, const RECT* prcReq, PAPPBARDATA pabd, BOOL fCommit);
  161. void AppBarSetPos(UINT uEdge, const RECT* prcReq, PAPPBARDATA pabd);
  162. void AppBarSetPos0(UINT uEdge, const RECT* prcReq, PAPPBARDATA pabd);
  163. void AppBarQuerySetPos(RECT* prcOut, UINT uEdge, HMONITOR hMon, const RECT* prcReq, PAPPBARDATA pabd, BOOL fCommit);
  164. LRESULT _OnNCHitTest(WPARAM wParam, LPARAM lParam);
  165. void _AdjustToChildSize();
  166. // Window procedure
  167. virtual LRESULT v_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  168. void _OnActivate(WPARAM wParam, LPARAM lParam);
  169. virtual BOOL _OnCloseBar(BOOL fConfirm);
  170. #define RX_EDGE 0x01
  171. #define RX_OPPOSE 0x02
  172. #define RX_ADJACENT 0x04
  173. #define RX_GETWH 0x08
  174. #define RX_HIDE 0x10
  175. //
  176. // We need to do a get window in side this function so that we
  177. // can mirror the edges. I changed them to non-static. [samera]
  178. //
  179. int RectXform(RECT* prcOut, UINT uRxMask,
  180. const RECT* prcIn, RECT* prcBound, int iWH, UINT uSide, HMONITOR hMon);
  181. int RectGetWH(const RECT* prcReq, UINT uSide) {
  182. return RectXform(NULL, RX_GETWH, prcReq, NULL, -1, uSide, NULL);
  183. }
  184. void RectSetWH(RECT* prcReq, int iWH, UINT uSide) {
  185. RectXform(prcReq, RX_OPPOSE, prcReq, NULL, iWH, uSide, NULL);
  186. return;
  187. }
  188. // Member variables
  189. IDockingWindowSite* _ptbSite; // owner
  190. INT _adEdge[4]; // edges' widths (or heights)
  191. RECT _rcFloat; // floating position
  192. HMONITOR _hMon; // the monitor I am on
  193. POINT _ptIdtUnHide; // unhide hysteresis cursor pos
  194. // Variable initialized IPersistPropertyBag::Load
  195. // ...
  196. // Bit fields
  197. UINT _uSide:3; // edge we're on (ABE_*)
  198. // 3 states to initialization (4 w/ ctor)
  199. BITBOOL _fInitSited:1; // SetSite done
  200. UINT _eInitLoaded:2; // Load (or InitNew) done
  201. BITBOOL _fInitShowed:1; // Show done
  202. #if ! XXX_CHEEDESK
  203. BITBOOL _fDesktop:1; // 1:hosted by desktop (vs. browser)
  204. #endif
  205. UINT _fDragging:2; // we're dragging
  206. BITBOOL _fWantHide:1; // 1:autohide requested (in UI)
  207. BITBOOL _fDeleteable:1; // when we close we should signal our parent to delete our info
  208. BITBOOL _fAppRegistered:1; // Registered as an appbar
  209. // Member variables (drag&drop, sizing, ...)
  210. UINT _uSidePending:3; // ...
  211. BITBOOL _fCanHide:1; // 1:autohide granted (registered)
  212. BOOL _fHiding:2; // hide mode (HIDE_*)
  213. BITBOOL _fIdtDoHide:1; // 1:IDT_AUTOHIDE running
  214. BITBOOL _fIdtUnHide:1; // 1:IDT_AUTOUNHIDE running
  215. UINT _eMode; // mode we're in (WBM_*)
  216. UINT _eModePending; // pending drag state
  217. LPARAM _xyPending; // pending drag state
  218. RECT _rcPending; // ...
  219. HMONITOR _hMonPending; // pending monitor
  220. #ifdef DEBUG
  221. // temporary until we make browser tell us about activation
  222. BOOL _fActive:1; // 1:window is active
  223. #endif
  224. // MOVE TO CBROWSERBAR
  225. BITBOOL _fTheater :1;
  226. BITBOOL _fNoAutoHide :1;
  227. int _iTheaterWidth;
  228. // END MOVE TO CBROWSERBAR
  229. };
  230. #define WBM_IS_TOPMOST() (_eMode & WBM_TOPMOST)
  231. #endif //NOCDESKBAR
  232. //*** CASSERT -- compile-time assert
  233. // DESCRIPTION
  234. // Like Assert, but checked at compile-time, and generates no code
  235. // Note that the expr must of course be constant...
  236. #ifndef UNIX
  237. #define CASSERT(e) extern int dummy_array[(e)]
  238. #else
  239. #define CASSERT(e)
  240. #endif
  241. //*** ABE_* -- helpers, etc. for ABE_*'s
  242. //
  243. //*** ABE_X* -- extended ABE_*'s
  244. // DESCRIPTION
  245. // ABE_NIL: distinguished value (unused?).
  246. //
  247. // ABE_XFLOATING: normally we carry around a (mode,side) pair. this
  248. // works fine but is a pain in the (rare) case that we want to return
  249. // a pair. so we have a 'special' side which means we're really
  250. // floating. (alternatives considered included combining the two via
  251. // bit magic, or passing by reference. none stood out as a great
  252. // sol'n, and we only use it one place. a hack? perhaps...)
  253. #define ABE_NIL ((UINT) 0x07) // nil (-1 as a 3-bit field) (ugh!)
  254. #define ABE_XFLOATING ((UINT) 4) // floating (undocked)
  255. CASSERT((ABE_LEFT|ABE_RIGHT|ABE_TOP|ABE_BOTTOM) == 3); // 0..3
  256. #define ISABE_DOCK(abe) ((UINT)(abe) <= 3)
  257. #define ABE_TO_IDM(abe) (IDM_AB_LEFT + (abe))
  258. #define IDM_TO_ABE(abe) ((abe) - IDM_AB_LEFT)
  259. CASSERT(IDM_AB_BOTTOM - IDM_AB_LEFT == 3); // make sure LEFT is 0th
  260. //*** ABE_HORIZ -- is ABE_* horizontal?
  261. // #define ABE_HORIZ(e) ((e) == ABE_TOP || (e) == ABE_BOTTOM)
  262. #define ABE_HORIZ(e) ((e) & 1)
  263. CASSERT(ABE_HORIZ(ABE_TOP) && ABE_HORIZ(ABE_BOTTOM));
  264. CASSERT(! ABE_HORIZ(ABE_LEFT) && ! ABE_HORIZ(ABE_RIGHT));
  265. #define APPBAR_CALLBACK (WM_USER + 73) // REARCHITECT: bad bad bad, I don't know why this is bad but it's previous tagname was unacceptable, perhaps someone should look at this someday - justmann
  266. //*** WS_*, etc. -- window bits, etc. for various modes
  267. // NOTES
  268. // REVIW Don't use SM_CAPTION because it doesn't work properly yet.
  269. // WS_XTOPMOST w/ an 'X' to avoid collision w/ WS_TOPMOST...
  270. #define WS_NIL (WS_POPUP|WS_CLIPCHILDREN|WS_CLIPSIBLINGS)
  271. #define WS_EX_NIL (WS_EX_TOOLWINDOW /*|WS_EX_WINDOWEDGE*/)
  272. #define PARENT_NIL (HWND_DESKTOP)
  273. #define WS_XTOPMOST (WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN|WS_CLIPSIBLINGS)
  274. #define WS_EX_XTOPMOST (WS_EX_TOOLWINDOW|WS_EX_WINDOWEDGE)
  275. #define PARENT_XTOPMOST (HWND_DESKTOP)
  276. #define WS_BTMMOST (WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN|WS_CLIPSIBLINGS)
  277. #define WS_EX_BTMMOST (WS_EX_TOOLWINDOW|WS_EX_WINDOWEDGE)
  278. #define PARENT_BTMMOST() HWND_DESKTOP
  279. #if 0
  280. // 970208 keep this around for 1 week in case the autosize bug isn't fixed
  281. #define WS_BTMMOST WS_BBTMMOST
  282. #define WS_EX_BTMMOST WS_EX_BBTMMOST
  283. #define PARENT_BTMMOST() PARENT_BBTMMOST()
  284. #endif
  285. #define WS_BFLOATING ((/*WS_POPUP*/WS_OVERLAPPED | WS_SYSMENU | WS_THICKFRAME |WS_THICKFRAME|WS_CLIPCHILDREN|WS_CLIPSIBLINGS) & ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX))
  286. #define WS_EX_BFLOATING (/*WS_EX_PALETTEWINDOW | */ WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE)
  287. #define WS_FLOATING ((/*WS_POPUP*/WS_TILEDWINDOW|WS_THICKFRAME|WS_CLIPCHILDREN|WS_CLIPSIBLINGS) & ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX))
  288. #define WS_EX_FLOATING (WS_EX_PALETTEWINDOW | WS_EX_WINDOWEDGE)
  289. #define PARENT_FLOATING (HWND_DESKTOP)
  290. #if XXX_BROWSEROWNED
  291. #define WS_BBTMMOST WS_FLOATING
  292. #define WS_EX_BBTMMOST (WS_EX_FLOATING|WS_EX_TOOLWINDOW)
  293. #define PARENT_BBTMMOST PARENT_FLOATING
  294. #else
  295. // non-topmost
  296. #define WS_BBTMMOST (WS_CHILD/*|WS_BORDER|WS_THICKFRAME*/|WS_CLIPSIBLINGS | WS_CLIPCHILDREN)
  297. #define WS_EX_BBTMMOST (WS_EX_CLIENTEDGE /*|WS_EX_WINDOWEDGE*/)
  298. #define PARENT_BBTMMOST() (_hwndSite)
  299. #endif
  300. #define ISWSX_EDGELESS(ws, wsx) \
  301. (!(((ws)&WS_THICKFRAME) || ((wsx)&WS_EX_WINDOWEDGE)))
  302. #define ISWBM_EDGELESS(eMode) \
  303. ((eMode==WBM_BBOTTOMMOST && ISWSX_EDGELESS(WS_BBTMMOST, WS_EX_BBTMMOST)) \
  304. || (eMode==WBM_BOTTOMMOST && ISWSX_EDGELESS(WS_BTMMOST, WS_EX_BTMMOST)))
  305. #define XY_NIL ((LPARAM) (-1))
  306. // drag state
  307. #define DRAG_NIL 0 // nil
  308. #define DRAG_MOVE 1 // moving
  309. #define DRAG_SIZE 2 // sizing
  310. extern void DBC_ExecDrag(IUnknown *pDbc, int eDragging);
  311. #define WBMF_BROWSER (0x0001000) // hosted by browser (vs. by desktop)
  312. #define WBM_BBOTTOMMOST (WBMF_BROWSER|WBM_BOTTOMMOST)
  313. //#define WBM_BTOPMOST (WBMF_BROWSER|WBM_TOPMOST)
  314. #define WBM_BFLOATING (WBMF_BROWSER|WBM_FLOATING)
  315. #define WBM_BNIL *** error! ***
  316. //*** ISWBM_* -- check mode
  317. #define ISWBM_FLOAT(eMode) \
  318. (eMode & WBM_FLOATING)
  319. #define ISWBM_BOTTOM(eMode) \
  320. ((eMode) == WBM_BOTTOMMOST || (eMode) == WBM_BBOTTOMMOST)
  321. #if XXX_CHEEDESK
  322. #define ISWBM_DESKTOP() (!(_eMode & WBMF_BROWSER))
  323. #else
  324. #define ISWBM_DESKTOP() (_fDesktop)
  325. #endif
  326. #if XXX_BROWSEROWNED
  327. #define ISWBM_OWNED(eMode) ((!ISWBM_DESKTOP()) && \
  328. ((eMode) == WBM_BFLOATING || (eMode) == WBM_BBOTTOMMOST))
  329. #else
  330. #define ISWBM_OWNED(eMode) ((eMode) == WBM_BFLOATING)
  331. #endif
  332. #if XXX_HIDE
  333. #if XXX_HIDEALL
  334. #define ISWBM_HIDEABLE(eMode) (((eMode) & ~WBMF_BROWSER) != WBM_FLOATING)
  335. #else
  336. #define ISWBM_HIDEABLE(eMode) ((eMode) == WBM_TOPMOST)
  337. #endif
  338. #endif
  339. #define CHKWBM_CHANGE(eModeNew, eModeCur) \
  340. (((eModeNew) & WBMF_BROWSER) == ((eModeCur) & WBMF_BROWSER) \
  341. || (eModeNew) == WBM_NIL || (eModeCur) == WBM_NIL)
  342. //*** timer stuff
  343. #define IDT_POPUI 10
  344. #define IDT_AUTOHIDE 11
  345. #define IDT_AUTOUNHIDE 12
  346. #define DLY_AUTOHIDE 500
  347. #define DLY_AUTOUNHIDE 50
  348. //*** hide state (_fHiding)
  349. #define HIDE_FALSE 0 // must be FALSE
  350. #define HIDE_AUTO 1 // currently hidden (due to autohide)
  351. #define HIDE_MANUAL 2 // currently hidden (due to manual hide)
  352. CASSERT(! HIDE_FALSE);
  353. #if 0
  354. //*** MKMS, MSTO* -- make/crack combined mode+side
  355. //
  356. #define MSTOMODE(ms) (((UINT) (ms)) >> 8)
  357. #define MSTOSIDE(ms) (((UINT) (ms)) & 0x7)
  358. #define MKMS(m, s) ((((UINT) (m)) << 8) | (UINT) (s))
  359. #endif
  360. #if WEBBAR_APP
  361. HMENU LoadMenuPopup(UINT id);
  362. extern HINSTANCE g_hinst;
  363. #define HINST_THISDLL g_hinst
  364. #endif
  365. // REARCHITECT we can replace these once the portability layer is up and running.
  366. #define Command_GetNotifyCode(wp,lp) HIWORD(wp)
  367. #define Command_GetHwndCtl(lp) ((HWND)lp)
  368. #define Command_GetID(wp) LOWORD(wp)
  369. CASSERT((ABE_LEFT|ABE_RIGHT|ABE_TOP|ABE_BOTTOM) == 3); // must fit in _uSide:2
  370. //*** MoveRect -- move left-top corner of rect to (x,y)
  371. //
  372. #define MoveRect(prc, x, y) \
  373. OffsetRect((prc), (x) - (prc)->left, (y) - (prc)->top)
  374. #define AB_THEIGHT(rc) (RECTHEIGHT(rc) * 10 / 100) // 10%
  375. #define AB_BHEIGHT(rc) (RECTHEIGHT(rc) * 10 / 100) // 10%
  376. #define AB_LWIDTH(rc) (40) // fixed width 40
  377. #define AB_RWIDTH(rc) ( RECTWIDTH(rc) * 35 / 100) // 30%
  378. void SlideWindow(HWND hwnd, RECT *prc, HMONITOR hMonClip, BOOL fShow);
  379. class PropDataSet {
  380. public:
  381. BOOL _fSet;
  382. DWORD _dwData;
  383. };
  384. class CDockingBarPropertyBag :
  385. public IPropertyBag
  386. , public IDockingBarPropertyBagInit
  387. {
  388. public:
  389. // *** IUnknown ***
  390. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  391. virtual STDMETHODIMP_(ULONG) AddRef(void) ;
  392. virtual STDMETHODIMP_(ULONG) Release(void);
  393. // *** IPropertyBag ***
  394. virtual HRESULT STDMETHODCALLTYPE Read(
  395. /* [in] */ LPCOLESTR pszPropName,
  396. /* [out][in] */ VARIANT *pVar,
  397. /* [in] */ IErrorLog *pErrorLog);
  398. virtual HRESULT STDMETHODCALLTYPE Write(
  399. /* [in] */ LPCOLESTR pszPropName,
  400. /* [in] */ VARIANT *pVar) {return E_NOTIMPL;};
  401. // *** IDockingBarPropertyBagInit
  402. virtual STDMETHODIMP SetDataDWORD(ENUMPROPDATA e, DWORD dwData) { _props[e]._fSet = TRUE; _props[e]._dwData = dwData; return S_OK; }
  403. protected:
  404. CDockingBarPropertyBag() { _cRef = 1; };
  405. friend HRESULT CDockingBarPropertyBag_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  406. UINT _cRef;
  407. PropDataSet _props[PROPDATA_COUNT];
  408. };
  409. #endif