BidiRun.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  3. * (C) 1999 Antti Koivisto (koivisto@kde.org)
  4. * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
  5. * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public License
  18. * along with this library; see the file COPYING.LIB. If not, write to
  19. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. *
  22. */
  23. #ifndef BidiRun_h
  24. #define BidiRun_h
  25. #include <wtf/StdLibExtras.h>
  26. #include "BidiResolver.h"
  27. #include "RenderText.h"
  28. namespace WebCore {
  29. class BidiContext;
  30. class InlineBox;
  31. struct BidiRun : BidiCharacterRun {
  32. BidiRun(int start, int stop, RenderObject* object, BidiContext* context, WTF::Unicode::Direction dir)
  33. : BidiCharacterRun(start, stop, context, dir)
  34. , m_object(object)
  35. , m_box(0)
  36. {
  37. ASSERT(!object->isText() || static_cast<unsigned>(stop) <= toRenderText(object)->textLength());
  38. // Stored in base class to save space.
  39. m_hasHyphen = false;
  40. #if ENABLE(CSS_SHAPES)
  41. m_startsSegment = false;
  42. #endif
  43. }
  44. void destroy();
  45. // Overloaded new operator.
  46. void* operator new(size_t, RenderArena*);
  47. // Overridden to prevent the normal delete from being called.
  48. void operator delete(void*, size_t);
  49. BidiRun* next() { return static_cast<BidiRun*>(m_next); }
  50. RenderObject* object() { return m_object; }
  51. private:
  52. // The normal operator new is disallowed.
  53. void* operator new(size_t) throw();
  54. public:
  55. RenderObject* m_object;
  56. InlineBox* m_box;
  57. };
  58. }
  59. #endif // BidiRun_h