]>
git.saurik.com Git - iphone-api.git/blob - WebCore/BidiContext.h
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007 Apple Inc. All right reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
25 #include <wtf/Assertions.h>
26 #include <wtf/RefPtr.h>
27 #include <wtf/unicode/Unicode.h>
31 // Used to keep track of explicit embeddings.
34 BidiContext(unsigned char level
, WTF::Unicode::Direction direction
, bool override
= false, BidiContext
* parent
= 0)
36 , m_direction(direction
)
37 , m_override(override
)
41 ASSERT(direction
== WTF::Unicode::LeftToRight
|| direction
== WTF::Unicode::RightToLeft
);
44 void ref() const { m_refCount
++; }
52 BidiContext
* parent() const { return m_parent
.get(); }
53 unsigned char level() const { return m_level
; }
54 WTF::Unicode::Direction
dir() const { return static_cast<WTF::Unicode::Direction
>(m_direction
); }
55 bool override() const { return m_override
; }
58 unsigned char m_level
;
59 unsigned m_direction
: 5; // Direction
61 RefPtr
<BidiContext
> m_parent
;
62 mutable int m_refCount
;
65 bool operator==(const BidiContext
&, const BidiContext
&);
67 } // namespace WebCore
69 #endif // BidiContext_h