[mutter] plugin: Drop version information



commit f481cbfa16c154a1b353bcc055f00b72558389e1
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Oct 6 14:26:53 2020 +0200

    plugin: Drop version information
    
    Mutter itself is versioned now, so passing the version information
    to the plugin is redunant now: The version is already determined by
    linking to a particular API version (gnome-shell) or by installing
    to a versioned plugin path (external plugins).
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1473

 meson.build                  |  2 --
 src/compositor/meta-module.c | 35 +++++++++++++----------------------
 src/meson.build              |  2 --
 src/meta/meson.build         | 23 -----------------------
 src/meta/meta-plugin.h       | 36 ------------------------------------
 src/meta/meta-version.h.in   | 28 ----------------------------
 6 files changed, 13 insertions(+), 113 deletions(-)
---
diff --git a/meson.build b/meson.build
index c3d9d3c116..46a5d522a3 100644
--- a/meson.build
+++ b/meson.build
@@ -4,8 +4,6 @@ project('mutter', 'c',
   license: 'GPLv2+'
 )
 
-mutter_plugin_api_version = '3'
-
 split_version = meson.project_version().split('.')
 
 # Automatically increase API version each development cycle,
diff --git a/src/compositor/meta-module.c b/src/compositor/meta-module.c
index d5aa648463..a8ed15baeb 100644
--- a/src/compositor/meta-module.c
+++ b/src/compositor/meta-module.c
@@ -26,7 +26,6 @@
 #include <gmodule.h>
 
 #include "meta/meta-plugin.h"
