OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 22 matching lines...) Loading... |
33 #if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) | 33 #if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) |
34 typedef Window WindowT; | 34 typedef Window WindowT; |
35 #elif defined(WEBRTC_WIN) | 35 #elif defined(WEBRTC_WIN) |
36 typedef HWND WindowT; | 36 typedef HWND WindowT; |
37 #elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | 37 #elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) |
38 typedef CGWindowID WindowT; | 38 typedef CGWindowID WindowT; |
39 #else | 39 #else |
40 typedef unsigned int WindowT; | 40 typedef unsigned int WindowT; |
41 #endif | 41 #endif |
42 | 42 |
43 static WindowId Cast(uint64 id) { | 43 static WindowId Cast(uint64_t id) { |
44 #if defined(WEBRTC_WIN) | 44 #if defined(WEBRTC_WIN) |
45 return WindowId(reinterpret_cast<WindowId::WindowT>(id)); | 45 return WindowId(reinterpret_cast<WindowId::WindowT>(id)); |
46 #else | 46 #else |
47 return WindowId(static_cast<WindowId::WindowT>(id)); | 47 return WindowId(static_cast<WindowId::WindowT>(id)); |
48 #endif | 48 #endif |
49 } | 49 } |
50 | 50 |
51 static uint64 Format(const WindowT& id) { | 51 static uint64_t Format(const WindowT& id) { |
52 #if defined(WEBRTC_WIN) | 52 #if defined(WEBRTC_WIN) |
53 return static_cast<uint64>(reinterpret_cast<uintptr_t>(id)); | 53 return static_cast<uint64_t>(reinterpret_cast<uintptr_t>(id)); |
54 #else | 54 #else |
55 return static_cast<uint64>(id); | 55 return static_cast<uint64_t>(id); |
56 #endif | 56 #endif |
57 } | 57 } |
58 | 58 |
59 WindowId() : id_(0) {} | 59 WindowId() : id_(0) {} |
60 WindowId(const WindowT& id) : id_(id) {} // NOLINT | 60 WindowId(const WindowT& id) : id_(id) {} // NOLINT |
61 const WindowT& id() const { return id_; } | 61 const WindowT& id() const { return id_; } |
62 bool IsValid() const { return id_ != 0; } | 62 bool IsValid() const { return id_ != 0; } |
63 bool Equals(const WindowId& other) const { | 63 bool Equals(const WindowId& other) const { |
64 return id_ == other.id(); | 64 return id_ == other.id(); |
65 } | 65 } |
(...skipping 50 matching lines...) Loading... |
116 WE_RESTORE = 3, | 116 WE_RESTORE = 3, |
117 }; | 117 }; |
118 | 118 |
119 inline std::string ToString(const WindowId& window) { | 119 inline std::string ToString(const WindowId& window) { |
120 return ToString(window.id()); | 120 return ToString(window.id()); |
121 } | 121 } |
122 | 122 |
123 } // namespace rtc | 123 } // namespace rtc |
124 | 124 |
125 #endif // WEBRTC_BASE_WINDOW_H_ | 125 #endif // WEBRTC_BASE_WINDOW_H_ |
OLD | NEW |