From f481cbfa16c154a1b353bcc055f00b72558389e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 6 Oct 2020 14:26:53 +0200 Subject: [PATCH] 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(-) delete mode 100644 src/meta/meta-version.h.in diff --git a/meson.build b/meson.build index c3d9d3c11..46a5d522a 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 d5aa64846..a8ed15bae 100644 --- a/src/compositor/meta-module.c +++ b/src/compositor/meta-module.c @@ -26,7 +26,6 @@ #include #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 *)®ister_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 e7c99caee..cc8527bea 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 c52502cbe..a096ee4dd 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 b28836e88..1bc19a5f0 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); \ diff --git a/src/meta/meta-version.h.in b/src/meta/meta-version.h.in deleted file mode 100644 index bf977cf41..000000000 --- a/src/meta/meta-version.h.in +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - -/* - * Copyright (C) 2014 Rico Tzschichholz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -#ifndef META_VERSION_H -#define META_VERSION_H - -#define META_MAJOR_VERSION @MUTTER_MAJOR_VERSION@ -#define META_MINOR_VERSION @MUTTER_MINOR_VERSION@ -#define META_MICRO_VERSION @MUTTER_MICRO_VERSION@ -#define META_PLUGIN_API_VERSION @MUTTER_PLUGIN_API_VERSION@ - -#endif