4 #include <gdk-pixbuf/gdk-pixbuf.h>
10 extern GdkPixbuf
*logo
;
13 get_logo_pixmap (void)
15 GtkWidget
* gpixmap
= NULL
;
19 gchar
* datadir
= dia_get_data_directory("");
20 g_snprintf(str
, sizeof(str
), "%s/dia_logo.png", datadir
);
21 logo
= gdk_pixbuf_new_from_file(str
, NULL
);
29 gdk_pixbuf_render_pixmap_and_mask(logo
, &pixmap
, &bitmap
, 128);
30 gpixmap
= gtk_pixmap_new(pixmap
, bitmap
);
31 gdk_pixmap_unref(pixmap
);
32 if (bitmap
) gdk_bitmap_unref(bitmap
);
37 static GtkWidget
* splash
= NULL
;
40 splash_expose (GtkWidget
*widget
, GdkEventExpose
*event
)
42 /* this gets called after the splash screen gets exposed ... */
47 app_splash_init (const gchar
* fname
)
56 splash
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
57 gtk_window_set_role (GTK_WINDOW (splash
), "start_dialog");
58 gtk_window_set_title (GTK_WINDOW (splash
), _("Loading ..."));
59 gtk_window_set_resizable (GTK_WINDOW (splash
), FALSE
);
60 gtk_window_set_position (GTK_WINDOW (splash
), GTK_WIN_POS_CENTER
);
62 vbox
= gtk_vbox_new (FALSE
, 2);
63 gtk_container_set_border_width (GTK_CONTAINER (vbox
), 5);
64 gtk_container_add (GTK_CONTAINER(splash
), vbox
);
66 gpixmap
= get_logo_pixmap();
68 frame
= gtk_frame_new (NULL
);
69 gtk_frame_set_shadow_type (GTK_FRAME (frame
), GTK_SHADOW_IN
);
70 gtk_container_set_border_width (GTK_CONTAINER (frame
), 1);
71 gtk_box_pack_start(GTK_BOX(vbox
), frame
, FALSE
, TRUE
, 1);
74 gtk_container_add (GTK_CONTAINER(frame
), gpixmap
);
76 g_snprintf(str
, sizeof(str
), _("Dia v %s"), VERSION
);
77 label
= gtk_label_new (str
);
78 gtk_box_pack_start(GTK_BOX(vbox
), label
, FALSE
, TRUE
, 1);
80 gtk_widget_show_all (splash
);
82 signal_id
= g_signal_connect_after(GTK_OBJECT(splash
), "expose_event",
83 GTK_SIGNAL_FUNC(splash_expose
), NULL
);
85 /* splash_expose gets us out of this */
87 g_signal_handler_disconnect(GTK_OBJECT(splash
), signal_id
);
91 app_splash_done (void)
95 gtk_widget_destroy (splash
);