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

Side by Side Diff: ui/base/x/x11_util.h

Issue 6359008: Do not show notifications when in fullscreen or screensaver mode.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_X_X11_UTIL_H_ 5 #ifndef UI_BASE_X_X11_UTIL_H_
6 #define UI_BASE_X_X11_UTIL_H_ 6 #define UI_BASE_X_X11_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 // This file declares utility functions for X11 (Linux only). 9 // This file declares utility functions for X11 (Linux only).
10 // 10 //
11 // These functions do not require the Xlib headers to be included (which is why 11 // These functions do not require the Xlib headers to be included (which is why
12 // we use a void* for Visual*). The Xlib headers are highly polluting so we try 12 // we use a void* for Visual*). The Xlib headers are highly polluting so we try
13 // hard to limit their spread into the rest of the code. 13 // hard to limit their spread into the rest of the code.
14 14
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 17
18 #include "base/basictypes.h" 18 #include "base/basictypes.h"
19 19
20 typedef unsigned long Atom;
20 typedef struct _GdkDrawable GdkWindow; 21 typedef struct _GdkDrawable GdkWindow;
21 typedef struct _GtkWidget GtkWidget; 22 typedef struct _GtkWidget GtkWidget;
22 typedef struct _GtkWindow GtkWindow; 23 typedef struct _GtkWindow GtkWindow;
23 typedef unsigned long XID; 24 typedef unsigned long XID;
24 typedef unsigned long XSharedMemoryId; // ShmSeg in the X headers. 25 typedef unsigned long XSharedMemoryId; // ShmSeg in the X headers.
25 typedef struct _XDisplay Display; 26 typedef struct _XDisplay Display;
26 27
27 namespace gfx { 28 namespace gfx {
28 class Rect; 29 class Rect;
29 } 30 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 XID GetX11WindowFromGdkWindow(GdkWindow* window); 70 XID GetX11WindowFromGdkWindow(GdkWindow* window);
70 // Get a Visual from the given widget. Since we don't include the Xlib 71 // Get a Visual from the given widget. Since we don't include the Xlib
71 // headers, this is returned as a void*. 72 // headers, this is returned as a void*.
72 void* GetVisualFromGtkWidget(GtkWidget* widget); 73 void* GetVisualFromGtkWidget(GtkWidget* widget);
73 // Return the number of bits-per-pixel for a pixmap of the given depth 74 // Return the number of bits-per-pixel for a pixmap of the given depth
74 int BitsPerPixelForPixmapDepth(Display* display, int depth); 75 int BitsPerPixelForPixmapDepth(Display* display, int depth);
75 // Returns true if |window| is visible. 76 // Returns true if |window| is visible.
76 bool IsWindowVisible(XID window); 77 bool IsWindowVisible(XID window);
77 // Returns the bounds of |window|. 78 // Returns the bounds of |window|.
78 bool GetWindowRect(XID window, gfx::Rect* rect); 79 bool GetWindowRect(XID window, gfx::Rect* rect);
79 // Get the value of an int, int array, or string property. On 80 // Return true if |window| has any property with |property_name|.
81 bool ExistsProperty(XID window, const std::string& property_name);
Daniel Erat 2011/01/21 01:28:17 nit: "PropertyExists"
jianli 2011/01/21 20:21:00 Done.
82 // Get the value of an int, int array, atom array or string property. On
80 // success, true is returned and the value is stored in |value|. 83 // success, true is returned and the value is stored in |value|.
81 bool GetIntProperty(XID window, const std::string& property_name, int* value); 84 bool GetIntProperty(XID window, const std::string& property_name, int* value);
82 bool GetIntArrayProperty(XID window, const std::string& property_name, 85 bool GetIntArrayProperty(XID window, const std::string& property_name,
83 std::vector<int>* value); 86 std::vector<int>* value);
87 bool GetAtomArrayProperty(XID window, const std::string& property_name,
88 std::vector<Atom>* value);
84 bool GetStringProperty( 89 bool GetStringProperty(
85 XID window, const std::string& property_name, std::string* value); 90 XID window, const std::string& property_name, std::string* value);
86 91
87 // Get |window|'s parent window, or None if |window| is the root window. 92 // Get |window|'s parent window, or None if |window| is the root window.
88 XID GetParentWindow(XID window); 93 XID GetParentWindow(XID window);
89 94
90 // Walk up |window|'s hierarchy until we find a direct child of |root|. 95 // Walk up |window|'s hierarchy until we find a direct child of |root|.
91 XID GetHighestAncestorWindow(XID window, XID root); 96 XID GetHighestAncestorWindow(XID window, XID root);
92 97
93 static const int kAllDesktops = -1; 98 static const int kAllDesktops = -1;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 bool ChangeWindowDesktop(XID window, XID destination); 179 bool ChangeWindowDesktop(XID window, XID destination);
175 180
176 // Enable the default X error handlers. These will log the error and abort 181 // Enable the default X error handlers. These will log the error and abort
177 // the process if called. Use SetX11ErrorHandlers() from x11_util_internal.h 182 // the process if called. Use SetX11ErrorHandlers() from x11_util_internal.h
178 // to set your own error handlers. 183 // to set your own error handlers.
179 void SetDefaultX11ErrorHandlers(); 184 void SetDefaultX11ErrorHandlers();
180 185
181 } // namespace ui 186 } // namespace ui
182 187
183 #endif // UI_BASE_X_X11_UTIL_H_ 188 #endif // UI_BASE_X_X11_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698