2 Speedometer, shows your current speed using GPS
3 Copyright (C) 2008 Wellu Mäkinen <wellu@wellu.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include <hildon/hildon-program.h>
20 #include <hildon/hildon-window.h>
25 #include "callbacks.h"
30 #define PROGNAME "org.wellu.speedometer"
32 static AppData *appdata;
33 static osso_context_t* osso_ctx;
35 /* Requests delay from screen blanking
36 * Should be called at least once in every 60 seconds
37 * we're not bothered about errors here as dbus calls
38 * either succeed or not. Worst case would be dimmed
41 static gboolean delay_display_blanking(gpointer data) {
42 g_print("Requesting not to blank the screen in the next 60 secs.\n");
43 osso_display_blanking_pause(data);
48 appdata = g_new0(AppData, 1);
49 appdata->program = HILDON_PROGRAM(hildon_program_get_instance());
50 appdata->window = HILDON_WINDOW(hildon_window_new());
51 hildon_program_add_window(appdata->program, appdata->window);
53 osso_ctx = osso_initialize(PROGNAME, "1.0", FALSE, NULL);
55 delay_display_blanking(osso_ctx);
56 g_timeout_add(55000, (GSourceFunc) delay_display_blanking, osso_ctx);
60 osso_deinitialize(osso_ctx);
64 int main(int argc, char** argv) {
65 gtk_init(&argc, &argv);
69 // loads images from the disk to the image array
70 load_graphics(appdata);
73 set_digits_to_zero(appdata);
75 // inits the ui placement
80 show_cardware_dialog();
86 // here we cleanup things