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 #include "ui/gfx/screen.h" | 5 #include "ui/gfx/screen.h" |
6 | 6 |
7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 GdkRectangle bounds; | 69 GdkRectangle bounds; |
70 gdk_screen_get_monitor_geometry(screen, monitor_num, &bounds); | 70 gdk_screen_get_monitor_geometry(screen, monitor_num, &bounds); |
71 return gfx::Rect(bounds); | 71 return gfx::Rect(bounds); |
72 } | 72 } |
73 | 73 |
74 } // namespace | 74 } // namespace |
75 | 75 |
76 namespace gfx { | 76 namespace gfx { |
77 | 77 |
78 // static | 78 // static |
79 bool Screen::IsDIPEnabled() { | |
80 return false; | |
81 } | |
82 | |
83 // static | |
84 gfx::Point Screen::GetCursorScreenPoint() { | 79 gfx::Point Screen::GetCursorScreenPoint() { |
85 gint x, y; | 80 gint x, y; |
86 gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL); | 81 gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL); |
87 return gfx::Point(x, y); | 82 return gfx::Point(x, y); |
88 } | 83 } |
89 | 84 |
90 // static | 85 // static |
91 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { | 86 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { |
92 GdkWindow* window = gdk_window_at_pointer(NULL, NULL); | 87 GdkWindow* window = gdk_window_at_pointer(NULL, NULL); |
93 if (!window) | 88 if (!window) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 146 |
152 // static | 147 // static |
153 int Screen::GetNumMonitors() { | 148 int Screen::GetNumMonitors() { |
154 // This query is kinda bogus for Linux -- do we want number of X screens? | 149 // This query is kinda bogus for Linux -- do we want number of X screens? |
155 // The number of monitors Xinerama has? We'll just use whatever GDK uses. | 150 // The number of monitors Xinerama has? We'll just use whatever GDK uses. |
156 GdkScreen* screen = gdk_screen_get_default(); | 151 GdkScreen* screen = gdk_screen_get_default(); |
157 return gdk_screen_get_n_monitors(screen); | 152 return gdk_screen_get_n_monitors(screen); |
158 } | 153 } |
159 | 154 |
160 } // namespace gfx | 155 } // namespace gfx |
OLD | NEW |