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
);
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_DIALOG
);
57 gtk_window_set_wmclass (GTK_WINDOW (splash
), "start_dialog", "Dia");
58 gtk_window_set_title (GTK_WINDOW (splash
), _("Loading ..."));
59 gtk_window_set_policy (GTK_WINDOW (splash
), FALSE
, FALSE
, 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);
73 gtk_container_add (GTK_CONTAINER(frame
), gpixmap
);
75 g_snprintf(str
, sizeof(str
), _("Dia v %s"), VERSION
);
76 label
= gtk_label_new (str
);
77 gtk_box_pack_start(GTK_BOX(vbox
), label
, FALSE
, TRUE
, 1);
79 gtk_widget_show_all (splash
);
81 signal_id
= gtk_signal_connect_after(GTK_OBJECT(splash
), "expose_event",
82 GTK_SIGNAL_FUNC(splash_expose
), NULL
);
84 /* splash_expose gets us out of this */
86 gtk_signal_disconnect(GTK_OBJECT(splash
), signal_id
);
90 app_splash_done (void)
94 gtk_widget_destroy (splash
);