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;
34 /* Requests delay from screen blanking
35 * Should be called at least once in every 60 seconds
36 * we're not bothered about errors here as dbus calls
37 * either succeed or not. Worst case would be dimmed
40 static gboolean delay_display_blanking(gpointer data) {
41 g_print("Requesting not to blank the screen in the next 60 secs.\n");
42 osso_display_blanking_pause(data);
47 appdata = g_new0(AppData, 1);
48 appdata->program = HILDON_PROGRAM(hildon_program_get_instance());
49 appdata->window = HILDON_WINDOW(hildon_window_new());
50 hildon_program_add_window(appdata->program, appdata->window);
52 appdata->osso_ctx = osso_initialize(PROGNAME, "1.0", FALSE, NULL);
54 delay_display_blanking(appdata->osso_ctx);
55 g_timeout_add(55000, (GSourceFunc) delay_display_blanking, appdata->osso_ctx);
59 osso_deinitialize(appdata->osso_ctx);
63 int main(int argc, char** argv) {
64 gtk_init(&argc, &argv);
68 // loads images from the disk to the image array
69 load_graphix(appdata);
72 set_digits_to_zero(appdata);
74 // inits the ui placement
79 show_cardware_dialog();
85 // here we cleanup things