2022-04-18 04:24:32 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: deepak1556 <hop2deep@gmail.com>
|
|
|
|
Date: Thu, 7 Apr 2022 20:30:16 +0900
|
2022-06-20 00:42:30 +00:00
|
|
|
Subject: Make gtk::GetLibGtk and gtk::GetLibGdkPixbuf public
|
2022-04-18 04:24:32 +00:00
|
|
|
|
2022-06-20 00:42:30 +00:00
|
|
|
Allows embedders to get a handle to the gtk and
|
|
|
|
gdk_pixbuf libraries already loaded in the process.
|
2022-04-18 04:24:32 +00:00
|
|
|
|
|
|
|
diff --git a/ui/gtk/gtk_compat.cc b/ui/gtk/gtk_compat.cc
|
2022-10-03 20:21:00 +00:00
|
|
|
index d196e304a43191b6dc82f25b0b4bf24d242edb3c..85d618efa0574b00fc0cb1e5bde5ed725b2a90ab 100644
|
2022-04-18 04:24:32 +00:00
|
|
|
--- a/ui/gtk/gtk_compat.cc
|
|
|
|
+++ b/ui/gtk/gtk_compat.cc
|
2022-06-20 00:42:30 +00:00
|
|
|
@@ -66,11 +66,6 @@ void* GetLibGio() {
|
|
|
|
return libgio;
|
|
|
|
}
|
|
|
|
|
|
|
|
-void* GetLibGdkPixbuf() {
|
|
|
|
- static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0");
|
|
|
|
- return libgdk_pixbuf;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void* GetLibGdk3() {
|
|
|
|
static void* libgdk3 = DlOpen("libgdk-3.so.0");
|
|
|
|
return libgdk3;
|
|
|
|
@@ -86,12 +81,6 @@ void* GetLibGtk4(bool check = true) {
|
2022-04-18 04:24:32 +00:00
|
|
|
return libgtk4;
|
|
|
|
}
|
|
|
|
|
|
|
|
-void* GetLibGtk() {
|
|
|
|
- if (GtkCheckVersion(4))
|
|
|
|
- return GetLibGtk4();
|
|
|
|
- return GetLibGtk3();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
bool LoadGtk3() {
|
|
|
|
if (!GetLibGtk3(false))
|
|
|
|
return false;
|
2022-06-20 00:42:30 +00:00
|
|
|
@@ -134,6 +123,17 @@ gfx::Insets InsetsFromGtkBorder(const GtkBorder& border) {
|
2022-04-18 04:24:32 +00:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2022-06-20 00:42:30 +00:00
|
|
|
+void* GetLibGdkPixbuf() {
|
|
|
|
+ static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0");
|
|
|
|
+ return libgdk_pixbuf;
|
|
|
|
+}
|
|
|
|
+
|
2022-04-18 04:24:32 +00:00
|
|
|
+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
|
2023-09-29 05:26:41 +00:00
|
|
|
index 409e385fc952662c9887d9a810bb3c547c5be282..1518b681f98b3bc051aed74713a23c016c7b755e 100644
|
2022-04-18 04:24:32 +00:00
|
|
|
--- a/ui/gtk/gtk_compat.h
|
|
|
|
+++ b/ui/gtk/gtk_compat.h
|
2023-09-29 05:26:41 +00:00
|
|
|
@@ -40,6 +40,12 @@ using SkColor = uint32_t;
|
2022-04-18 04:24:32 +00:00
|
|
|
|
|
|
|
namespace gtk {
|
|
|
|
|
2022-06-20 00:42:30 +00:00
|
|
|
+// Get handle to the currently loaded gdk_pixbuf library in the process.
|
|
|
|
+void* GetLibGdkPixbuf();
|
|
|
|
+
|
2022-04-18 04:24:32 +00:00
|
|
|
+// 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();
|
|
|
|
|