2 * Copyright (C) 2011 Neverball authors
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 #include <SDL/SDL_timer.h>
24 static osso_context_t *osso_context = NULL;
25 static SDL_TimerID screen_timer_id = 0;
27 static Uint32 disable_display_blank(Uint32 interval, void *param)
30 ret = osso_display_blanking_pause(osso_context);
34 int maemo_init(const char *program)
36 osso_context = osso_initialize(program, "1.0", 0, NULL);
38 fprintf(stderr, "osso_initialize failed!\n");
42 osso_display_blanking_pause(osso_context);
43 screen_timer_id = SDL_AddTimer(30000, disable_display_blank, NULL);
50 osso_deinitialize(osso_context);
52 SDL_RemoveTimer(screen_timer_id);