2 * This file is part of the hildon library
4 * Copyright (C) 2008 Nokia Corporation, all rights reserved.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; version 2.1 of
9 * the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 * @Short_Description: Library initialization.
27 * Before using Hildon, you need to initialize it; initialization connects
28 * to the window system display, and parses some standard command line
29 * arguments. See also gtk_init() to know more details on this topic.
31 * Hildon should be initialized by using hildon_gtk_init(). Notice this function
32 * also initialize gtk by calling gtk_init(). In case you need a customized
33 * initialization of GTK+ library you could use hildon_init() after the
34 * customized GTK+ initialization.
37 * <title>Typical <function>main</function> function for a Hildon application</title>
40 * main (int argc, char **argv)
42 * /<!-- -->* Initialize i18n support *<!-- -->/
43 * gtk_set_locale (<!-- -->);
45 * /<!-- -->* Initialize the widget set *<!-- -->/
46 * hildon_gtk_init (&argc, &argv);
48 * /<!-- -->* Create the main window *<!-- -->/
49 * mainwin = hildon_stackable_window_new();
51 * /<!-- -->* Set up our GUI elements *<!-- -->/
54 * /<!-- -->* Show the application window *<!-- -->/
55 * gtk_widget_show_all (mainwin);
57 * /<!-- -->* Enter the main event loop, and wait for user interaction *<!-- -->/
58 * gtk_main (<!-- -->);
60 * /<!-- -->* The user lost interest *<!-- -->/
69 #include "hildon-main.h"
74 * Initializes the hildon library. Call this function after calling gtk_init()
75 * and before using any hildon or GTK+ functions in your program.
82 static gboolean initialized = FALSE;
85 g_critical ("Tried to initialized Hildon more than once.");
91 /* Register icon sizes */
92 gtk_icon_size_register ("hildon-xsmall", 16, 16);
93 gtk_icon_size_register ("hildon-small", 24, 24);
94 gtk_icon_size_register ("hildon-stylus", 32, 32);
95 gtk_icon_size_register ("hildon-finger", 48, 48);
96 gtk_icon_size_register ("hildon-thumb", 64, 64);
97 gtk_icon_size_register ("hildon-large", 96, 96);
98 gtk_icon_size_register ("hildon-xlarge", 128, 128);
103 * @argc: Address of the <parameter>argc</parameter>
104 * parameter of your main() function. Changed if any arguments were
106 * @argv: Address of the <parameter>argv</parameter>
107 * parameter of main(). Any parameters understood by gtk_init()
108 * are stripped before return.
110 * Convenience function to initialize the GTK+ and hildon
111 * libraries. Use this function to replace a call to gtk_init() and also
112 * initialize the hildon library. See hildon_init() and gtk_init() for details.
117 hildon_gtk_init (int *argc, char ***argv)
119 gtk_init (argc, argv);