3 #include <pbd/failed_constructor.h>
4 #include <pbd/file_utils.h>
5 #include <ardour/ardour.h>
6 #include <ardour/filesystem_paths.h>
15 using namespace ARDOUR;
19 sys::path splash_file;
21 if (!find_file_in_search_path (ardour_search_path(), "splash.png", splash_file)) {
22 throw failed_constructor();
26 pixbuf = Gdk::Pixbuf::create_from_file (splash_file.to_string());
30 throw failed_constructor();
33 darea.set_size_request (pixbuf->get_width(), pixbuf->get_height());
34 set_keep_above (true);
35 set_position (WIN_POS_CENTER);
36 darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
38 layout = create_pango_layout ("");
40 string i18n = _("Ardour loading ...");
44 layout->set_markup (str);
47 darea.signal_expose_event().connect (mem_fun (*this, &Splash::expose));
55 Window::on_realize ();
56 get_window()->set_decorations (Gdk::WMDecoration(0));
57 layout->set_font_description (get_style()->get_font());
62 Splash::on_button_release_event (GdkEventButton* ev)
69 Splash::expose (GdkEventExpose* ev)
71 RefPtr<Gdk::Window> window = darea.get_window();
73 window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf,
74 ev->area.x, ev->area.y,
75 ev->area.x, ev->area.y,
76 ev->area.width, ev->area.height,
77 Gdk::RGB_DITHER_NONE, 0, 0);
79 Glib::RefPtr<Gtk::Style> style = darea.get_style();
80 Glib::RefPtr<Gdk::GC> white = style->get_white_gc();
82 window->draw_layout (white, 10, pixbuf->get_height() - 30, layout);
88 Splash::message (const string& msg)
94 layout->set_markup (str);
96 get_window()->process_updates (true);