2011-03-05 16:16:26 -05:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2011 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2011-03-05 16:16:26 -05:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-11 20:42:06 -05:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2011-03-05 16:16:26 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include <glib.h>
|
2013-09-11 04:18:53 -04:00
|
|
|
#include <glib/gi18n-lib.h>
|
2018-07-10 04:36:24 -04:00
|
|
|
#include <stdlib.h>
|
2011-03-05 16:16:26 -05:00
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "compositor/meta-plugin-manager.h"
|
|
|
|
#include "meta/main.h"
|
|
|
|
#include "meta/util.h"
|
2011-03-05 16:16:26 -05:00
|
|
|
|
|
|
|
static gboolean
|
|
|
|
print_version (const gchar *option_name,
|
|
|
|
const gchar *value,
|
|
|
|
gpointer data,
|
|
|
|
GError **error)
|
|
|
|
{
|
2021-02-07 06:48:20 -05:00
|
|
|
g_print ("mutter %s\n", VERSION);
|
2011-03-05 16:16:26 -05:00
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
|
2018-07-12 16:20:20 -04:00
|
|
|
static const char *plugin = "libdefault";
|
2011-03-05 16:16:26 -05:00
|
|
|
|
|
|
|
GOptionEntry mutter_options[] = {
|
|
|
|
{
|
|
|
|
"version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
|
|
|
|
print_version,
|
|
|
|
N_("Print version"),
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
2012-04-05 00:50:21 -04:00
|
|
|
"mutter-plugin", 0, 0, G_OPTION_ARG_STRING,
|
|
|
|
&plugin,
|
|
|
|
N_("Mutter plugin to use"),
|
|
|
|
"PLUGIN",
|
2011-03-05 16:16:26 -05:00
|
|
|
},
|
|
|
|
{ NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
GOptionContext *ctx;
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
ctx = meta_get_option_context ();
|
|
|
|
g_option_context_add_main_entries (ctx, mutter_options, GETTEXT_PACKAGE);
|
|
|
|
if (!g_option_context_parse (ctx, &argc, &argv, &error))
|
|
|
|
{
|
|
|
|
g_printerr ("mutter: %s\n", error->message);
|
|
|
|
exit (1);
|
|
|
|
}
|
2014-05-07 12:25:04 -04:00
|
|
|
g_option_context_free (ctx);
|
2011-03-05 16:16:26 -05:00
|
|
|
|
2012-04-05 00:50:21 -04:00
|
|
|
if (plugin)
|
2012-04-05 01:29:39 -04:00
|
|
|
meta_plugin_manager_load (plugin);
|
2011-03-05 16:16:26 -05:00
|
|
|
|
|
|
|
meta_init ();
|
2013-02-28 10:37:03 -05:00
|
|
|
meta_register_with_session ();
|
2011-03-05 16:16:26 -05:00
|
|
|
return meta_run ();
|
|
|
|
}
|