Use new GApplicationCommandline handling
[cheese.git] / libcheese / cheese-gtk.c
blob08cca76e9b9dda300ba3f8e62a0fd99c6bbf0cf2
1 /*
2 * Copyright © 2011 David King <amigadave@amigadave.com>
4 * Licensed under the GNU General Public License Version 2
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <gtk/gtk.h>
21 #ifdef GDK_WINDOWING_X11
22 #include <X11/Xlib.h>
23 #endif
24 #include <clutter-gtk/clutter-gtk.h>
26 #include "cheese-gtk.h"
27 #include "cheese.h"
29 /**
30 * SECTION:cheese-gtk-init
31 * @short_description: Initialize libcheese-gtk
32 * @stability: Unstable
33 * @include: cheese/cheese-gtk.h
35 * Call cheese_gtk_init() to initialize libcheese-gtk.
39 /**
40 * cheese_gtk_init:
41 * @argc: (allow-none): pointer to the argument list count
42 * @argv: (allow-none): pointer to the argument list vector
44 * Initialize libcheese-gtk, by initializing Clutter, GStreamer and GTK+. This
45 * automatically calls cheese_init(), initializing libcheese.
47 * Returns: %TRUE if the initialization was successful, %FALSE otherwise
49 gboolean
50 cheese_gtk_init (int *argc, char ***argv)
52 ClutterInitError error;
54 #ifdef GDK_WINDOWING_X11
55 XInitThreads ();
56 #endif
58 error = gtk_clutter_init (argc, argv);
60 if (error != CLUTTER_INIT_SUCCESS)
61 return FALSE;
63 if (!cheese_init (argc, argv))
64 return FALSE;
66 return TRUE;