/* * Copyright (C) 2004-2005 Vadim Berezniker * http://www.kryptolus.com * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "stdafx.h" #include "common.h" #include "sabbu.h" #include "resource.h" extern struct sabbu app; /* Shows splash screen and sleeps for 2 seconds */ void gui_splash_show() { GtkWindow *window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_POPUP)); GdkPixbuf *pixbuf = gui_main_load_image(IDR_LOGO); GtkImage *image = GTK_IMAGE(gtk_image_new_from_pixbuf(pixbuf)); GTimer *timer = g_timer_new(); gtk_misc_set_padding(GTK_MISC(image), 0, 0); gtk_container_set_border_width(GTK_CONTAINER(window), 0); gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(app.ui.window)); gtk_window_set_position(window, GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_set_decorated(window, FALSE); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(image)); gtk_widget_show_all(GTK_WIDGET(window)); g_timer_start(timer); while(g_timer_elapsed(timer, NULL) < 2.0) { while(gtk_events_pending()) gtk_main_iteration(); kry_sleep(100); } gui_main_focus(); gtk_widget_destroy(GTK_WIDGET(window)); g_object_unref(pixbuf); }