From ed53dd90f33be3ee8d4f7d385c5027069a0cd872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 3 Mar 2021 13:56:32 +0100 Subject: [PATCH] context: Add way to add custom option group This will be used by gnome-shell. Part-of: --- src/core/meta-context.c | 11 +++++++++++ src/meta/meta-context.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/core/meta-context.c b/src/core/meta-context.c index 12f8f9eab..60e3543a5 100644 --- a/src/core/meta-context.c +++ b/src/core/meta-context.c @@ -72,6 +72,17 @@ meta_context_add_option_entries (MetaContext *context, translation_domain); } +void +meta_context_add_option_group (MetaContext *context, + GOptionGroup *group) +{ + MetaContextPrivate *priv = meta_context_get_instance_private (context); + + g_return_if_fail (priv->option_context); + + g_option_context_add_group (priv->option_context, group); +} + void meta_context_set_plugin_gtype (MetaContext *context, GType plugin_gtype) diff --git a/src/meta/meta-context.h b/src/meta/meta-context.h index c45217839..6c9572757 100644 --- a/src/meta/meta-context.h +++ b/src/meta/meta-context.h @@ -38,6 +38,10 @@ void meta_context_add_option_entries (MetaContext *context, const GOptionEntry *entries, const char *translation_domain); +META_EXPORT +void meta_context_add_option_group (MetaContext *context, + GOptionGroup *group); + META_EXPORT void meta_context_set_plugin_gtype (MetaContext *context, GType plugin_gtype);