mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
clutter: Remove clutter_init_with_args()
Not used anymore. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861>
This commit is contained in:
parent
2712555c71
commit
07384e18c5
@ -863,99 +863,6 @@ clutter_get_option_group_without_init (void)
|
||||
* allow the common case of argc=NULL, argv=NULL to work.
|
||||
*/
|
||||
|
||||
/**
|
||||
* clutter_init_with_args:
|
||||
* @argc: (inout): a pointer to the number of command line arguments
|
||||
* @argv: (array length=argc) (inout) (allow-none): a pointer to the array
|
||||
* of command line arguments
|
||||
* @parameter_string: (allow-none): a string which is displayed in the
|
||||
* first line of <option>--help</option> output, after
|
||||
* <literal><replaceable>programname</replaceable> [OPTION...]</literal>
|
||||
* @entries: (array) (allow-none): a %NULL terminated array of
|
||||
* #GOptionEntry<!-- -->s describing the options of your program
|
||||
* @translation_domain: (allow-none): a translation domain to use for
|
||||
* translating the <option>--help</option> output for the options in
|
||||
* @entries with gettext(), or %NULL
|
||||
* @error: (allow-none): a return location for a #GError
|
||||
*
|
||||
* This function does the same work as clutter_init(). Additionally,
|
||||
* it allows you to add your own command line options, and it
|
||||
* automatically generates nicely formatted <option>--help</option>
|
||||
* output. Note that your program will be terminated after writing
|
||||
* out the help output. Also note that, in case of error, the
|
||||
* error message will be placed inside @error instead of being
|
||||
* printed on the display.
|
||||
*
|
||||
* Just like clutter_init(), if this function returns an error code then
|
||||
* any subsequent call to any other Clutter API will result in undefined
|
||||
* behaviour - including segmentation faults.
|
||||
*
|
||||
* Return value: %CLUTTER_INIT_SUCCESS if Clutter has been successfully
|
||||
* initialised, or other values or #ClutterInitError in case of
|
||||
* error.
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
ClutterInitError
|
||||
clutter_init_with_args (int *argc,
|
||||
char ***argv,
|
||||
const char *parameter_string,
|
||||
GOptionEntry *entries,
|
||||
const char *translation_domain,
|
||||
GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
GOptionGroup *group;
|
||||
gboolean res;
|
||||
ClutterMainContext *ctx;
|
||||
|
||||
if (clutter_is_initialized)
|
||||
return CLUTTER_INIT_SUCCESS;
|
||||
|
||||
clutter_base_init ();
|
||||
|
||||
ctx = _clutter_context_get_default ();
|
||||
|
||||
if (!ctx->defer_display_setup)
|
||||
{
|
||||
#if 0
|
||||
if (argc && *argc > 0 && *argv)
|
||||
g_set_prgname ((*argv)[0]);
|
||||
#endif
|
||||
|
||||
context = g_option_context_new (parameter_string);
|
||||
|
||||
group = clutter_get_option_group ();
|
||||
g_option_context_add_group (context, group);
|
||||
|
||||
group = cogl_get_option_group ();
|
||||
g_option_context_add_group (context, group);
|
||||
|
||||
if (entries)
|
||||
g_option_context_add_main_entries (context, entries, translation_domain);
|
||||
|
||||
res = g_option_context_parse (context, argc, argv, error);
|
||||
g_option_context_free (context);
|
||||
|
||||
/* if res is FALSE, the error is filled for
|
||||
* us by g_option_context_parse()
|
||||
*/
|
||||
if (!res)
|
||||
{
|
||||
/* if there has been an error in the initialization, the
|
||||
* error id will be preserved inside the GError code
|
||||
*/
|
||||
if (error && *error)
|
||||
return (*error)->code;
|
||||
else
|
||||
return CLUTTER_INIT_ERROR_INTERNAL;
|
||||
}
|
||||
|
||||
return CLUTTER_INIT_SUCCESS;
|
||||
}
|
||||
else
|
||||
return clutter_init_real (error);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_parse_args (int *argc,
|
||||
@ -1007,9 +914,7 @@ clutter_parse_args (int *argc,
|
||||
* This function will not abort in case of errors during
|
||||
* initialization; clutter_init() will print out the error message on
|
||||
* stderr, and will return an error code. It is up to the application
|
||||
* code to handle this case. If you need to display the error message
|
||||
* yourself, you can use clutter_init_with_args(), which takes a #GError
|
||||
* pointer.
|
||||
* code to handle this case.
|
||||
*
|
||||
* If this function fails, and returns an error code, any subsequent
|
||||
* Clutter API will have undefined behaviour - including segmentation
|
||||
|
@ -91,7 +91,7 @@ typedef enum
|
||||
* @CLUTTER_INIT_ERROR_BACKEND: Backend initialisation failed
|
||||
* @CLUTTER_INIT_ERROR_INTERNAL: Internal error
|
||||
*
|
||||
* Error conditions returned by clutter_init() and clutter_init_with_args().
|
||||
* Error conditions returned by clutter_init().
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
@ -126,13 +126,6 @@ void clutter_base_init (void);
|
||||
CLUTTER_EXPORT
|
||||
ClutterInitError clutter_init (int *argc,
|
||||
char ***argv) G_GNUC_WARN_UNUSED_RESULT;
|
||||
CLUTTER_EXPORT
|
||||
ClutterInitError clutter_init_with_args (int *argc,
|
||||
char ***argv,
|
||||
const char *parameter_string,
|
||||
GOptionEntry *entries,
|
||||
const char *translation_domain,
|
||||
GError **error) G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
CLUTTER_EXPORT
|
||||
GOptionGroup * clutter_get_option_group (void);
|
||||
|
@ -99,22 +99,6 @@ clutter_test_init (int *argc,
|
||||
init_common_post (argc, argv);
|
||||
}
|
||||
|
||||
void
|
||||
clutter_test_init_with_args (int *argc,
|
||||
char ***argv,
|
||||
const char *parameter_string,
|
||||
GOptionEntry *entries,
|
||||
const char *translation_domain)
|
||||
{
|
||||
init_common_pre ();
|
||||
g_assert (clutter_init_with_args (argc, argv,
|
||||
parameter_string,
|
||||
entries,
|
||||
translation_domain,
|
||||
NULL) == CLUTTER_INIT_SUCCESS);
|
||||
init_common_post (argc, argv);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_test_get_stage:
|
||||
*
|
||||
|
@ -99,13 +99,6 @@ CLUTTER_EXPORT
|
||||
void clutter_test_init (int *argc,
|
||||
char ***argv);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_test_init_with_args (int *argc,
|
||||
char ***argv,
|
||||
const char *parameter_string,
|
||||
GOptionEntry *entries,
|
||||
const char *translation_domain);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
int clutter_test_run (void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user