// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_GTK_GTK_UTIL_H_ #define UI_GTK_GTK_UTIL_H_ #include #include #include "ui/base/glib/scoped_gobject.h" #include "ui/native_theme/native_theme.h" #include "ui/views/window/frame_buttons.h" // Function availability can be tested by checking if the address of gtk_* is // not nullptr. #define WEAK_GTK_FN(x) extern "C" __attribute__((weak)) decltype(x) x typedef union _GdkEvent GdkEvent; namespace aura { class Window; } namespace base { class CommandLine; } namespace color_utils { struct HSL; } namespace ui { class KeyEvent; } namespace gtk { extern const color_utils::HSL kDefaultTintFrameIncognito; void GtkInitFromCommandLine(const base::CommandLine& command_line); // Sets |dialog| as transient for |parent|, which will keep it on top and center // it above |parent|. Do nothing if |parent| is nullptr. void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent); // Gets the transient parent aura window for |dialog|. aura::Window* GetAuraTransientParent(GtkWidget* dialog); // Clears the transient parent for |dialog|. void ClearAuraTransientParent(GtkWidget* dialog); // Parses |button_string| into |leading_buttons| and // |trailing_buttons|. The string is of the format // "