OLD | NEW |
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 CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ |
6 #define CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ | 6 #define CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "app/x11_util.h" | |
14 #include "base/string16.h" | 13 #include "base/string16.h" |
15 #include "gfx/point.h" | 14 #include "gfx/point.h" |
16 #include "gfx/rect.h" | 15 #include "gfx/rect.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
| 17 #include "ui/base/x/x11_util.h" |
18 #include "webkit/glue/window_open_disposition.h" | 18 #include "webkit/glue/window_open_disposition.h" |
19 | 19 |
20 typedef struct _cairo cairo_t; | 20 typedef struct _cairo cairo_t; |
21 typedef struct _GdkColor GdkColor; | 21 typedef struct _GdkColor GdkColor; |
22 typedef struct _GtkWidget GtkWidget; | 22 typedef struct _GtkWidget GtkWidget; |
23 | 23 |
24 class BrowserWindow; | 24 class BrowserWindow; |
25 class GtkThemeProvider; | 25 class GtkThemeProvider; |
26 class GURL; | 26 class GURL; |
27 class Profile; | 27 class Profile; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // is packed at the start of the hbox. This is useful for widgets that would | 166 // is packed at the start of the hbox. This is useful for widgets that would |
167 // otherwise expand to fill the vertical space of the hbox | 167 // otherwise expand to fill the vertical space of the hbox |
168 // (e.g. buttons). Returns the vbox that widget was packed in. | 168 // (e.g. buttons). Returns the vbox that widget was packed in. |
169 GtkWidget* CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, | 169 GtkWidget* CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, |
170 bool pack_at_end, int padding); | 170 bool pack_at_end, int padding); |
171 | 171 |
172 // Returns true if the screen is composited, false otherwise. | 172 // Returns true if the screen is composited, false otherwise. |
173 bool IsScreenComposited(); | 173 bool IsScreenComposited(); |
174 | 174 |
175 // Enumerates the top-level gdk windows of the current display. | 175 // Enumerates the top-level gdk windows of the current display. |
176 void EnumerateTopLevelWindows(x11_util::EnumerateWindowsDelegate* delegate); | 176 void EnumerateTopLevelWindows(ui::EnumerateWindowsDelegate* delegate); |
177 | 177 |
178 // Set that clicking the button with the given mouse buttons will cause a click | 178 // Set that clicking the button with the given mouse buttons will cause a click |
179 // event. | 179 // event. |
180 // NOTE: If you need to connect to the button-press-event or | 180 // NOTE: If you need to connect to the button-press-event or |
181 // button-release-event signals, do so before calling this function. | 181 // button-release-event signals, do so before calling this function. |
182 void SetButtonClickableByMouseButtons(GtkWidget* button, | 182 void SetButtonClickableByMouseButtons(GtkWidget* button, |
183 bool left, bool middle, bool right); | 183 bool left, bool middle, bool right); |
184 | 184 |
185 // Set that a button causes a page navigation. In particular, it will accept | 185 // Set that a button causes a page navigation. In particular, it will accept |
186 // middle clicks. Warning: only call this *after* you have connected your | 186 // middle clicks. Warning: only call this *after* you have connected your |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 void ApplyMessageDialogQuirks(GtkWidget* dialog); | 371 void ApplyMessageDialogQuirks(GtkWidget* dialog); |
372 | 372 |
373 // Performs Cut/Copy/Paste operation on the |window|. | 373 // Performs Cut/Copy/Paste operation on the |window|. |
374 void DoCut(BrowserWindow* window); | 374 void DoCut(BrowserWindow* window); |
375 void DoCopy(BrowserWindow* window); | 375 void DoCopy(BrowserWindow* window); |
376 void DoPaste(BrowserWindow* window); | 376 void DoPaste(BrowserWindow* window); |
377 | 377 |
378 } // namespace gtk_util | 378 } // namespace gtk_util |
379 | 379 |
380 #endif // CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ | 380 #endif // CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ |
OLD | NEW |