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_BASE_GTK_SCOPED_REGION_H_ | 5 #ifndef UI_BASE_GTK_SCOPED_REGION_H_ |
6 #define UI_BASE_GTK_SCOPED_REGION_H_ | 6 #define UI_BASE_GTK_SCOPED_REGION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/base/ui_export.h" | 9 #include "ui/base/ui_base_export.h" |
10 | 10 |
11 typedef struct _GdkRegion GdkRegion; | 11 typedef struct _GdkRegion GdkRegion; |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 // Wraps a GdkRegion. This class provides the same methods as ScopedGDIObject in | 15 // Wraps a GdkRegion. This class provides the same methods as ScopedGDIObject in |
16 // base/win/scoped_gdi_object.h. | 16 // base/win/scoped_gdi_object.h. |
17 class UI_EXPORT ScopedRegion { | 17 class UI_BASE_EXPORT ScopedRegion { |
18 public: | 18 public: |
19 ScopedRegion(); | 19 ScopedRegion(); |
20 explicit ScopedRegion(GdkRegion* region); | 20 explicit ScopedRegion(GdkRegion* region); |
21 | 21 |
22 ~ScopedRegion(); | 22 ~ScopedRegion(); |
23 | 23 |
24 void Set(GdkRegion* region); | 24 void Set(GdkRegion* region); |
25 | 25 |
26 GdkRegion* Get(); | 26 GdkRegion* Get(); |
27 | 27 |
28 GdkRegion* release(); | 28 GdkRegion* release(); |
29 | 29 |
30 private: | 30 private: |
31 void Close(); | 31 void Close(); |
32 | 32 |
33 GdkRegion* region_; | 33 GdkRegion* region_; |
34 | 34 |
35 DISALLOW_COPY_AND_ASSIGN(ScopedRegion); | 35 DISALLOW_COPY_AND_ASSIGN(ScopedRegion); |
36 }; | 36 }; |
37 | 37 |
38 } // namespace ui | 38 } // namespace ui |
39 | 39 |
40 #endif // UI_BASE_GTK_SCOPED_REGION_H_ | 40 #endif // UI_BASE_GTK_SCOPED_REGION_H_ |
OLD | NEW |