-#include "meta/meta-version.h"
 
 enum
 {
@@ -47,7 +46,6 @@ static gboolean
 meta_module_load (GTypeModule *gmodule)
 {
   MetaModulePrivate  *priv = META_MODULE (gmodule)->priv;
-  MetaPluginVersion  *info = NULL;
   GType                (*register_type) (GTypeModule *) = NULL;
 
   if (priv->lib && priv->plugin_type)
@@ -63,31 +61,24 @@ meta_module_load (GTypeModule *gmodule)
       return FALSE;
     }
 
-  if (g_module_symbol (priv->lib, "meta_plugin_version",
-                       (gpointer *)(void *)&info) &&
-      g_module_symbol (priv->lib, "meta_plugin_register_type",
+  if (g_module_symbol (priv->lib, "meta_plugin_register_type",
                       (gpointer *)(void *)&register_type) &&
-      info && register_type)
+      register_type)
     {
-      if (info->version_api != META_PLUGIN_API_VERSION)
-       g_warning ("Plugin API mismatch for [%s]", priv->path);
+      GType plugin_type;
+
+      if (!(plugin_type = register_type (gmodule)))
+        {
+          g_warning ("Could not register type for plugin %s",
+                     priv->path);
+          return FALSE;
+        }
       else
         {
-          GType plugin_type;
-
-          if (!(plugin_type = register_type (gmodule)))
-            {
-              g_warning ("Could not register type for plugin %s",
-                         priv->path);
-              return FALSE;
-            }
-          else
-            {
-              priv->plugin_type =  plugin_type;
-            }
-
-          return TRUE;
+          priv->plugin_type =  plugin_type;
         }
+
+      return TRUE;
     }
   else
     g_warning ("Broken plugin module [%s]", priv->path);
diff --git a/src/meson.build b/src/meson.build
index e7c99caeed..cc8527beab 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -932,7 +932,6 @@ mutter_built_sources += wayland_protocol_sources
 subdir('meta')
 
 mutter_built_sources += mutter_enum_types
-mutter_built_sources += mutter_version
 
 libmutter = shared_library(libmutter_name,
   mutter_sources,
@@ -999,7 +998,6 @@ if have_introspection
 
   libmutter_gir = gnome.generate_gir(libmutter,
     sources: [
-      mutter_version,
       mutter_enum_types[1],
       mutter_introspected_sources,
       mutter_public_header_files
diff --git a/src/meta/meson.build b/src/meta/meson.build
index c52502cbe1..a096ee4dd7 100644
--- a/src/meta/meson.build
+++ b/src/meta/meson.build
@@ -71,26 +71,3 @@ mutter_enum_types = gnome.mkenums('meta-enum-types',
   install_dir: mutter_includedir,
   install_header: true,
 )
-
-mutter_version_array = meson.project_version().split('.')
-mutter_version_major = mutter_version_array[0]
-mutter_version_minor = mutter_version_array[1]
-mutter_version_micro = mutter_version_array[2]
-
-mutter_version_cdata = configuration_data()
-mutter_version_cdata.set('MUTTER_MAJOR_VERSION',
-                         '@0@'.format(mutter_version_major))
-mutter_version_cdata.set('MUTTER_MINOR_VERSION',
-                         '@0@'.format(mutter_version_minor))
-mutter_version_cdata.set('MUTTER_MICRO_VERSION',
-                         '@0@'.format(mutter_version_micro))
-mutter_version_cdata.set('MUTTER_PLUGIN_API_VERSION',
-                         '@0@'.format(mutter_plugin_api_version))
-
-mutter_version = configure_file(
-  input: 'meta-version.h.in',
-  output: 'meta-version.h',
-  configuration: mutter_version_cdata,
-  install_dir: mutter_includedir,
-  install: true,
-)
diff --git a/src/meta/meta-plugin.h b/src/meta/meta-plugin.h
index b28836e88e..1bc19a5f0e 100644
--- a/src/meta/meta-plugin.h
+++ b/src/meta/meta-plugin.h
@@ -30,7 +30,6 @@
 #include "meta/compositor.h"
 #include "meta/meta-close-dialog.h"
 #include "meta/meta-inhibit-shortcuts-dialog.h"
-#include "meta/meta-version.h"
 #include "meta/types.h"
 
 #define META_TYPE_PLUGIN (meta_plugin_get_type ())
@@ -38,7 +37,6 @@
 META_EXPORT
 G_DECLARE_DERIVABLE_TYPE (MetaPlugin, meta_plugin, META, PLUGIN, GObject)
 
-typedef struct _MetaPluginVersion MetaPluginVersion;
 typedef struct _MetaPluginInfo    MetaPluginInfo;
 
 /**
@@ -271,44 +269,10 @@ struct _MetaPluginInfo
 META_EXPORT
 const MetaPluginInfo * meta_plugin_get_info (MetaPlugin *plugin);
 
-/**
- * MetaPluginVersion:
- * @version_major: major component of the version number of Meta with which the plugin was compiled
- * @version_minor: minor component of the version number of Meta with which the plugin was compiled
- * @version_micro: micro component of the version number of Meta with which the plugin was compiled
- * @version_api: version of the plugin API
- */
-struct _MetaPluginVersion
-{
-  /*
-   * Version information; the first three numbers match the Meta version
-   * with which the plugin was compiled (see clutter-plugins/simple.c for sample
-   * code).
-   */
-  guint version_major;
-  guint version_minor;
-  guint version_micro;
-
-  /*
-   * Version of the plugin API; this is unrelated to the matacity version
-   * per se. The API version is checked by the plugin manager and must match
-   * the one used by it (see clutter-plugins/default.c for sample code).
-   */
-  guint version_api;
-};
-
 /*
  * Convenience macro to set up the plugin type. Based on GEdit.
  */
 #define META_PLUGIN_DECLARE_WITH_CODE(ObjectName, object_name, CODE)    \
-  G_MODULE_EXPORT MetaPluginVersion meta_plugin_version =               \
-    {                                                                   \
-      META_MAJOR_VERSION,                                               \
-      META_MINOR_VERSION,                                               \
-      META_MICRO_VERSION,                                               \
-      META_PLUGIN_API_VERSION                                           \
-    };                                                                  \
-                                                                        \
   /* Prototypes */                                                      \
   G_MODULE_EXPORT GType                                                 \
   object_name##_get_type (void);                                        \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]