output: Make implementations inherit MetaOutput

Instead of the home baked "inheritance" system, using a gpointer and a
GDestroyNotify function to keep the what effectively is sub type
details, make MetaOutput an abstract derivable type, and make the
implementations inherit it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
This commit is contained in:
Jonas Ådahl
2020-02-26 16:47:03 +01:00
committed by Georges Basile Stavracas Neto
parent 4920b5064d
commit 4a4f2d8264
18 changed files with 176 additions and 151 deletions

View File

@@ -53,7 +53,7 @@ typedef struct _MetaOutputPrivate
int backlight;
} MetaOutputPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (MetaOutput, meta_output, G_TYPE_OBJECT)
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaOutput, meta_output, G_TYPE_OBJECT)
G_DEFINE_BOXED_TYPE (MetaOutputInfo, meta_output_info,
meta_output_info_ref,
@@ -308,9 +308,6 @@ meta_output_finalize (GObject *object)
MetaOutput *output = META_OUTPUT (object);
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
if (output->driver_notify)
output->driver_notify (output);
g_clear_pointer (&priv->info, meta_output_info_unref);
G_OBJECT_CLASS (meta_output_parent_class)->finalize (object);