From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 7 Apr 2022 20:30:16 +0900 Subject: Make gtk::GetLibGtk public Allows embedders to get a handle to the gtk library already loaded in the process. diff --git a/ui/gtk/gtk_compat.cc b/ui/gtk/gtk_compat.cc index b5c7af5bdb93b320f95252d35d2d76bae7f8c445..40b706ed7cde206e98274025148604760b7477f9 100644 --- a/ui/gtk/gtk_compat.cc +++ b/ui/gtk/gtk_compat.cc @@ -86,12 +86,6 @@ void* GetLibGtk4(bool check = true) { return libgtk4; } -void* GetLibGtk() { - if (GtkCheckVersion(4)) - return GetLibGtk4(); - return GetLibGtk3(); -} - bool LoadGtk3() { if (!GetLibGtk3(false)) return false; @@ -134,6 +128,12 @@ gfx::Insets InsetsFromGtkBorder(const GtkBorder& border) { } // namespace +void* GetLibGtk() { + if (GtkCheckVersion(4)) + return GetLibGtk4(); + return GetLibGtk3(); +} + bool LoadGtk() { static bool loaded = LoadGtkImpl(); return loaded; diff --git a/ui/gtk/gtk_compat.h b/ui/gtk/gtk_compat.h index 57e55b9e749b43d327deff449a530e1f435a8e8b..2245974f91be4a691d82f54b55e12e44ae2000c5 100644 --- a/ui/gtk/gtk_compat.h +++ b/ui/gtk/gtk_compat.h @@ -34,6 +34,9 @@ using SkColor = uint32_t; namespace gtk { +// Get handle to the currently loaded gtk library in the process. +void* GetLibGtk(); + // Loads libgtk and related libraries and returns true on success. bool LoadGtk();