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
This commit is contained in:
Florian Müllner
2020-10-06 14:26:53 +02:00
parent 113446f2e9
commit f481cbfa16
6 changed files with 13 additions and 113 deletions

View File

@ -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,
)

View File

@ -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); \

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#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