| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef __PLATFORM_WINDOW_MANAGER_UTIL_H__ | 5 #ifndef WINDOW_MANAGER_UTIL_H_ |
| 6 #define __PLATFORM_WINDOW_MANAGER_UTIL_H__ | 6 #define WINDOW_MANAGER_UTIL_H_ |
| 7 | 7 |
| 8 #include <ctime> | 8 #include <ctime> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <sys/time.h> | 11 #include <sys/time.h> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 | 16 |
| 17 typedef unsigned int uint; | 17 typedef unsigned int uint; |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace window_manager { |
| 20 | 20 |
| 21 // Stacker maintains an ordering of objects (e.g. windows) in which changes | 21 // Stacker maintains an ordering of objects (e.g. windows) in which changes |
| 22 // can be made in faster-than-linear time. | 22 // can be made in faster-than-linear time. |
| 23 template<class T> | 23 template<class T> |
| 24 class Stacker { | 24 class Stacker { |
| 25 public: | 25 public: |
| 26 Stacker() {} | 26 Stacker() {} |
| 27 | 27 |
| 28 // Get the (top-to-bottom) ordered list of items. | 28 // Get the (top-to-bottom) ordered list of items. |
| 29 const std::list<T>& items() const { return items_; } | 29 const std::list<T>& items() const { return items_; } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 // Fill 'tv' with the time from 'time'. | 196 // Fill 'tv' with the time from 'time'. |
| 197 void FillTimeval(double time, struct timeval* tv); | 197 void FillTimeval(double time, struct timeval* tv); |
| 198 | 198 |
| 199 | 199 |
| 200 // Helper method to convert an XID into a hex string. | 200 // Helper method to convert an XID into a hex string. |
| 201 static std::string XidStr(unsigned long xid) { | 201 static std::string XidStr(unsigned long xid) { |
| 202 return StringPrintf("0x%lx", xid); | 202 return StringPrintf("0x%lx", xid); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace chromeos | 205 } // namespace window_manager |
| 206 | 206 |
| 207 #endif // __UTIL_H__ | 207 #endif |
| OLD | NEW |