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.

66 lines
1.9 KiB

  1. /*
  2. * FlowLayout
  3. */
  4. #ifndef DUI_LAYPUT_FLOWLAYOUT_H_INCLUDED
  5. #define DUI_LAYPUT_FLOWLAYOUT_H_INCLUDED
  6. #pragma once
  7. namespace DirectUI
  8. {
  9. // No layout positions
  10. struct LINE
  11. {
  12. UINT cx; // length of line
  13. UINT cy; // thickness of line
  14. UINT y; // pixel start of line (always 0 for first line)
  15. UINT cElements; // number of elements in line
  16. UINT* arxElement; // pixel start of elements in line (one less than cElements -- because first start is always 0)
  17. UINT iStart; // index of first element in line
  18. };
  19. ////////////////////////////////////////////////////////
  20. // flow layout
  21. class FlowLayout : public Layout
  22. {
  23. public:
  24. static HRESULT Create(int dNumParams, int* pParams, OUT Value** ppValue); // For parser
  25. static HRESULT Create(bool fWrap, UINT uYAlign, UINT uXLineAlign, UINT uYLineAlign, OUT Layout** ppLayout);
  26. // Layout callbacks
  27. virtual void DoLayout(Element* pec, int dWidth, int dHeight);
  28. virtual SIZE UpdateDesiredSize(Element* pec, int dConstW, int dConstH, Surface* psrf);
  29. virtual Element* GetAdjacent(Element* pec, Element* peFrom, int iNavDir, NavReference const* pnr, bool fKeyableOnly);
  30. int GetLine(Element* pec, Element* pe);
  31. FlowLayout() { }
  32. void Initialize(bool fWrap, UINT uYAlign, UINT uXLineAlign, UINT uYLineAlign);
  33. virtual ~FlowLayout();
  34. protected:
  35. SIZE BuildCacheInfo(Element* pec, int cxConstraint, int cyConstraint, Surface* psrf, bool fRealSize);
  36. bool _fWrap;
  37. UINT _uXLineAlign;
  38. UINT _uYLineAlign;
  39. UINT _uYAlign;
  40. SIZE _sizeDesired;
  41. SIZE _sizeLastConstraint;
  42. UINT _cLines;
  43. LINE* _arLines;
  44. static SIZE g_sizeZero;
  45. // not sure we need to have these -- check i18n dir & dir override flags to see if they're enough
  46. // bool _bBtoT;
  47. // bool _bRtoL;
  48. };
  49. } // namespace DirectUI
  50. #endif // DUI_LAYPUT_FLOWLAYOUT_H_INCLUDED