4 #include <gdk-pixbuf/gdk-pixbuf.h>
11 get_logo_pixmap (void)
13 GdkPixbuf
*logo
= NULL
;
14 GtkWidget
* gpixmap
= NULL
;
17 gchar
* datadir
= dia_get_data_directory("");
18 g_snprintf(str
, sizeof(str
), "%s/dia_logo.png", datadir
);
19 logo
= gdk_pixbuf_new_from_file(str
, NULL
);
26 gdk_pixbuf_render_pixmap_and_mask(logo
, &pixmap
, &bitmap
, 128);
27 gpixmap
= gtk_pixmap_new(pixmap
, bitmap
);
28 gdk_pixmap_unref(pixmap
);
29 if (bitmap
) gdk_bitmap_unref(bitmap
);
30 g_object_unref (logo
);
35 static GtkWidget
* splash
= NULL
;
38 splash_expose (GtkWidget
*widget
, GdkEventExpose
*event
)
40 /* this gets called after the splash screen gets exposed ... */
45 app_splash_init (const gchar
* fname
)
54 splash
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
55 gtk_window_set_role (GTK_WINDOW (splash
), "start_dialog");
56 gtk_window_set_title (GTK_WINDOW (splash
), _("Loading ..."));
57 gtk_window_set_resizable (GTK_WINDOW (splash
), FALSE
);
58 gtk_window_set_position (GTK_WINDOW (splash
), GTK_WIN_POS_CENTER
);
60 vbox
= gtk_vbox_new (FALSE
, 2);
61 gtk_container_set_border_width (GTK_CONTAINER (vbox
), 5);
62 gtk_container_add (GTK_CONTAINER(splash
), vbox
);
64 gpixmap
= get_logo_pixmap();
66 frame
= gtk_frame_new (NULL
);
67 gtk_frame_set_shadow_type (GTK_FRAME (frame
), GTK_SHADOW_IN
);
68 gtk_container_set_border_width (GTK_CONTAINER (frame
), 1);
69 gtk_box_pack_start(GTK_BOX(vbox
), frame
, FALSE
, TRUE
, 1);
72 gtk_container_add (GTK_CONTAINER(frame
), gpixmap
);
74 g_snprintf(str
, sizeof(str
), _("Dia v %s"), VERSION
);
75 label
= gtk_label_new (str
);
76 gtk_box_pack_start(GTK_BOX(vbox
), label
, FALSE
, TRUE
, 1);
78 gtk_widget_show_all (splash
);
80 signal_id
= g_signal_connect_after(GTK_OBJECT(splash
), "expose_event",
81 GTK_SIGNAL_FUNC(splash_expose
), NULL
);
83 /* splash_expose gets us out of this */
85 g_signal_handler_disconnect(GTK_OBJECT(splash
), signal_id
);
89 app_splash_done (void)
93 gtk_widget_destroy (splash
);