| OLD | NEW |
| 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 #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> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // Remove all children from this container. | 103 // Remove all children from this container. |
| 104 void RemoveAllChildren(GtkWidget* container); | 104 void RemoveAllChildren(GtkWidget* container); |
| 105 | 105 |
| 106 // Force the font size of the widget to |size_pixels|. | 106 // Force the font size of the widget to |size_pixels|. |
| 107 void ForceFontSizePixels(GtkWidget* widget, double size_pixels); | 107 void ForceFontSizePixels(GtkWidget* widget, double size_pixels); |
| 108 | 108 |
| 109 // Undoes the effects of a previous ForceFontSizePixels() call. Safe to call | 109 // Undoes the effects of a previous ForceFontSizePixels() call. Safe to call |
| 110 // even if ForceFontSizePixels() was never called. | 110 // even if ForceFontSizePixels() was never called. |
| 111 void UndoForceFontSize(GtkWidget* widget); | 111 void UndoForceFontSize(GtkWidget* widget); |
| 112 | 112 |
| 113 // Gets the position of a gtk widget in screen coordinates. | |
| 114 gfx::Point GetWidgetScreenPosition(GtkWidget* widget); | |
| 115 | |
| 116 // Returns the bounds of the specified widget in screen coordinates. | |
| 117 gfx::Rect GetWidgetScreenBounds(GtkWidget* widget); | |
| 118 | |
| 119 // Retuns size of the |widget| without window manager decorations. | 113 // Retuns size of the |widget| without window manager decorations. |
| 120 gfx::Size GetWidgetSize(GtkWidget* widget); | 114 gfx::Size GetWidgetSize(GtkWidget* widget); |
| 121 | 115 |
| 122 // Converts a point in a widget to screen coordinates. The point |p| is | 116 // Converts a point in a widget to screen coordinates. The point |p| is |
| 123 // relative to the widget's top-left origin. | 117 // relative to the widget's top-left origin. |
| 124 void ConvertWidgetPointToScreen(GtkWidget* widget, gfx::Point* p); | 118 void ConvertWidgetPointToScreen(GtkWidget* widget, gfx::Point* p); |
| 125 | 119 |
| 126 // Stick the widget in the given hbox without expanding vertically. The widget | 120 // Stick the widget in the given hbox without expanding vertically. The widget |
| 127 // is packed at the start of the hbox. This is useful for widgets that would | 121 // is packed at the start of the hbox. This is useful for widgets that would |
| 128 // otherwise expand to fill the vertical space of the hbox | 122 // otherwise expand to fill the vertical space of the hbox |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 void ApplyMessageDialogQuirks(GtkWidget* dialog); | 331 void ApplyMessageDialogQuirks(GtkWidget* dialog); |
| 338 | 332 |
| 339 // Performs Cut/Copy/Paste operation on the |window|. | 333 // Performs Cut/Copy/Paste operation on the |window|. |
| 340 void DoCut(BrowserWindow* window); | 334 void DoCut(BrowserWindow* window); |
| 341 void DoCopy(BrowserWindow* window); | 335 void DoCopy(BrowserWindow* window); |
| 342 void DoPaste(BrowserWindow* window); | 336 void DoPaste(BrowserWindow* window); |
| 343 | 337 |
| 344 } // namespace gtk_util | 338 } // namespace gtk_util |
| 345 | 339 |
| 346 #endif // CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ | 340 #endif // CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ |
| OLD | NEW |