#ifndef UI_GTK_GTK_COMPAT_H_
#define UI_GTK_GTK_COMPAT_H_
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <gtk/gtkunixprint.h>
#include <optional>
#include "base/files/file_path.h"
#include "base/version.h"
#include "ui/base/glib/scoped_gobject.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gtk/gtk_types.h"
#if GTK_CHECK_VERSION(4, 1, 1)
#define UI_GTK_CONST …
#else
#define UI_GTK_CONST
#endif
extern "C" {
#include "ui/gtk/gdk.sigs"
#include "ui/gtk/gdk_pixbuf.sigs"
#include "ui/gtk/gio.sigs"
#include "ui/gtk/gsk.sigs"
#include "ui/gtk/gtk.sigs"
}
#define GDK_KEY_PRESS …
#define GDK_KEY_RELEASE …
SkColor;
namespace gtk {
bool LoadGtk();
const base::Version& GtkVersion();
bool GtkCheckVersion(uint32_t major, uint32_t minor = 0, uint32_t micro = 0);
[[nodiscard]] bool GtkInitCheck(int* argc, char** argv);
gfx::Insets GtkStyleContextGetPadding(GtkStyleContext* context);
gfx::Insets GtkStyleContextGetBorder(GtkStyleContext* context);
gfx::Insets GtkStyleContextGetMargin(GtkStyleContext* context);
SkColor GtkStyleContextGetColor(GtkStyleContext* context);
SkColor GtkStyleContextGetBackgroundColor(GtkStyleContext* context);
std::optional<SkColor> GtkStyleContextLookupColor(GtkStyleContext* context,
const gchar* color_name);
bool GtkImContextFilterKeypress(GtkIMContext* context, GdkEventKey* event);
bool GtkFileChooserSetCurrentFolder(GtkFileChooser* dialog,
const base::FilePath& path);
void GtkRenderIcon(GtkStyleContext* context,
cairo_t* cr,
GdkPixbuf* pixbuf,
GdkTexture* texture,
double x,
double y);
GtkWidget* GtkToplevelWindowNew();
void GtkCssProviderLoadFromData(GtkCssProvider* css_provider,
const char* data,
gssize length);
ScopedGObject<GListModel> Gtk4FileChooserGetFiles(GtkFileChooser* dialog);
ScopedGObject<GtkIconInfo> Gtk3IconThemeLookupByGiconForScale(
GtkIconTheme* theme,
GIcon* icon,
int size,
int scale,
GtkIconLookupFlags flags);
ScopedGObject<GtkIconPaintable> Gtk4IconThemeLookupByGicon(
GtkIconTheme* theme,
GIcon* icon,
int size,
int scale,
GtkTextDirection direction,
GtkIconLookupFlags flags);
ScopedGObject<GtkIconPaintable> Gtk4IconThemeLookupIcon(
GtkIconTheme* theme,
const char* icon_name,
const char* fallbacks[],
int size,
int scale,
GtkTextDirection direction,
GtkIconLookupFlags flags);
void GtkStyleContextGet(GtkStyleContext* context, ...);
void GtkStyleContextGetStyle(GtkStyleContext* context, ...);
GtkWidget* GtkFileChooserDialogNew(const gchar* title,
GtkWindow* parent,
GtkFileChooserAction action,
const gchar* first_button_text,
GtkResponseType first_response,
const gchar* second_button_text,
GtkResponseType second_response);
GtkTreeStore* GtkTreeStoreNew(GType type);
GdkEventType GdkEventGetEventType(GdkEvent* event);
guint32 GdkEventGetTime(GdkEvent* event);
GdkEventType GdkKeyPress();
GdkEventType GdkKeyRelease();
}
#endif