OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 UI_AURA_WINDOW_PROPERTY_H_ | 5 #ifndef UI_AURA_WINDOW_PROPERTY_H_ |
6 #define UI_AURA_WINDOW_PROPERTY_H_ | 6 #define UI_AURA_WINDOW_PROPERTY_H_ |
7 | 7 |
8 #include "ui/aura/aura_export.h" | 8 #include "ui/aura/aura_export.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 // // Use this to define an exported property that is premitive, | 21 // // Use this to define an exported property that is premitive, |
22 // // or a pointer you don't want automatically deleted. | 22 // // or a pointer you don't want automatically deleted. |
23 // DEFINE_WINDOW_PROPERTY_KEY(MyType, kMyKey, MyDefault); | 23 // DEFINE_WINDOW_PROPERTY_KEY(MyType, kMyKey, MyDefault); |
24 // | 24 // |
25 // // Use this to define an exported property whose value is a heap | 25 // // Use this to define an exported property whose value is a heap |
26 // // allocated object, and has to be owned and freed by the window. | 26 // // allocated object, and has to be owned and freed by the window. |
27 // DEFINE_OWNED_WINDOW_PROPERTY_KEY(gfx::Rect, kRestoreBoundsKey, NULL); | 27 // DEFINE_OWNED_WINDOW_PROPERTY_KEY(gfx::Rect, kRestoreBoundsKey, NULL); |
28 // | 28 // |
29 // // Use this to define a non exported property that is primitive, | 29 // // Use this to define a non exported property that is primitive, |
30 // // or a pointer you don't want to automatically deleted, and is used | 30 // // or a pointer you don't want to automatically deleted, and is used |
31 // // only in a specific file. This will define the property in anonymous | 31 // // only in a specific file. This will define the property in unnamed |
sky
2012/07/23 15:52:13
an unnamed
| |
32 // // namespace which cannot be accessed from another file. | 32 // // namespace which cannot be accessed from another file. |
33 // DEFINE_LOCAL_WINDOW_PROPERTY_KEY(MyType, kMyKey, MyDefault); | 33 // DEFINE_LOCAL_WINDOW_PROPERTY_KEY(MyType, kMyKey, MyDefault); |
34 // | 34 // |
35 // } // foo namespace | 35 // } // foo namespace |
36 // | 36 // |
37 // To define a new type used for WindowProperty. | 37 // To define a new type used for WindowProperty. |
38 // | 38 // |
39 // // outside all namespaces: | 39 // // outside all namespaces: |
40 // DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(FOO_EXPORT, MyType) | 40 // DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(FOO_EXPORT, MyType) |
41 // | 41 // |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 void Deallocator ## NAME (intptr_t p) { \ | 132 void Deallocator ## NAME (intptr_t p) { \ |
133 enum { type_must_be_complete = sizeof(TYPE) }; \ | 133 enum { type_must_be_complete = sizeof(TYPE) }; \ |
134 delete aura::WindowPropertyCaster<TYPE*>::FromIntptrT(p); \ | 134 delete aura::WindowPropertyCaster<TYPE*>::FromIntptrT(p); \ |
135 } \ | 135 } \ |
136 const aura::WindowProperty<TYPE*> NAME ## _Value = \ | 136 const aura::WindowProperty<TYPE*> NAME ## _Value = \ |
137 {DEFAULT,#NAME,&Deallocator ## NAME}; \ | 137 {DEFAULT,#NAME,&Deallocator ## NAME}; \ |
138 } \ | 138 } \ |
139 const aura::WindowProperty<TYPE*>* const NAME = & NAME ## _Value; | 139 const aura::WindowProperty<TYPE*>* const NAME = & NAME ## _Value; |
140 | 140 |
141 #endif // UI_AURA_WINDOW_PROPERTY_H_ | 141 #endif // UI_AURA_WINDOW_PROPERTY_H_ |
OLD | NEW |