[gtk+/no-init-args: 1/10] Drop gtk_init_with_args



commit 5b411031bae9871b6a85ea9b2803711ee9840806
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 27 18:31:03 2016 -0500

    Drop gtk_init_with_args
    
    We want to simplify our initialization code and remove all commandline
    argument handling from it. The first stop for this is to reduce the
    number of gtk_init variants we have.

 gtk/gtkmain.c |   69 ---------------------------------------------------------
 gtk/gtkmain.h |    8 ------
 2 files changed, 0 insertions(+), 77 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index ba7b3c6..acdf104 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -900,75 +900,6 @@ gtk_get_option_group (gboolean open_default_display)
 }
 
 /**
- * gtk_init_with_args:
- * @argc: (inout): Address of the `argc` parameter of
- *     your main() function (or 0 if @argv is %NULL). This will be changed if 
- *     any arguments were handled.
- * @argv: (array length=argc) (inout) (allow-none): Address of the
- *     `argv` parameter of main(), or %NULL. Any options
- *     understood by GTK+ are stripped before return.
- * @parameter_string: (allow-none): a string which is displayed in
- *    the first line of `--help` output, after
- *    `programname [OPTION...]`
- * @entries: (array zero-terminated=1): a %NULL-terminated array
- *    of #GOptionEntrys describing the options of your program
- * @translation_domain: (nullable): a translation domain to use for translating
- *    the `--help` output for the options in @entries
- *    and the @parameter_string with gettext(), or %NULL
- * @error: a return location for errors
- *
- * This function does the same work as gtk_init_check().
- * Additionally, it allows you to add your own commandline options,
- * and it automatically generates nicely formatted
- * `--help` output. Note that your program will
- * be terminated after writing out the help output.
- *
- * Returns: %TRUE if the windowing system has been successfully
- *     initialized, %FALSE otherwise
- *
- * Since: 2.6
- */
-gboolean
-gtk_init_with_args (gint                 *argc,
-                    gchar              ***argv,
-                    const gchar          *parameter_string,
-                    const GOptionEntry   *entries,
-                    const gchar          *translation_domain,
-                    GError              **error)
-{
-  GOptionContext *context;
-  GOptionGroup *gtk_group;
-  gboolean retval;
-
-  if (gtk_initialized)
-    goto done;
-
-  gettext_initialization ();
-
-  if (!check_setugid ())
-    return FALSE;
-
-  gtk_group = gtk_get_option_group (FALSE);
-
-  context = g_option_context_new (parameter_string);
-  g_option_context_add_group (context, gtk_group);
-  g_option_context_set_translation_domain (context, translation_domain);
-
-  if (entries)
-    g_option_context_add_main_entries (context, entries, translation_domain);
-  retval = g_option_context_parse (context, argc, argv, error);
-
-  g_option_context_free (context);
-
-  if (!retval)
-    return FALSE;
-
-done:
-  return gdk_display_open_default () != NULL;
-}
-
-
-/**
  * gtk_parse_args:
  * @argc: (inout): a pointer to the number of command line arguments
  * @argv: (array length=argc) (inout): a pointer to the array of
diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h
index 3dfcc6c..4754395 100644
--- a/gtk/gtkmain.h
+++ b/gtk/gtkmain.h
@@ -85,14 +85,6 @@ gboolean gtk_init_check           (int    *argc,
                                    char ***argv);
 
 GDK_AVAILABLE_IN_ALL
-gboolean gtk_init_with_args       (gint                 *argc,
-                                   gchar              ***argv,
-                                   const gchar          *parameter_string,
-                                   const GOptionEntry   *entries,
-                                   const gchar          *translation_domain,
-                                   GError              **error);
-
-GDK_AVAILABLE_IN_ALL
 GOptionGroup *gtk_get_option_group (gboolean open_default_display);
 
 #ifdef G_OS_WIN32


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