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_GTK_SCREEN_UTILS_H_ | 5 #ifndef UI_BASE_GTK_GTK_SCREEN_UTILS_H_ |
6 #define UI_BASE_GTK_GTK_SCREEN_UTILS_H_ | 6 #define UI_BASE_GTK_GTK_SCREEN_UTILS_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
11 #include "ui/gfx/point.h" | 11 #include "ui/gfx/point.h" |
12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 13 #include "ui/gfx/vector2d.h" |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
15 | 16 |
16 // Returns true if the screen is composited, false otherwise. | 17 // Returns true if the screen is composited, false otherwise. |
17 UI_EXPORT bool IsScreenComposited(); | 18 UI_EXPORT bool IsScreenComposited(); |
18 | 19 |
19 // Get the current location of the mouse cursor relative to the screen. | 20 // Get the current location of the mouse cursor relative to the screen. |
20 UI_EXPORT gfx::Point ScreenPoint(GtkWidget* widget); | 21 UI_EXPORT gfx::Point ScreenPoint(GtkWidget* widget); |
21 | 22 |
22 // Get the current location of the mouse cursor relative to the widget. | 23 // Get the current location of the mouse cursor relative to the widget. |
23 UI_EXPORT gfx::Point ClientPoint(GtkWidget* widget); | 24 UI_EXPORT gfx::Point ClientPoint(GtkWidget* widget); |
24 | 25 |
25 // Gets the position of a gtk widget in screen coordinates. | 26 // Gets the offset of a gtk widget from the origin in screen coordinates. |
26 UI_EXPORT gfx::Point GetWidgetScreenPosition(GtkWidget* widget); | 27 UI_EXPORT gfx::Vector2d GetWidgetScreenOffset(GtkWidget* widget); |
27 | 28 |
28 // Returns the bounds of the specified widget in screen coordinates. | 29 // Returns the bounds of the specified widget in screen coordinates. |
29 UI_EXPORT gfx::Rect GetWidgetScreenBounds(GtkWidget* widget); | 30 UI_EXPORT gfx::Rect GetWidgetScreenBounds(GtkWidget* widget); |
30 | 31 |
31 } // namespace ui | 32 } // namespace ui |
32 | 33 |
33 #endif // UI_BASE_GTK_GTK_SCREEN_UTILS_H_ | 34 #endif // UI_BASE_GTK_GTK_SCREEN_UTILS_H_ |
OLD | NEW |