[mutter] context: Add way to add custom option group



commit ed53dd90f33be3ee8d4f7d385c5027069a0cd872
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Mar 3 13:56:32 2021 +0100

    context: Add way to add custom option group
    
    This will be used by gnome-shell.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861>

 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 12f8f9eab4..60e3543a5f 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 c45217839b..6c95727572 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);


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