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 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, bool pack_at_end, | 81 void CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, bool pack_at_end, |
82 int padding); | 82 int padding); |
83 | 83 |
84 // Change windows accelerator style to GTK style. (GTK uses _ for | 84 // Change windows accelerator style to GTK style. (GTK uses _ for |
85 // accelerators. Windows uses & with && as an escape for &.) | 85 // accelerators. Windows uses & with && as an escape for &.) |
86 std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label); | 86 std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label); |
87 | 87 |
88 // Returns true if the screen is composited, false otherwise. | 88 // Returns true if the screen is composited, false otherwise. |
89 bool IsScreenComposited(); | 89 bool IsScreenComposited(); |
90 | 90 |
91 // Implementers of this interface receive a notification for every top-level | |
92 // gdk window of the current display. | |
93 class EnumerateWindowsDelegate { | |
94 public: | |
95 // |xid| is the X Window ID of the enumerated window. Return true to stop | |
96 // further iteration. | |
97 virtual bool ShouldStopIterating(XID xid) = 0; | |
98 }; | |
99 | |
100 // Enumerates the top-level gdk windows of the current display. | 91 // Enumerates the top-level gdk windows of the current display. |
101 void EnumerateChildWindows(EnumerateWindowsDelegate* delegate); | 92 void EnumerateTopLevelWindows(x11_util::EnumerateWindowsDelegate* delegate); |
102 | 93 |
103 // Set that a button causes a page navigation. In particular, it will accept | 94 // Set that a button causes a page navigation. In particular, it will accept |
104 // middle clicks. Warning: only call this *after* you have connected your | 95 // middle clicks. Warning: only call this *after* you have connected your |
105 // own handlers for button-press and button-release events, or you will not get | 96 // own handlers for button-press and button-release events, or you will not get |
106 // those events. | 97 // those events. |
107 void SetButtonTriggersNavigation(GtkWidget* button); | 98 void SetButtonTriggersNavigation(GtkWidget* button); |
108 | 99 |
109 } // namespace gtk_util | 100 } // namespace gtk_util |
110 | 101 |
111 #endif // CHROME_COMMON_GTK_UTIL_H_ | 102 #endif // CHROME_COMMON_GTK_UTIL_H_ |
OLD | NEW |