gplugin/gplugin

Make GPluginFileSource public

2 months ago, Gary Kramlich
7d9e362672b7
Parents 520bb71c41cb
Children 6966466e0e43
Make GPluginFileSource public

This also adds api for managing the paths it looks at. Currently GPluginManager
forwards the existing API to these new methods.

Testing Done:
Ran with the turtles.

Reviewed at https://reviews.imfreedom.org/r/2982/
--- a/gplugin/gplugin-file-source.c Tue Feb 27 23:10:00 2024 -0600
+++ b/gplugin/gplugin-file-source.c Wed Feb 28 00:06:21 2024 -0600
@@ -25,7 +25,7 @@
*
* A [iface@GPlugin.Source] that will query plugins on disk.
*
- * Since: 0.39
+ * Since: 0.43
*/
struct _GPluginFileSource {
--- a/gplugin/gplugin-file-source.h Tue Feb 27 23:10:00 2024 -0600
+++ b/gplugin/gplugin-file-source.h Wed Feb 28 00:06:21 2024 -0600
@@ -23,10 +23,13 @@
#include <gplugin/gplugin-manager.h>
#include <gplugin/gplugin-source.h>
+#include <gplugin/gplugin-version.h>
G_BEGIN_DECLS
#define GPLUGIN_TYPE_FILE_SOURCE (gplugin_file_source_get_type())
+
+GPLUGIN_AVAILABLE_IN_0_43
G_DECLARE_FINAL_TYPE(
GPluginFileSource,
gplugin_file_source,
@@ -34,6 +37,7 @@
FILE_SOURCE,
GObject)
+GPLUGIN_AVAILABLE_IN_0_43
GPluginSource *gplugin_file_source_new(GPluginManager *manager);
G_END_DECLS
--- a/gplugin/gplugin-version.h Tue Feb 27 23:10:00 2024 -0600
+++ b/gplugin/gplugin-version.h Wed Feb 28 00:06:21 2024 -0600
@@ -53,12 +53,14 @@
#define GPLUGIN_DEPRECATED _GPLUGIN_EXTERN
#define GPLUGIN_DEPRECATED_FOR(f) _GPLUGIN_EXTERN
#define GPLUGIN_UNAVAILABLE(maj, min) _GPLUGIN_EXTERN
+#define GPLUGIN_UNAVAILABLE_MACRO(maj, min)
#define GPLUGIN_UNAVAILABLE_STATIC_INLINE(maj, min)
#define GPLUGIN_UNAVAILABLE_TYPE(maj, min)
#else
#define GPLUGIN_DEPRECATED G_DEPRECATED _GPLUGIN_EXTERN
#define GPLUGIN_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _GPLUGIN_EXTERN
#define GPLUGIN_UNAVAILABLE(maj, min) G_UNAVAILABLE(maj, min) _GPLUGIN_EXTERN
+#define GPLUGIN_UNAVAILABLE_MACRO(maj, min) G_UNAVAILABLE_MACRO(maj, min)
#define GPLUGIN_UNAVAILABLE_STATIC_INLINE(maj, min) G_UNAVAILABLE(maj, min)
#define GPLUGIN_UNAVAILABLE_TYPE(maj, min) G_UNAVAILABLE(maj, min)
#endif
@@ -295,6 +297,22 @@
#define GPLUGIN_AVAILABLE_IN_0_42 _GPLUGIN_EXTERN
#endif
+/**
+ * GPLUGIN_VERSION_0_43:
+ *
+ * A macro that evaluates to the 0.43 version of GPlugin, in a format that can
+ * be used by the C pre-processor.
+ *
+ * Since: 0.43.0
+ */
+#define GPLUGIN_VERSION_0_43 (G_ENCODE_VERSION(0, 43))
+
+#if GPLUGIN_VERSION_MAX_ALLOWED < GPLUGIN_VERSION_0_43
+#define GPLUGIN_AVAILABLE_IN_0_43 GPLUGIN_UNAVAILABLE(0, 43)
+#else
+#define GPLUGIN_AVAILABLE_IN_0_43 _GPLUGIN_EXTERN
+#endif
+
#define GPLUGIN_VERSION_CHECK(major, minor, micro) \
((major) == GPLUGIN_MAJOR_VERSION && \
((minor) < GPLUGIN_MINOR_VERSION || \
--- a/gplugin/meson.build Tue Feb 27 23:10:00 2024 -0600
+++ b/gplugin/meson.build Wed Feb 28 00:06:21 2024 -0600
@@ -6,6 +6,7 @@
GPLUGIN_HEADERS = [
'gplugin-core.h',
+ 'gplugin-file-source.h',
'gplugin-loader.h',
'gplugin-manager.h',
'gplugin-options.h',
@@ -17,6 +18,7 @@
GPLUGIN_SOURCES = [
'gplugin-core.c',
+ 'gplugin-file-source.c',
'gplugin-plugin.c',
'gplugin-loader.c',
'gplugin-manager.c',
@@ -36,12 +38,10 @@
]
GPLUGIN_PRIVATE_HEADERS = [
- 'gplugin-file-source.h',
'gplugin-file-tree.h',
]
GPLUGIN_PRIVATE_SOURCES = [
- 'gplugin-file-source.c',
'gplugin-file-tree.c',
]
--- a/meson.build Tue Feb 27 23:10:00 2024 -0600
+++ b/meson.build Wed Feb 28 00:06:21 2024 -0600
@@ -3,7 +3,7 @@
###############################################################################
project('gplugin', 'c',
license : 'LGPL-2.0-or-later',
- version : '0.42.2-dev',
+ version : '0.43.0-dev',
meson_version : '>=0.61.0',
default_options : ['c_std=c17', 'warning_level=2'])