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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class BrowserWindow; | 23 class BrowserWindow; |
24 class GtkThemeService; | 24 class GtkThemeService; |
25 class GURL; | 25 class GURL; |
26 class Profile; | 26 class Profile; |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 struct RendererPreferences; | 29 struct RendererPreferences; |
30 } | 30 } |
31 | 31 |
| 32 namespace gfx { |
| 33 class Image; |
| 34 } |
| 35 |
32 namespace event_utils { | 36 namespace event_utils { |
33 | 37 |
34 // Translates GdkEvent state into what kind of disposition they represent. | 38 // Translates GdkEvent state into what kind of disposition they represent. |
35 // For example, a middle click would mean to open a background tab. | 39 // For example, a middle click would mean to open a background tab. |
36 WindowOpenDisposition DispositionFromGdkState(guint state); | 40 WindowOpenDisposition DispositionFromGdkState(guint state); |
37 | 41 |
38 // Translates event flags into plaform independent event flags. | 42 // Translates event flags into plaform independent event flags. |
39 int EventFlagsFromGdkState(guint state); | 43 int EventFlagsFromGdkState(guint state); |
40 | 44 |
41 } // namespace event_utils | 45 } // namespace event_utils |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 void SetLayoutText(PangoLayout* layout, const string16& text); | 220 void SetLayoutText(PangoLayout* layout, const string16& text); |
217 | 221 |
218 // Draws the background of the toolbar area subject to the expose rectangle | 222 // Draws the background of the toolbar area subject to the expose rectangle |
219 // |event| and starting image tiling from |tabstrip_origin|. | 223 // |event| and starting image tiling from |tabstrip_origin|. |
220 void DrawThemedToolbarBackground(GtkWidget* widget, | 224 void DrawThemedToolbarBackground(GtkWidget* widget, |
221 cairo_t* cr, | 225 cairo_t* cr, |
222 GdkEventExpose* event, | 226 GdkEventExpose* event, |
223 const gfx::Point& tabstrip_origin, | 227 const gfx::Point& tabstrip_origin, |
224 GtkThemeService* provider); | 228 GtkThemeService* provider); |
225 | 229 |
| 230 // Draw an entire pixbuf without dithering. |
| 231 void DrawFullImage(cairo_t* cr, |
| 232 GtkWidget* widget, |
| 233 const gfx::Image* image, |
| 234 gint dest_x, |
| 235 gint dest_y); |
| 236 |
226 // Returns the two colors averaged together. | 237 // Returns the two colors averaged together. |
227 GdkColor AverageColors(GdkColor color_one, GdkColor color_two); | 238 GdkColor AverageColors(GdkColor color_one, GdkColor color_two); |
228 | 239 |
229 // Show the image for the given menu item, even if the user's default is to not | 240 // Show the image for the given menu item, even if the user's default is to not |
230 // show images. Only to be used for favicons or other menus where the image is | 241 // show images. Only to be used for favicons or other menus where the image is |
231 // crucial to its functionality. | 242 // crucial to its functionality. |
232 void SetAlwaysShowImage(GtkWidget* image_menu_item); | 243 void SetAlwaysShowImage(GtkWidget* image_menu_item); |
233 | 244 |
234 // Get a rectangle corresponding to a widget's allocation relative to its | 245 // Get a rectangle corresponding to a widget's allocation relative to its |
235 // toplevel window's origin. | 246 // toplevel window's origin. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 void ApplyMessageDialogQuirks(GtkWidget* dialog); | 337 void ApplyMessageDialogQuirks(GtkWidget* dialog); |
327 | 338 |
328 // Performs Cut/Copy/Paste operation on the |window|. | 339 // Performs Cut/Copy/Paste operation on the |window|. |
329 void DoCut(BrowserWindow* window); | 340 void DoCut(BrowserWindow* window); |
330 void DoCopy(BrowserWindow* window); | 341 void DoCopy(BrowserWindow* window); |
331 void DoPaste(BrowserWindow* window); | 342 void DoPaste(BrowserWindow* window); |
332 | 343 |
333 } // namespace gtk_util | 344 } // namespace gtk_util |
334 | 345 |
335 #endif // CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ | 346 #endif // CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ |
OLD | NEW |