OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_COMMON_GTK_UTIL_H_ | 5 #ifndef CHROME_COMMON_GTK_UTIL_H_ |
6 #define CHROME_COMMON_GTK_UTIL_H_ | 6 #define CHROME_COMMON_GTK_UTIL_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/gfx/point.h" | 11 #include "base/gfx/point.h" |
12 #include "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" |
| 13 #include "chrome/common/x11_util.h" |
13 #include "webkit/glue/window_open_disposition.h" | 14 #include "webkit/glue/window_open_disposition.h" |
14 | 15 |
15 typedef struct _GtkWidget GtkWidget; | 16 typedef struct _GtkWidget GtkWidget; |
16 | 17 |
17 namespace event_utils { | 18 namespace event_utils { |
18 | 19 |
19 // Translates event flags into what kind of disposition they represent. | 20 // Translates event flags into what kind of disposition they represent. |
20 // For example, a middle click would mean to open a background tab. | 21 // For example, a middle click would mean to open a background tab. |
21 // event_flags are the state in the GdkEvent structure. | 22 // event_flags are the state in the GdkEvent structure. |
22 WindowOpenDisposition DispositionFromEventFlags(guint state); | 23 WindowOpenDisposition DispositionFromEventFlags(guint state); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, bool pack_at_end, | 73 void CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, bool pack_at_end, |
73 int padding); | 74 int padding); |
74 | 75 |
75 // Change windows accelerator style to GTK style. (GTK uses _ for | 76 // Change windows accelerator style to GTK style. (GTK uses _ for |
76 // accelerators. Windows uses & with && as an escape for &.) | 77 // accelerators. Windows uses & with && as an escape for &.) |
77 std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label); | 78 std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label); |
78 | 79 |
79 // Returns true if the screen is composited, false otherwise. | 80 // Returns true if the screen is composited, false otherwise. |
80 bool IsScreenComposited(); | 81 bool IsScreenComposited(); |
81 | 82 |
| 83 // Implementers of this interface receive a notification for every top-level |
| 84 // gdk window of the current display. |
| 85 class EnumerateWindowsDelegate { |
| 86 public: |
| 87 // |xid| is the X Window ID of the enumerated window. Return true to stop |
| 88 // further iteration. |
| 89 virtual bool ShouldStopIterating(XID xid) = 0; |
| 90 }; |
| 91 |
| 92 // Enumerates the top-level gdk windows of the current display. |
| 93 void EnumerateChildWindows(EnumerateWindowsDelegate* delegate); |
| 94 |
82 } // namespace gtk_util | 95 } // namespace gtk_util |
83 | 96 |
84 #endif // CHROME_COMMON_GTK_UTIL_H_ | 97 #endif // CHROME_COMMON_GTK_UTIL_H_ |
OLD | NEW |