| 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 |
| 79 gfx::Point Screen::GetCursorScreenPoint() { | 84 gfx::Point Screen::GetCursorScreenPoint() { |
| 80 gint x, y; | 85 gint x, y; |
| 81 gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL); | 86 gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL); |
| 82 return gfx::Point(x, y); | 87 return gfx::Point(x, y); |
| 83 } | 88 } |
| 84 | 89 |
| 85 // static | 90 // static |
| 86 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { | 91 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { |
| 87 GdkWindow* window = gdk_window_at_pointer(NULL, NULL); | 92 GdkWindow* window = gdk_window_at_pointer(NULL, NULL); |
| 88 if (!window) | 93 if (!window) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 151 |
| 147 // static | 152 // static |
| 148 int Screen::GetNumMonitors() { | 153 int Screen::GetNumMonitors() { |
| 149 // This query is kinda bogus for Linux -- do we want number of X screens? | 154 // This query is kinda bogus for Linux -- do we want number of X screens? |
| 150 // The number of monitors Xinerama has? We'll just use whatever GDK uses. | 155 // The number of monitors Xinerama has? We'll just use whatever GDK uses. |
| 151 GdkScreen* screen = gdk_screen_get_default(); | 156 GdkScreen* screen = gdk_screen_get_default(); |
| 152 return gdk_screen_get_n_monitors(screen); | 157 return gdk_screen_get_n_monitors(screen); |
| 153 } | 158 } |
| 154 | 159 |
| 155 } // namespace gfx | 160 } // namespace gfx |
| OLD | NEW |