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.

81 lines
2.0 KiB

  1. //------------------------------------------------------------------------------
  2. // zorder.h
  3. // Copyright (c)1997-1999 Microsoft Corporation, All Rights Reserved
  4. //
  5. // Author
  6. // ThomasOl
  7. //
  8. // History
  9. // 8-15-97 created (ThomasOl)
  10. //
  11. //
  12. //------------------------------------------------------------------------------
  13. #ifndef __ZORDER_H__
  14. #define __ZORDER_H__
  15. enum ZIndexMode
  16. {
  17. SEND_BACKWARD,
  18. SEND_FORWARD,
  19. SEND_TO_BACK,
  20. SEND_TO_FRONT,
  21. SEND_BEHIND_1D,
  22. SEND_FRONT_1D,
  23. MADE_ABSOLUTE // we pass this mode when calling AssignZIndex during the process of making
  24. }; // 2D elements.
  25. #define ZINDEX_BASE 100
  26. class CZOrder
  27. {
  28. public:
  29. IHTMLElement* m_pihtmlElement;
  30. LONG m_zOrder;
  31. CZOrder() : m_pihtmlElement(0), m_zOrder(0)
  32. {}
  33. CZOrder(IHTMLElement* pihtmlElement, LONG zOrder)
  34. {
  35. m_pihtmlElement = pihtmlElement;
  36. _ASSERTE(m_pihtmlElement);
  37. if (m_pihtmlElement)
  38. m_pihtmlElement->AddRef();
  39. m_zOrder = zOrder;
  40. }
  41. virtual ~CZOrder()
  42. {
  43. SAFERELEASE(m_pihtmlElement);
  44. }
  45. int operator==(const CZOrder& node) const
  46. {
  47. return (m_zOrder == node.m_zOrder);
  48. }
  49. int operator<(const CZOrder& node) const
  50. {
  51. return (m_zOrder < node.m_zOrder);
  52. }
  53. int operator>(const CZOrder& node) const
  54. {
  55. return (m_zOrder > node.m_zOrder);
  56. }
  57. int operator>=(const CZOrder& node) const
  58. {
  59. return (m_zOrder >= node.m_zOrder);
  60. }
  61. int operator<=(const CZOrder& node) const
  62. {
  63. return (m_zOrder <= node.m_zOrder);
  64. }
  65. CZOrder& operator=(const CZOrder& node)
  66. {
  67. m_pihtmlElement = node.m_pihtmlElement;
  68. _ASSERTE(m_pihtmlElement);
  69. if (m_pihtmlElement)
  70. m_pihtmlElement->AddRef();
  71. m_zOrder = node.m_zOrder;
  72. return *this;
  73. }
  74. };
  75. #endif //__ZORDER_H__