/work/obj-fuzz/dist/include/nsFrameState.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | /* constants for frame state bits and a type to store them in a uint64_t */ |
8 | | |
9 | | #ifndef nsFrameState_h_ |
10 | | #define nsFrameState_h_ |
11 | | |
12 | | #include <stdint.h> |
13 | | |
14 | | #ifdef DEBUG |
15 | | #include "nsString.h" |
16 | | |
17 | | class nsIFrame; |
18 | | #endif |
19 | | |
20 | | typedef uint64_t nsFrameState_size_t; |
21 | | |
22 | | #define NS_FRAME_STATE_BIT(n_) (nsFrameState(nsFrameState_size_t(1) << (n_))) |
23 | | |
24 | | enum nsFrameState : nsFrameState_size_t { |
25 | | #define FRAME_STATE_BIT(group_, value_, name_) \ |
26 | | name_ = NS_FRAME_STATE_BIT(value_), |
27 | | #include "nsFrameStateBits.h" |
28 | | #undef FRAME_STATE_BIT |
29 | | }; |
30 | | |
31 | | inline nsFrameState operator|(nsFrameState aLeft, nsFrameState aRight) |
32 | | { |
33 | | return nsFrameState(nsFrameState_size_t(aLeft) | nsFrameState_size_t(aRight)); |
34 | | } |
35 | | |
36 | | inline nsFrameState operator&(nsFrameState aLeft, nsFrameState aRight) |
37 | | { |
38 | | return nsFrameState(nsFrameState_size_t(aLeft) & nsFrameState_size_t(aRight)); |
39 | | } |
40 | | |
41 | | inline nsFrameState& operator|=(nsFrameState& aLeft, nsFrameState aRight) |
42 | | { |
43 | | aLeft = aLeft | aRight; |
44 | | return aLeft; |
45 | | } |
46 | | |
47 | | inline nsFrameState& operator&=(nsFrameState& aLeft, nsFrameState aRight) |
48 | | { |
49 | | aLeft = aLeft & aRight; |
50 | | return aLeft; |
51 | | } |
52 | | |
53 | | inline nsFrameState operator~(nsFrameState aRight) |
54 | | { |
55 | | return nsFrameState(~nsFrameState_size_t(aRight)); |
56 | | } |
57 | | |
58 | | inline nsFrameState operator^(nsFrameState aLeft, nsFrameState aRight) |
59 | 0 | { |
60 | 0 | return nsFrameState(nsFrameState_size_t(aLeft) ^ nsFrameState_size_t(aRight)); |
61 | 0 | } |
62 | | |
63 | | inline nsFrameState& operator^=(nsFrameState& aLeft, nsFrameState aRight) |
64 | 0 | { |
65 | 0 | aLeft = aLeft ^ aRight; |
66 | 0 | return aLeft; |
67 | 0 | } |
68 | | |
69 | | // Bits 20-31 and 60-63 of the frame state are reserved for implementations. |
70 | | #define NS_FRAME_IMPL_RESERVED nsFrameState(0xF0000000FFF00000) |
71 | | #define NS_FRAME_RESERVED ~NS_FRAME_IMPL_RESERVED |
72 | | |
73 | | namespace mozilla { |
74 | | #ifdef DEBUG |
75 | | nsCString GetFrameState(nsIFrame* aFrame); |
76 | | void PrintFrameState(nsIFrame* aFrame); |
77 | | #endif |
78 | | } // namespace mozilla |
79 | | |
80 | | #endif /* nsFrameState_h_ */ |