Moved the examples folder to the trunk (as the examples should be related to the...
[maevies] / src / main.cpp
1 /*******************************************************************************
2  * Copyright (c) 2007-2008 INdT.
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7
8  *  This program is distributed in the hope that it will be useful,
9  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *  GNU Lesser General Public License for more details.
12
13  *  You should have received a copy of the GNU Lesser General Public License
14  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 /*
19  ============================================================================
20  Name        : main.cc
21  Author      : Simón Pena
22  Version     : 0.1
23  Description : CPP Hello World
24  ============================================================================
25  */
26
27 #include "config.h"
28
29 #include <libosso.h>
30 #include <hildonmm.h>
31 #include <iostream>
32 #include <glibmm/i18n.h> /* Must be after <iostream> */
33
34 #include "mywindow.h"
35
36 int main(int argc, char *argv[])
37 {
38         /* i18n initialization */
39         bindtextdomain(GETTEXT_PACKAGE, HELLOWORLD_LOCALEDIR);
40         bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
41         textdomain(GETTEXT_PACKAGE);
42
43         /* Initialize gtkmm and checks the arguments passed to your application */
44         Gtk::Main main_loop(&argc, &argv);
45
46         /* Initialize the hildonmm libraries */
47         Hildon::init();
48
49         /* Initialize libosso environment */
50         osso_context_t* osso_context = osso_initialize("maevies", "0.1", TRUE, 0);
51         if(!osso_context)
52                 std::cerr << "osso_initialize() failed." << std::endl;
53
54         /* Set the application name */
55         Glib::set_application_name(PACKAGE_STRING);
56
57         /* Create an object for the main Window and attach it to the program */
58         MyWindow window;
59         Hildon::Program::get_instance()->add_window(window);
60
61         /* Begin the main application */
62         main_loop.run(window);
63
64         /* Clean the libosso environment */
65         osso_deinitialize(osso_context);
66
67         return 0;
68 }