Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / libgtk2ui / gtk2_util.h
blob92d06d16f2bc90d8a9487e5d4b5996fc2c4d9bd7
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_
6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_
8 #include <gtk/gtk.h>
9 #include <string>
11 #include "ui/native_theme/native_theme.h"
13 class SkBitmap;
15 namespace aura {
16 class Window;
19 namespace base {
20 class CommandLine;
21 class Environment;
24 namespace ui {
25 class Accelerator;
28 namespace libgtk2ui {
30 void GtkInitFromCommandLine(const base::CommandLine& command_line);
32 // Returns the name of the ".desktop" file associated with our running process.
33 std::string GetDesktopName(base::Environment* env);
35 guint GetGdkKeyCodeForAccelerator(const ui::Accelerator& accelerator);
37 GdkModifierType GetGdkModifierForAccelerator(
38 const ui::Accelerator& accelerator);
40 // Translates event flags into plaform independent event flags.
41 int EventFlagsFromGdkState(guint state);
43 // Style a GTK button as a BlueButton
44 void TurnButtonBlue(GtkWidget* button);
46 // Sets |dialog| as transient for |parent|, which will keep it on top and center
47 // it above |parent|. Do nothing if |parent| is NULL.
48 void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent);
50 // Gets the transient parent aura window for |dialog|.
51 aura::Window* GetAuraTransientParent(GtkWidget* dialog);
53 // Clears the transient parent for |dialog|.
54 void ClearAuraTransientParent(GtkWidget* dialog);
56 } // namespace libgtk2ui
58 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_