Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: ui/gfx/screen_gtk.cc

Issue 10389109: Add gfx::Screen::IsEnabled() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Decided that the original approach with gfx::Sceren::IsDIPEnabled is better than the ifdef Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/screen_aura.cc ('k') | ui/gfx/screen_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/screen_aura.cc ('k') | ui/gfx/screen_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698